mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-15 13:25:30 +01:00
Merge pull request #2081 from gnutix/StringifyStrNeedlesRector/adding-testcase
Add failing test: StringifyStrNeedlesRector adds (string) to a method call that returns a string anyway
This commit is contained in:
commit
affe5aef5f
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Php73\Tests\Rector\FuncCall\StringifyStrNeedlesRector\Fixture;
|
||||
|
||||
final class SkipAlreadyString
|
||||
{
|
||||
public function getNeedle(): string
|
||||
{
|
||||
return 'needle';
|
||||
}
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
return strpos('needle', (new SkipAlreadyString)->getNeedle());
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ final class StringifyStrNeedlesRectorTest extends AbstractRectorTestCase
|
||||
yield [__DIR__ . '/Fixture/fixture.php.inc'];
|
||||
yield [__DIR__ . '/Fixture/trait.php.inc'];
|
||||
yield [__DIR__ . '/Fixture/skip_twice.php.inc'];
|
||||
yield [__DIR__ . '/Fixture/skip_already_string.php.inc'];
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
|
Loading…
x
Reference in New Issue
Block a user