From e420ae1cba7424fd14c858ae4b716189383cb952 Mon Sep 17 00:00:00 2001 From: hguenot Date: Sun, 7 Mar 2021 08:40:46 +0100 Subject: [PATCH] Fix function declaration --- .gitignore | 22 +++++++++++++++------- src/phpstream/Stream.php | 2 +- src/phpstream/impl/GeneratorStream.php | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 5459cb6..333cac1 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +.idea diff --git a/src/phpstream/Stream.php b/src/phpstream/Stream.php index 022945d..bd1e55a 100644 --- a/src/phpstream/Stream.php +++ b/src/phpstream/Stream.php @@ -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. diff --git a/src/phpstream/impl/GeneratorStream.php b/src/phpstream/impl/GeneratorStream.php index 11e8805..157a7d9 100644 --- a/src/phpstream/impl/GeneratorStream.php +++ b/src/phpstream/impl/GeneratorStream.php @@ -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) {