Updated Rector to commit 31ad417ee444a31ed1ca07c54e9dddac2404fc1b

31ad417ee4 Make relativeFilePathFromDirectory() private as used only locally (#4735)
This commit is contained in:
Tomas Votruba 2023-08-09 13:19:45 +00:00
parent 7c1470fadd
commit 86016b833d
6 changed files with 29 additions and 22 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '6b84177a797f708f5abe2f69befe43d696e32ba5';
public const PACKAGE_VERSION = '31ad417ee444a31ed1ca07c54e9dddac2404fc1b';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-09 13:12:46';
public const RELEASE_DATE = '2023-08-09 13:15:10';
/**
* @var int
*/

View File

@ -41,16 +41,6 @@ final class FilePathHelper
}
return $this->relativeFilePathFromDirectory($fileRealPath, \getcwd());
}
/**
* @api
*/
public function relativeFilePathFromDirectory(string $fileRealPath, string $directory) : string
{
Assert::directory($directory);
$normalizedFileRealPath = $this->normalizePath($fileRealPath);
$relativeFilePath = $this->filesystem->makePathRelative($normalizedFileRealPath, $directory);
return \rtrim($relativeFilePath, '/');
}
/**
* Used from
* https://github.com/phpstan/phpstan-src/blob/02425e61aa48f0668b4efb3e73d52ad544048f65/src/File/FileHelper.php#L40, with custom modifications
@ -73,6 +63,13 @@ final class FilePathHelper
$pathStart = $scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : '';
return $pathStart . $pathRoot . \implode($directorySeparator, $normalizedPathParts);
}
private function relativeFilePathFromDirectory(string $fileRealPath, string $directory) : string
{
Assert::directory($directory);
$normalizedFileRealPath = $this->normalizePath($fileRealPath);
$relativeFilePath = $this->filesystem->makePathRelative($normalizedFileRealPath, $directory);
return \rtrim($relativeFilePath, '/');
}
private function normalizePath(string $filePath) : string
{
return \str_replace('\\', '/', $filePath);

View File

@ -42,6 +42,16 @@ final class RectorNodeTraverser extends NodeTraverser
$this->prepareNodeVisitors();
return parent::traverse($nodes);
}
/**
* @api used in tests to update the active rules
* @param PhpRectorInterface[] $phpRectors
*/
public function refreshPhpRectors(array $phpRectors) : void
{
$this->phpRectors = $phpRectors;
$this->visitors = [];
$this->areNodeVisitorsPrepared = \false;
}
/**
* This must happen after $this->configuration is set after ProcessCommand::execute() is run,
* otherwise we get default false positives.

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0::getLoader();
return ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0
class ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6db86b119341b9e9eb732a23233720f0::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit6db86b119341b9e9eb732a23233720f0
class ComposerStaticInitf171f725e817867a26e3a828aeeaf5de
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3002,9 +3002,9 @@ class ComposerStaticInit6db86b119341b9e9eb732a23233720f0
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$classMap;
}, null, ClassLoader::class);
}