fix preg_match made array type [closes #786]

Signed-off-by: Tomas Votruba <tomas.vot@gmail.com>
This commit is contained in:
Tomas Votruba 2018-12-06 01:34:20 +01:00
parent 231ac15879
commit 5d421585fd

21
fixturize.php Normal file
View File

@ -0,0 +1,21 @@
<?php declare(strict_types=1);
use Nette\Utils\FileSystem;
use Nette\Utils\Strings;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
require __DIR__ . '/vendor/autoload.php';
// 1. rename files
$finder = (new Finder())->files()
->in([__DIR__ . '/packages', __DIR__ . '/tests'])
->name('#(wrong|Wrong)#');
/** @var SplFileInfo $fileInfo */
foreach ($finder as $fileInfo) {
$newName = Strings::replace($fileInfo->getRealPath(), '#wrong#', 'fixture');
FileSystem::rename($fileInfo->getRealPath(), $newName);
// remove old file
unlink($fileInfo->getRealPath());
}