@@ -188,7 +188,7 @@ public function toMap(callable $keyGenerator): MapInterface
188
188
public function removeElement ($ element ): OrderedListInterface
189
189
{
190
190
return $ this ->filter (
191
- static function ($ value ) use ($ element ): bool {
191
+ function ($ value ) use ($ element ): bool {
192
192
return $ value !== $ element ;
193
193
},
194
194
);
@@ -219,14 +219,12 @@ public function unify(
219
219
?callable $ unificationIdentifierGenerator = null ,
220
220
?callable $ callback = null
221
221
): OrderedListInterface {
222
- /** @psalm-suppress MissingClosureParamType */
222
+ /**
223
+ * @psalm-suppress MissingClosureParamType
224
+ * @psalm-var callable(mixed):non-empty-string $unificationIdentifierGenerator
225
+ */
223
226
$ unificationIdentifierGenerator = $ unificationIdentifierGenerator
224
- ?? static function ($ value ): string {
225
- $ hash = hash ('sha256 ' , serialize ($ value ));
226
- Assert::stringNotEmpty ($ hash );
227
-
228
- return $ hash ;
229
- };
227
+ ?? fn ($ value ): string => hash ('sha256 ' , serialize ($ value ));
230
228
231
229
$ instance = clone $ this ;
232
230
@@ -302,7 +300,7 @@ private function createListFilledWithValues(int $start, int $amount, $value): ar
302
300
* @psalm-suppress MissingClosureReturnType We have to assume that the value contains the fill value.
303
301
* @return TValue
304
302
*/
305
- $ callable = static fn () => $ value ;
303
+ $ callable = fn () => $ value ;
306
304
}
307
305
308
306
for ($ index = $ start ; $ index < $ amount ; $ index ++) {
@@ -471,6 +469,6 @@ public function prepend($value): OrderedListInterface
471
469
472
470
public function removeAt (int $ index ): OrderedListInterface
473
471
{
474
- return $ this ->filter (static fn ($ _ , int $ i ) => $ i !== $ index );
472
+ return $ this ->filter (fn ($ _ , int $ i ) => $ i !== $ index );
475
473
}
476
474
}
0 commit comments