Skip to content

Commit

Permalink
CS Fixing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Nov 14, 2023
1 parent 5ef4b5e commit 0b00b01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/AppendableIteratorAcceptanceResultBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @implements Contract\AcceptanceResultBucketInterface<Type>
*
* @deprecated This class is too complex and breaks the Least-surprise principle.
* @deprecated this class is too complex and breaks the Least-surprise principle
*/
final readonly class AppendableIteratorAcceptanceResultBucket implements Contract\AcceptanceResultBucketInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/AppendableIteratorRejectionResultBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @implements Contract\RejectionResultBucketInterface<Type>
*
* @deprecated This class is too complex and breaks the Least-surprise principle.
* @deprecated this class is too complex and breaks the Least-surprise principle
*/
final readonly class AppendableIteratorRejectionResultBucket implements Contract\RejectionResultBucketInterface
{
Expand Down
10 changes: 6 additions & 4 deletions src/ComplexResultBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ public function reasons(): ?array
{
return array_reduce(
array_map(
fn(Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->reasons(),
fn (Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->reasons(),
$this->rejections
),
function (array $carry, ?array $item): array {
if ($item !== null) {
if (null !== $item) {
array_push($carry, ...$item);
}

return $carry;
},
[]
Expand All @@ -66,13 +67,14 @@ public function exceptions(): ?array
{
return array_reduce(
array_map(
fn(Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->exceptions(),
fn (Contract\RejectionResultBucketInterface $rejection): ?array => $rejection->exceptions(),
$this->rejections
),
function (array $carry, ?array $item): array {
if ($item !== null) {
if (null !== $item) {
array_push($carry, ...$item);
}

return $carry;
},
[]
Expand Down

0 comments on commit 0b00b01

Please sign in to comment.