2021-01-02 23:13:59 +07:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-11-15 01:54:27 +00:00
|
|
|
namespace RectorPrefix20211115;
|
2021-01-02 23:13:59 +07:00
|
|
|
|
|
|
|
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
|
|
|
use Rector\Renaming\ValueObject\MethodCallRename;
|
2021-06-02 10:21:10 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
2021-01-02 23:13:59 +07:00
|
|
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
2021-06-02 10:21:10 +00:00
|
|
|
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
|
2021-01-02 23:13:59 +07:00
|
|
|
$services = $containerConfigurator->services();
|
2021-05-10 22:23:08 +00:00
|
|
|
$services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->call('configure', [[\Rector\Renaming\Rector\MethodCall\RenameMethodRector::METHOD_CALL_RENAMES => \Symplify\SymfonyPhpConfig\ValueObjectInliner::inline([
|
2021-05-09 20:15:43 +00:00
|
|
|
// Rename is now move, specific for files.
|
2021-06-06 10:05:00 +00:00
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'rename', 'move'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// No arbitrary abbreviations
|
2021-06-06 10:05:00 +00:00
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'createDir', 'createDirectory'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// Writes are now deterministic
|
2021-06-06 10:05:00 +00:00
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'update', 'write'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'updateStream', 'writeStream'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'put', 'write'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'putStream', 'writeStream'),
|
2021-05-09 20:15:43 +00:00
|
|
|
// Metadata getters are renamed
|
2021-06-06 10:05:00 +00:00
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getTimestamp', 'lastModified'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'has', 'fileExists'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getMimetype', 'mimeType'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getSize', 'fileSize'),
|
|
|
|
new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'getVisibility', 'visibility'),
|
2021-05-09 20:15:43 +00:00
|
|
|
])]]);
|
2021-01-02 23:13:59 +07:00
|
|
|
};
|