Skip to content

Commit 4ad09b3

Browse files
committed
Memorize if path is a pattern
1 parent 662943c commit 4ad09b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/core/etl/src/Flow/ETL/Filesystem/Path.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ final class Path
1616

1717
private string $filename;
1818

19+
private ?bool $isPattern = null;
20+
1921
private ?Partitions $partitions = null;
2022

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

207209
public function isPattern() : bool
208210
{
209-
return $this->isPathPattern($this->path);
211+
if ($this->isPattern !== null) {
212+
return $this->isPattern;
213+
}
214+
215+
$this->isPattern = $this->isPathPattern($this->path);
216+
217+
return $this->isPattern;
210218
}
211219

212220
public function matches(self $path) : bool

src/core/etl/src/Flow/ETL/Rows.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function add(Row ...$rows) : self
6262
}
6363

6464
/**
65-
* return array<Row>.
65+
* @return array<Row>
6666
*/
6767
public function all() : array
6868
{

0 commit comments

Comments
 (0)