@@ -30,7 +30,7 @@ public function it_can_add_or_remove_members(): void
30
30
{
31
31
$ stringItem = Item::from ('helloWorld ' );
32
32
$ booleanItem = Item::from (true );
33
- $ instance = InnerList::fromMembers ($ stringItem , $ booleanItem );
33
+ $ instance = InnerList::from ($ stringItem , $ booleanItem );
34
34
35
35
self ::assertCount (2 , $ instance );
36
36
self ::assertTrue ($ instance ->has (1 ));
@@ -60,7 +60,7 @@ public function it_can_add_or_remove_members(): void
60
60
#[Test]
61
61
public function it_can_unshift_insert_and_replace (): void
62
62
{
63
- $ container = InnerList::fromMembers ()
63
+ $ container = InnerList::from ()
64
64
->unshift ('42 ' )
65
65
->push (42 )
66
66
->insert (1 , 42.0 )
@@ -75,7 +75,7 @@ public function it_can_unshift_insert_and_replace(): void
75
75
#[Test]
76
76
public function it_returns_the_same_object_if_nothing_is_changed (): void
77
77
{
78
- $ container = InnerList::fromMembers (42 , 'forty-two ' );
78
+ $ container = InnerList::from (42 , 'forty-two ' );
79
79
80
80
$ sameContainer = $ container
81
81
->unshift ()
@@ -90,21 +90,21 @@ public function it_fails_to_replace_invalid_index(): void
90
90
{
91
91
$ this ->expectException (InvalidOffset::class);
92
92
93
- InnerList::fromMembers ()->replace (0 , ByteSequence::fromDecoded ('Hello World ' ));
93
+ InnerList::from ()->replace (0 , ByteSequence::fromDecoded ('Hello World ' ));
94
94
}
95
95
96
96
#[Test]
97
97
public function it_fails_to_insert_at_an_invalid_index (): void
98
98
{
99
99
$ this ->expectException (InvalidOffset::class);
100
100
101
- InnerList::fromMembers ()->insert (3 , ByteSequence::fromDecoded ('Hello World ' ));
101
+ InnerList::from ()->insert (3 , ByteSequence::fromDecoded ('Hello World ' ));
102
102
}
103
103
104
104
#[Test]
105
105
public function it_fails_to_return_an_member_with_invalid_index (): void
106
106
{
107
- $ instance = InnerList::fromMembers ();
107
+ $ instance = InnerList::from ();
108
108
109
109
self ::assertFalse ($ instance ->has (3 ));
110
110
@@ -127,7 +127,7 @@ public function it_fails_to_access_unknown_parameter_values(): void
127
127
{
128
128
$ this ->expectException (StructuredFieldError::class);
129
129
130
- InnerList::fromMembers (false )->parameters ()->get ('bar ' )->value ();
130
+ InnerList::from (false )->parameters ()->get ('bar ' )->value ();
131
131
}
132
132
133
133
#[Test]
@@ -158,29 +158,29 @@ public function it_fails_to_insert_unknown_index_via_the_array_access_interface(
158
158
{
159
159
$ this ->expectException (StructuredFieldError::class);
160
160
161
- InnerList::fromMembers ()->insert (0 , Item::from (42.0 ));
161
+ InnerList::from ()->insert (0 , Item::from (42.0 ));
162
162
}
163
163
164
164
#[Test]
165
165
public function it_returns_the_same_object_if_no_member_is_removed (): void
166
166
{
167
- self ::assertCount (0 , InnerList::fromMembers ()->remove (0 ));
167
+ self ::assertCount (0 , InnerList::from ()->remove (0 ));
168
168
}
169
169
170
170
#[Test]
171
171
public function it_fails_to_fetch_an_value_using_an_integer (): void
172
172
{
173
173
$ this ->expectException (InvalidOffset::class);
174
174
175
- InnerList::fromMembers ()->get ('zero ' );
175
+ InnerList::from ()->get ('zero ' );
176
176
}
177
177
178
178
#[Test]
179
179
public function it_can_access_the_item_value (): void
180
180
{
181
181
$ token = Token::fromString ('token ' );
182
182
$ input = ['foobar ' , 0 , false , $ token ];
183
- $ structuredField = InnerList::fromMembers (...$ input );
183
+ $ structuredField = InnerList::from (...$ input );
184
184
185
185
self ::assertFalse ($ structuredField ->get (2 )->value ());
186
186
self ::assertEquals ($ token , $ structuredField ->get (-1 )->value ());
@@ -223,7 +223,7 @@ public function it_can_create_via_parameters_access_methods_a_new_object(): void
223
223
#[Test]
224
224
public function it_implements_the_array_access_interface (): void
225
225
{
226
- $ structuredField = InnerList::fromMembers ('foobar ' , 'foobar ' , 'zero ' , 0 );
226
+ $ structuredField = InnerList::from ('foobar ' , 'foobar ' , 'zero ' , 0 );
227
227
228
228
self ::assertInstanceOf (Item::class, $ structuredField ->get (0 ));
229
229
self ::assertInstanceOf (Item::class, $ structuredField [0 ]);
@@ -236,22 +236,22 @@ public function it_forbids_removing_members_using_the_array_access_interface():
236
236
{
237
237
$ this ->expectException (LogicException::class);
238
238
239
- unset(InnerList::fromMembers ('foobar ' , 'foobar ' , 'zero ' , 0 )[0 ]);
239
+ unset(InnerList::from ('foobar ' , 'foobar ' , 'zero ' , 0 )[0 ]);
240
240
}
241
241
242
242
#[Test]
243
243
public function it_forbids_adding_members_using_the_array_access_interface (): void
244
244
{
245
245
$ this ->expectException (LogicException::class);
246
246
247
- InnerList::fromMembers ('foobar ' , 'foobar ' , 'zero ' , 0 )[0 ] = Item::from (false );
247
+ InnerList::from ('foobar ' , 'foobar ' , 'zero ' , 0 )[0 ] = Item::from (false );
248
248
}
249
249
250
250
251
251
#[Test]
252
252
public function it_can_returns_the_container_member_keys (): void
253
253
{
254
- $ instance = InnerList::fromMembers ();
254
+ $ instance = InnerList::from ();
255
255
256
256
self ::assertSame ([], $ instance ->keys ());
257
257
@@ -260,7 +260,7 @@ public function it_can_returns_the_container_member_keys(): void
260
260
261
261
self ::assertSame ([0 , 1 ], $ newInstance ->keys ());
262
262
263
- $ container = InnerList::fromMembers ()
263
+ $ container = InnerList::from ()
264
264
->unshift ('42 ' )
265
265
->push (42 )
266
266
->insert (1 , 42.0 )
0 commit comments