Skip to content

Commit ae4262b

Browse files
[finder] Add stub for Finder (#211)
1 parent 97f0652 commit ae4262b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Symfony\Component\Finder;
4+
5+
use Countable;
6+
use IteratorAggregate;
7+
8+
/**
9+
* @implements IteratorAggregate<string, \SplFileInfo>
10+
*/
11+
class Finder implements IteratorAggregate, Countable
12+
{
13+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@symfony-common
2+
Feature: Finder
3+
4+
Background:
5+
Given I have Symfony plugin enabled
6+
7+
Scenario: Finder should be considered as an IteratorAggregate of SplFileInfo
8+
Given I have the following code
9+
"""
10+
<?php
11+
12+
use Symfony\Component\Finder\Finder;
13+
14+
class Test
15+
{
16+
/**
17+
* @param iterable<SplFileInfo> $files
18+
*/
19+
public static function run(iterable $files): void
20+
{
21+
}
22+
}
23+
24+
$finder = new Finder();
25+
Test::run($finder);
26+
"""
27+
When I run Psalm
28+
Then I see no errors

0 commit comments

Comments
 (0)