Skip to content

Commit

Permalink
Add RegexIterator
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Oct 10, 2024
1 parent 2db142d commit 48779b1
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 16 deletions.
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<LessSpecificReturnType>
<code><![CDATA[Generator]]></code>
<code><![CDATA[RecursiveIteratorIterator]]></code>
<code><![CDATA[RegexIterator]]></code>
<code><![CDATA[non-empty-string]]></code>
<code><![CDATA[string]]></code>
</LessSpecificReturnType>
Expand Down
14 changes: 14 additions & 0 deletions src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,20 @@ public function recursiveRegexIterator(
);
}

/**
* @throws FilesystemExceptionInterface
*/
#[Override]
public function regexIterator(string $directory, string $pattern): RegexIterator
{
return $this->safely(
static fn (FilesystemInterface $filesystem): RegexIterator => new RegexIterator(

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)

Check warning on line 698 in src/Filesystem.php

View workflow job for this annotation

GitHub Actions / automation / [PHP8.3][locked]Psalm on ubuntu

LessSpecificReturnType

src/Filesystem.php:698:58: LessSpecificReturnType: The inferred return type 'RegexIterator<IteratorAggregate|RecursiveIterator, mixed, RecursiveIteratorIterator<IteratorAggregate|RecursiveIterator>>' for /home/runner/work/filesystem/filesystem/src/filesystem.php:698:21254:-:closure is more specific than the declared return type 'RegexIterator' (see https://psalm.dev/088)
$filesystem->recursiveIteratorIterator($filesystem->recursiveDirectoryIterator($directory)),
$pattern,
)
);
}

/**
* @throws FilesystemExceptionInterface
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Interface/FilesystemInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public function recursiveRegexIterator(
int $mode = RegexIterator::GET_MATCH,
): RecursiveRegexIterator;

public function regexIterator(string $directory, string $pattern): RegexIterator;

public function relative(string $from, string $to): string;

public function size(string $path): int;
Expand Down
15 changes: 15 additions & 0 deletions tests/Unit/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,21 @@ public function testRecursiveRegexIterator(): void
self::fail('Should have found a file.');
}

/**
* @throws Throwable
*/
public function testRegexIterator(): void
{
$filesystem = Filesystem::new();

$totalNumberOfTests = 40; // in the tests/Unit directory

self::assertCount(
$totalNumberOfTests,
\iterator_to_array($filesystem->regexIterator(__DIR__, '#\.php#iu')),
);
}

/**
* @throws Throwable
*/
Expand Down

0 comments on commit 48779b1

Please sign in to comment.