Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nreynis committed Sep 11, 2019
1 parent d1207f7 commit df1008a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Link/FlatMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public function flatMap(callable $callback)
{
$flattened = [];
foreach ($this->array as $index => $element) {
$transfomation = $callback($element, $index);
if (is_array($transfomation)) {
array_push($flattened, ...$transfomation);
$transformation = $callback($element, $index);
if (is_array($transformation)) {
array_push($flattened, ...$transformation);
} else {
$flattened[] = $transfomation;
$flattened[] = $transformation;
}
}
$this->array = $flattened;
Expand Down

0 comments on commit df1008a

Please sign in to comment.