mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 19:53:14 +01:00
commit
c3176bd711
@ -20,7 +20,7 @@ final class RemoveDeadStmtRectorTest extends AbstractRectorTestCase
|
||||
|
||||
public function provideDataForTest(): Iterator
|
||||
{
|
||||
yield from $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
|
@ -133,7 +133,7 @@ PHP
|
||||
return $node;
|
||||
}
|
||||
|
||||
$match = Strings::match($node->value, '#(\\$|\\\\)(?<number>\d+)#');
|
||||
$match = Strings::match($node->value, '#(\\$|\\\\|\\x0)(?<number>\d+)#');
|
||||
if (! $match) {
|
||||
return $node;
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Php55\Tests\Rector\FuncCall\PregReplaceEModifierRector\Fixture;
|
||||
|
||||
class Slashes
|
||||
{
|
||||
public static function camelize($word)
|
||||
{
|
||||
return preg_replace('#a#e', "strtoupper('\\0___');", $word);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Php55\Tests\Rector\FuncCall\PregReplaceEModifierRector\Fixture;
|
||||
|
||||
class Slashes
|
||||
{
|
||||
public static function camelize($word)
|
||||
{
|
||||
return preg_replace_callback('#a#', function ($matches) {
|
||||
return strtoupper($matches[0]);
|
||||
}, $word);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -10,7 +10,7 @@ use Symfony\Component\Finder\SplFileInfo;
|
||||
|
||||
final class StaticFixtureProvider
|
||||
{
|
||||
public static function yieldFilesFromDirectory(string $directory, string $suffix = '*.php'): Iterator
|
||||
public static function yieldFilesFromDirectory(string $directory, string $suffix): Iterator
|
||||
{
|
||||
$fileInfos = self::findFilesInDirectory($directory, $suffix);
|
||||
|
||||
|
@ -18,7 +18,7 @@ final class _Name_Test extends AbstractRectorTestCase
|
||||
|
||||
public function provideDataForTest(): \Iterator
|
||||
{
|
||||
yield [__DIR__ . '/Fixture/fixture.php.inc'];
|
||||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
protected function getRectorClass(): string
|
||||
|
Loading…
x
Reference in New Issue
Block a user