Skip to content

Commit

Permalink
Fix nullability using php 8.1 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mleczakm committed Jul 20, 2024
1 parent ebc64b8 commit a4b64e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/core/etl/src/Flow/ETL/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions src/core/etl/src/Flow/ETL/Rows.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a4b64e5

Please sign in to comment.