Skip to content

Commit

Permalink
refactor: update Pair operation
Browse files Browse the repository at this point in the history
Minor optimization and get rid of a static analysis issue.
  • Loading branch information
drupol committed Oct 2, 2022
1 parent 2a0ed02 commit eed0c7e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ parameters:
count: 1
path: src/Operation/Nth.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, Closure\\(array\\)\\: array\\<int, mixed\\> given\\.$#"
count: 1
path: src/Operation/Pair.php

-
message: "#^Parameter \\#1 \\$ of closure expects callable\\(mixed\\=, mixed\\=, iterable\\=\\)\\: mixed, Closure\\(mixed, array\\)\\: mixed given\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/Pair.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function __invoke(): Closure
{
/** @var Closure(iterable<TKey, T>): Generator<T, T|null> $pipe */
$pipe = (new Pipe())()(
(new Normalize)(),
(new Chunk())()(2),
(new Map())()(static fn (array $value): array => array_values($value)),
(new Associate())()(
/**
* @param TKey $key
Expand Down

0 comments on commit eed0c7e

Please sign in to comment.