File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ function () {
203
203
$ tmp_array_list ->add ('string2 ' );
204
204
$ this ->arrayList ->addAll ($ tmp_array_list );
205
205
expect ($ this ->arrayList ->isEmpty ())->toEqual (false );
206
+ expect ($ this ->arrayList ->size ())->toEqual (2 );
206
207
expect ($ this ->arrayList ->get (0 ))->toEqual ('string1 ' );
207
208
expect ($ this ->arrayList ->get (1 ))->toEqual ('string2 ' );
208
209
});
Original file line number Diff line number Diff line change @@ -151,11 +151,8 @@ public function addAll(...$args): bool
151
151
return true ;
152
152
}
153
153
$ this ->guardCollectionType ($ collection );
154
- foreach ($ collection as $ value ) {
155
- $ this ->values [] = $ value ;
156
- $ this ->size ++;
157
-
158
- }
154
+ $ this ->values = \array_merge ($ this ->values , $ collection ->toArray ());
155
+ $ this ->size += $ collection ->size ();
159
156
return true ;
160
157
},
161
158
"integer, {$ typeCollection }" => function ($ index , Collection $ collection ) {
You can’t perform that action at this time.
0 commit comments