Skip to content

Commit 69f02aa

Browse files
committed
feature symfony#45725 [Finder] Fix SplFileInfo PHPDoc (InvisibleSmiley)
This PR was merged into the 6.1 branch. Discussion ---------- [Finder] Fix SplFileInfo PHPDoc | Q | A | ------------- | --- | Branch? | 6.1 (5.4 later) | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#45672 | License | MIT Not sure how to test this, maybe you do. Commits ------- 57856be Fix SplFileInfo PHPDoc
2 parents 16f0668 + 57856be commit 69f02aa

8 files changed

+26
-11
lines changed

src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,27 @@
1111

1212
namespace Symfony\Component\Finder\Iterator;
1313

14+
use Symfony\Component\Finder\SplFileInfo;
15+
1416
/**
1517
* ExcludeDirectoryFilterIterator filters out directories.
1618
*
1719
* @author Fabien Potencier <[email protected]>
1820
*
19-
* @extends \FilterIterator<string, \SplFileInfo>
20-
* @implements \RecursiveIterator<string, \SplFileInfo>
21+
* @extends \FilterIterator<string, SplFileInfo>
22+
* @implements \RecursiveIterator<string, SplFileInfo>
2123
*/
2224
class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator
2325
{
26+
/** @var \Iterator<string, SplFileInfo> */
2427
private \Iterator $iterator;
2528
private bool $isRecursive;
2629
private array $excludedDirs = [];
2730
private ?string $excludedPattern = null;
2831

2932
/**
30-
* @param \Iterator $iterator The Iterator to filter
31-
* @param string[] $directories An array of directories to exclude
33+
* @param \Iterator<string, SplFileInfo> $iterator The Iterator to filter
34+
* @param string[] $directories An array of directories to exclude
3235
*/
3336
public function __construct(\Iterator $iterator, array $directories)
3437
{

src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class FileTypeFilterIterator extends \FilterIterator
2626
private int $mode;
2727

2828
/**
29-
* @param \Iterator $iterator The Iterator to filter
30-
* @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
29+
* @param \Iterator<string, \SplFileInfo> $iterator The Iterator to filter
30+
* @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES)
3131
*/
3232
public function __construct(\Iterator $iterator, int $mode)
3333
{

src/Symfony/Component/Finder/Iterator/FilecontentFilterIterator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
namespace Symfony\Component\Finder\Iterator;
1313

14+
use Symfony\Component\Finder\SplFileInfo;
15+
1416
/**
1517
* FilecontentFilterIterator filters files by their contents using patterns (regexps or strings).
1618
*
1719
* @author Fabien Potencier <[email protected]>
1820
* @author Włodzimierz Gajda <[email protected]>
1921
*
20-
* @extends MultiplePcreFilterIterator<string, \SplFileInfo>
22+
* @extends MultiplePcreFilterIterator<string, SplFileInfo>
2123
*/
2224
class FilecontentFilterIterator extends MultiplePcreFilterIterator
2325
{

src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ abstract class MultiplePcreFilterIterator extends \FilterIterator
2727
protected $noMatchRegexps = [];
2828

2929
/**
30-
* @param \Iterator $iterator The Iterator to filter
31-
* @param string[] $matchPatterns An array of patterns that need to match
32-
* @param string[] $noMatchPatterns An array of patterns that need to not match
30+
* @param \Iterator<TKey, TValue> $iterator The Iterator to filter
31+
* @param string[] $matchPatterns An array of patterns that need to match
32+
* @param string[] $noMatchPatterns An array of patterns that need to not match
3333
*/
3434
public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
3535
{

src/Symfony/Component/Finder/Iterator/PathFilterIterator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
namespace Symfony\Component\Finder\Iterator;
1313

14+
use Symfony\Component\Finder\SplFileInfo;
15+
1416
/**
1517
* PathFilterIterator filters files by path patterns (e.g. some/special/dir).
1618
*
1719
* @author Fabien Potencier <[email protected]>
1820
* @author Włodzimierz Gajda <[email protected]>
1921
*
20-
* @extends MultiplePcreFilterIterator<string, \SplFileInfo>
22+
* @extends MultiplePcreFilterIterator<string, SplFileInfo>
2123
*/
2224
class PathFilterIterator extends MultiplePcreFilterIterator
2325
{

src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Extends the \RecursiveDirectoryIterator to support relative paths.
1919
*
2020
* @author Victor Berchet <[email protected]>
21+
* @extends \RecursiveDirectoryIterator<string, SplFileInfo>
2122
*/
2223
class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
2324
{

src/Symfony/Component/Finder/Iterator/SortableIterator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class SortableIterator implements \IteratorAggregate
2828
public const SORT_BY_MODIFIED_TIME = 5;
2929
public const SORT_BY_NAME_NATURAL = 6;
3030

31+
/** @var \Traversable<string, \SplFileInfo> $iterator */
3132
private \Traversable $iterator;
3233
private \Closure|int $sort;
3334

src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\Finder\Gitignore;
1515

16+
/**
17+
* @extends \FilterIterator<string, \SplFileInfo>
18+
*/
1619
final class VcsIgnoredFilterIterator extends \FilterIterator
1720
{
1821
/**
@@ -30,6 +33,9 @@ final class VcsIgnoredFilterIterator extends \FilterIterator
3033
*/
3134
private $ignoredPathsCache = [];
3235

36+
/**
37+
* @param \Iterator<string, \SplFileInfo> $iterator
38+
*/
3339
public function __construct(\Iterator $iterator, string $baseDir)
3440
{
3541
$this->baseDir = $this->normalizePath($baseDir);

0 commit comments

Comments
 (0)