@@ -49,8 +49,7 @@ public function it_should_assign_a_value_to_a_parameter()
49
49
/** @test */
50
50
public function it_should_throw_an_error_on_immutble_parameters ()
51
51
{
52
- $ model = new class () extends ApiModel
53
- {
52
+ $ model = new class () extends ApiModel {
54
53
public function getFooAttribute ()
55
54
{
56
55
return 'bar ' ;
@@ -66,8 +65,7 @@ public function getFooAttribute()
66
65
/** @test */
67
66
public function it_should_throw_an_error_on_immutble_methods ()
68
67
{
69
- $ model = new class () extends ApiModel
70
- {
68
+ $ model = new class () extends ApiModel {
71
69
public function fakeMethod (): string
72
70
{
73
71
return 'I return a string ' ;
@@ -83,8 +81,7 @@ public function fakeMethod(): string
83
81
/** @test */
84
82
public function it_should_return_null_getting_value_on_defined_methods ()
85
83
{
86
- $ model = new class () extends ApiModel
87
- {
84
+ $ model = new class () extends ApiModel {
88
85
public function fakeMethod (): string
89
86
{
90
87
return 'I return a string ' ;
@@ -157,7 +154,7 @@ public function it_should_cast_single_relationship_to_model()
157
154
$ harbor = new Harbor ([
158
155
'city ' => [
159
156
'data ' => [
160
- 'id ' => 1 ,
157
+ 'id ' => 1 ,
161
158
'name ' => 'Montevideo ' ,
162
159
],
163
160
],
@@ -172,7 +169,7 @@ public function it_should_cast_single_relationship_to_model_and_preserve_attribu
172
169
$ harbor = new Harbor ([
173
170
'city ' => [
174
171
'data ' => [
175
- 'id ' => 1 ,
172
+ 'id ' => 1 ,
176
173
'name ' => 'Montevideo ' ,
177
174
],
178
175
],
@@ -186,7 +183,7 @@ public function it_should_cast_single_relationship_to_model_event_without_data()
186
183
{
187
184
$ harbor = new Harbor ([
188
185
'city ' => [
189
- 'id ' => 1 ,
186
+ 'id ' => 1 ,
190
187
'name ' => 'Montevideo ' ,
191
188
],
192
189
]);
@@ -199,7 +196,7 @@ public function it_should_refresh_a_relationship_when_setting_new_value()
199
196
{
200
197
$ harbor = new Harbor ([
201
198
'city ' => [
202
- 'id ' => 1 ,
199
+ 'id ' => 1 ,
203
200
'name ' => 'Montevideo ' ,
204
201
],
205
202
]);
@@ -217,7 +214,7 @@ public function it_should_property_from_relationship_should_be_accessed()
217
214
$ harbor = new Harbor ([
218
215
'city ' => [
219
216
'data ' => [
220
- 'id ' => 1 ,
217
+ 'id ' => 1 ,
221
218
'name ' => 'Montevideo ' ,
222
219
],
223
220
],
@@ -233,7 +230,7 @@ public function it_should_property_from_relationship_should_be_accessed_as_objec
233
230
$ harbor = new Harbor ([
234
231
'city ' => [
235
232
'data ' => [
236
- 'id ' => 1 ,
233
+ 'id ' => 1 ,
237
234
'name ' => 'Montevideo ' ,
238
235
],
239
236
],
@@ -249,7 +246,7 @@ public function it_should_property_from_relationship_should_be_accessed_double()
249
246
$ harbor = new Harbor ([
250
247
'city ' => [
251
248
'data ' => [
252
- 'id ' => 1 ,
249
+ 'id ' => 1 ,
253
250
'name ' => 'Montevideo ' ,
254
251
],
255
252
],
@@ -265,10 +262,10 @@ public function it_should_preserve_attributes_for_child_properties()
265
262
$ harbor = new Harbor ([
266
263
'city ' => [
267
264
'data ' => [
268
- 'id ' => 1 ,
269
- 'name ' => 'Montevideo ' ,
265
+ 'id ' => 1 ,
266
+ 'name ' => 'Montevideo ' ,
270
267
'partner_city ' => [
271
- 'id ' => 2 ,
268
+ 'id ' => 2 ,
272
269
'name ' => 'Berlin ' ,
273
270
],
274
271
],
@@ -286,11 +283,11 @@ public function it_should_return_a_collection_of_boats()
286
283
'boats ' => [
287
284
'data ' => [
288
285
[
289
- 'id ' => 1 ,
286
+ 'id ' => 1 ,
290
287
'name ' => 'Queen Mary ' ,
291
288
],
292
289
[
293
- 'id ' => 2 ,
290
+ 'id ' => 2 ,
294
291
'name ' => 'Reconcho ' ,
295
292
],
296
293
],
@@ -307,11 +304,11 @@ public function it_should_refresh_a_collection_of_relationships()
307
304
'boats ' => [
308
305
'data ' => [
309
306
[
310
- 'id ' => 1 ,
307
+ 'id ' => 1 ,
311
308
'name ' => 'Queen Mary ' ,
312
309
],
313
310
[
314
- 'id ' => 2 ,
311
+ 'id ' => 2 ,
315
312
'name ' => 'Reconcho ' ,
316
313
],
317
314
],
@@ -340,9 +337,9 @@ public function it_should_eager_load_default_relationships()
340
337
'visited_cities ' => [
341
338
'data ' => [
342
339
[
343
- 'name ' => 'Montevideo ' ,
340
+ 'name ' => 'Montevideo ' ,
344
341
'partner_city ' => [
345
- 'id ' => 2 ,
342
+ 'id ' => 2 ,
346
343
'name ' => 'Berlin ' ,
347
344
],
348
345
],
@@ -360,8 +357,7 @@ public function it_should_eager_load_default_relationships()
360
357
/** @test */
361
358
public function it_should_not_eager_load_any_relationship_if_not_in_include_default_array ()
362
359
{
363
- $ model = new class (['visited_cities ' => ['data ' => [['name ' => 'Montevideo ' ], ['name ' => 'London ' ]]]]) extends ApiModel
364
- {
360
+ $ model = new class (['visited_cities ' => ['data ' => [['name ' => 'Montevideo ' ], ['name ' => 'London ' ]]]]) extends ApiModel {
365
361
public function visitedCities ()
366
362
{
367
363
return $ this ->hasMany (City::class, 'visited_cities ' );
0 commit comments