mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 13:13:31 +00:00
[PHPStan 1.0] Use Nette filesystem over phpstan filewriter (#1115)
This commit is contained in:
parent
6a894b4939
commit
e525dad6ab
|
@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||||
namespace Rector\Caching\ValueObject\Storage;
|
namespace Rector\Caching\ValueObject\Storage;
|
||||||
|
|
||||||
use FilesystemIterator;
|
use FilesystemIterator;
|
||||||
|
use Nette\Utils\FileSystem;
|
||||||
use Nette\Utils\Random;
|
use Nette\Utils\Random;
|
||||||
use PHPStan\File\FileWriter;
|
|
||||||
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
||||||
use Rector\Caching\ValueObject\CacheFilePaths;
|
use Rector\Caching\ValueObject\CacheFilePaths;
|
||||||
use Rector\Caching\ValueObject\CacheItem;
|
use Rector\Caching\ValueObject\CacheItem;
|
||||||
|
@ -70,7 +70,7 @@ final class FileCacheStorage implements CacheStorageInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// for performance reasons we don't use SmartFileSystem
|
// for performance reasons we don't use SmartFileSystem
|
||||||
FileWriter::write($tmpPath, \sprintf("<?php declare(strict_types = 1);\n\nreturn %s;", $exported));
|
FileSystem::write($tmpPath, \sprintf("<?php declare(strict_types = 1);\n\nreturn %s;", $exported));
|
||||||
$renameSuccess = @\rename($tmpPath, $path);
|
$renameSuccess = @\rename($tmpPath, $path);
|
||||||
if ($renameSuccess) {
|
if ($renameSuccess) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -522,3 +522,7 @@ parameters:
|
||||||
- '#Property Rector\\Transform\\Rector\\FuncCall\\ArgumentFuncCallToMethodCallRector\:\:\$arrayFunctionsToMethodCalls \(array<Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>\) does not accept array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\|Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>#'
|
- '#Property Rector\\Transform\\Rector\\FuncCall\\ArgumentFuncCallToMethodCallRector\:\:\$arrayFunctionsToMethodCalls \(array<Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>\) does not accept array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\|Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>#'
|
||||||
- '#Property Rector\\Transform\\Rector\\FuncCall\\ArgumentFuncCallToMethodCallRector\:\:\$argumentFuncCallToMethodCalls \(array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\>\) does not accept array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\|Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>#'
|
- '#Property Rector\\Transform\\Rector\\FuncCall\\ArgumentFuncCallToMethodCallRector\:\:\$argumentFuncCallToMethodCalls \(array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\>\) does not accept array<Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall\|Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall\>#'
|
||||||
|
|
||||||
|
# use lighter service for performance reasons
|
||||||
|
-
|
||||||
|
path: packages/Caching/ValueObject/Storage/FileCacheStorage.php
|
||||||
|
message: '#Instead of "Nette\\Utils\\FileSystem" class/interface use "Symplify\\SmartFileSystem\\SmartFileSystem"#'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user