Skip to content

Commit

Permalink
Fix function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
hguenot committed Mar 7, 2021
1 parent ccdaa76 commit e420ae1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
22 changes: 15 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
nbproject
docs/api/phpdoc-cache-*
docs/coverage
# composer generated files
/vendor/
composer.lock

# -- Temp folder
coverage.xml
docs/api/phpdoc-cache-*
docs/coverage
yarn.lock
test-report.xml

# -- IDE specific path / files
nbproject
.settings
.buildpath
.project
composer.lock
test-report.xml
yarn.lock
.phpunit.result.cache
.DS_Store
.reports
*.iml
.idea
.idea
2 changes: 1 addition & 1 deletion src/phpstream/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public abstract function max(callable|Comparator $cmp = null): Optional;
*
* @return mixed The reduced value of the stream.
*/
public abstract function reduce(callable|BinaryFunction $reducer, $initialValue = null): mixed;
public abstract function reduce(callable|BinaryFunction $reducer, mixed $initialValue = null): mixed;

/**
* Collect data according given Stream collector.
Expand Down
2 changes: 1 addition & 1 deletion src/phpstream/impl/GeneratorStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function max(callable|Comparator $cmp = null): Optional {
return $collector->collect($this->iterable);
}

public function reduce(callable|BinaryFunction $reducer, $initialValue = null): mixed {
public function reduce(callable|BinaryFunction $reducer, mixed $initialValue = null): mixed {
$iterable = $this->iterable;
$fn = $reducer instanceof BinaryFunction
? function ($carry, $item) use ($reducer) {
Expand Down

0 comments on commit e420ae1

Please sign in to comment.