Skip to content

Commit

Permalink
Memorize if path is a pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Apr 12, 2024
1 parent 662943c commit 4ad09b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/core/etl/src/Flow/ETL/Filesystem/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ final class Path

private string $filename;

private ?bool $isPattern = null;

private ?Partitions $partitions = null;

private string $path;
Expand Down Expand Up @@ -206,7 +208,13 @@ public function isLocal() : bool

public function isPattern() : bool
{
return $this->isPathPattern($this->path);
if ($this->isPattern !== null) {
return $this->isPattern;
}

$this->isPattern = $this->isPathPattern($this->path);

return $this->isPattern;
}

public function matches(self $path) : bool
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Rows.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function add(Row ...$rows) : self
}

/**
* return array<Row>.
* @return array<Row>
*/
public function all() : array
{
Expand Down

0 comments on commit 4ad09b3

Please sign in to comment.