diff --git a/src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php b/src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php index 78145b145..df8c7ad0d 100644 --- a/src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php +++ b/src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php @@ -151,9 +151,9 @@ public function greaterThanEqual(ScalarFunction $ref) : self return new GreaterThanEqual($this, $ref); } - public function hash(?Algorithm $algorithm = null) : self + public function hash(Algorithm $algorithm = new NativePHPHash()) : self { - return new Hash($this, $algorithm ?? new NativePHPHash()); + return new Hash($this, $algorithm); } public function isEven() : self diff --git a/src/core/etl/src/Flow/ETL/Row.php b/src/core/etl/src/Flow/ETL/Row.php index 5102d7e0a..697f7f542 100644 --- a/src/core/etl/src/Flow/ETL/Row.php +++ b/src/core/etl/src/Flow/ETL/Row.php @@ -55,10 +55,8 @@ public function has(string|Reference $ref) : bool return $this->entries->has($ref); } - public function hash(?Algorithm $algorithm = null) : string + public function hash(Algorithm $algorithm = new NativePHPHash()) : string { - $algorithm = $algorithm ?? new NativePHPHash(); - $string = ''; foreach ($this->entries->sort()->all() as $entry) { diff --git a/src/core/etl/src/Flow/ETL/Rows.php b/src/core/etl/src/Flow/ETL/Rows.php index 371c71d48..2fd5de2b6 100644 --- a/src/core/etl/src/Flow/ETL/Rows.php +++ b/src/core/etl/src/Flow/ETL/Rows.php @@ -268,10 +268,8 @@ public function getIterator() : \Iterator return new \ArrayIterator($this->rows); } - public function hash(?Algorithm $algorithm = null) : string + public function hash(Algorithm $algorithm = new NativePHPHash()) : string { - $algorithm = $algorithm ?? new NativePHPHash(); - $hashes = []; foreach ($this->rows as $row) {