2021-01-02 16:13:59 +00:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-06-07 06:40:10 +00:00
|
|
|
namespace RectorPrefix20220607;
|
2021-01-02 16:13:59 +00:00
|
|
|
|
2022-06-06 17:12:56 +00:00
|
|
|
use Rector\Config\RectorConfig;
|
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
2022-06-07 08:22:29 +00:00
|
|
|
return static function (RectorConfig $rectorConfig) : void {
|
|
|
|
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
|
2021-05-09 20:15:43 +00:00
|
|
|
// Rename is now move, specific for files.
|
2022-06-07 08:22:29 +00:00
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'rename', 'move'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// No arbitrary abbreviations
|
2022-06-07 08:22:29 +00:00
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'createDir', 'createDirectory'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// Writes are now deterministic
|
2022-06-07 08:22:29 +00:00
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'update', 'write'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'updateStream', 'writeStream'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'put', 'write'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'putStream', 'writeStream'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// Metadata getters are renamed
|
2022-06-07 08:22:29 +00:00
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getTimestamp', 'lastModified'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'has', 'fileExists'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getMimetype', 'mimeType'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getSize', 'fileSize'),
|
|
|
|
new MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getVisibility', 'visibility'),
|
2021-11-30 13:55:08 +00:00
|
|
|
]);
|
2021-01-02 16:13:59 +00:00
|
|
|
};
|