@@ -188,7 +188,7 @@ public function toMap(callable $keyGenerator): MapInterface
188188 public function removeElement ($ element ): OrderedListInterface
189189 {
190190 return $ this ->filter (
191- static function ($ value ) use ($ element ): bool {
191+ function ($ value ) use ($ element ): bool {
192192 return $ value !== $ element ;
193193 },
194194 );
@@ -219,14 +219,12 @@ public function unify(
219219 ?callable $ unificationIdentifierGenerator = null ,
220220 ?callable $ callback = null
221221 ): OrderedListInterface {
222- /** @psalm-suppress MissingClosureParamType */
222+ /**
223+ * @psalm-suppress MissingClosureParamType
224+ * @psalm-var callable(mixed):non-empty-string $unificationIdentifierGenerator
225+ */
223226 $ 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 ));
230228
231229 $ instance = clone $ this ;
232230
@@ -302,7 +300,7 @@ private function createListFilledWithValues(int $start, int $amount, $value): ar
302300 * @psalm-suppress MissingClosureReturnType We have to assume that the value contains the fill value.
303301 * @return TValue
304302 */
305- $ callable = static fn () => $ value ;
303+ $ callable = fn () => $ value ;
306304 }
307305
308306 for ($ index = $ start ; $ index < $ amount ; $ index ++) {
@@ -471,6 +469,6 @@ public function prepend($value): OrderedListInterface
471469
472470 public function removeAt (int $ index ): OrderedListInterface
473471 {
474- return $ this ->filter (static fn ($ _ , int $ i ) => $ i !== $ index );
472+ return $ this ->filter (fn ($ _ , int $ i ) => $ i !== $ index );
475473 }
476474}
0 commit comments