-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip DateTime in ExpectedNameResolver (#5186)
- Loading branch information
1 parent
c9b0c27
commit 96fae07
Showing
4 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
...Rector/ClassMethod/RenameParamToMatchTypeRector/Fixture/skip_rewindable_generator.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector\Fixture; | ||
|
||
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; | ||
|
||
final class SkipRewindableGenerator | ||
{ | ||
public function __construct(RewindableGenerator $items) | ||
{ | ||
public function __construct( | ||
RewindableGenerator $items | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
stubs/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\DependencyInjection\Argument; | ||
|
||
if (class_exists('Symfony\\Component\\DependencyInjection\\Argument\\RewindableGenerator')) { | ||
return; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class RewindableGenerator implements \IteratorAggregate, \Countable | ||
{ | ||
private $generator; | ||
private $count; | ||
|
||
/** | ||
* @param int|callable $count | ||
*/ | ||
public function __construct(callable $generator, $count) | ||
{ | ||
$this->generator = $generator; | ||
$this->count = $count; | ||
} | ||
|
||
public function getIterator(): \Traversable | ||
{ | ||
$g = $this->generator; | ||
|
||
return $g(); | ||
} | ||
|
||
public function count(): int | ||
{ | ||
if (\is_callable($count = $this->count)) { | ||
$this->count = $count(); | ||
} | ||
|
||
return $this->count; | ||
} | ||
} |