mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-21 07:49:48 +01:00
Updated Rector to commit 31ad417ee444a31ed1ca07c54e9dddac2404fc1b
31ad417ee4
Make relativeFilePathFromDirectory() private as used only locally (#4735)
This commit is contained in:
parent
7c1470fadd
commit
86016b833d
src
Application
FileSystem
PhpParser/NodeTraverser
vendor
@ -19,12 +19,12 @@ final class VersionResolver
|
|||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '6b84177a797f708f5abe2f69befe43d696e32ba5';
|
public const PACKAGE_VERSION = '31ad417ee444a31ed1ca07c54e9dddac2404fc1b';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-08-09 13:12:46';
|
public const RELEASE_DATE = '2023-08-09 13:15:10';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
@ -41,16 +41,6 @@ final class FilePathHelper
|
|||||||
}
|
}
|
||||||
return $this->relativeFilePathFromDirectory($fileRealPath, \getcwd());
|
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
|
* Used from
|
||||||
* https://github.com/phpstan/phpstan-src/blob/02425e61aa48f0668b4efb3e73d52ad544048f65/src/File/FileHelper.php#L40, with custom modifications
|
* 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 . '://' : '';
|
$pathStart = $scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : '';
|
||||||
return $pathStart . $pathRoot . \implode($directorySeparator, $normalizedPathParts);
|
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
|
private function normalizePath(string $filePath) : string
|
||||||
{
|
{
|
||||||
return \str_replace('\\', '/', $filePath);
|
return \str_replace('\\', '/', $filePath);
|
||||||
|
@ -42,6 +42,16 @@ final class RectorNodeTraverser extends NodeTraverser
|
|||||||
$this->prepareNodeVisitors();
|
$this->prepareNodeVisitors();
|
||||||
return parent::traverse($nodes);
|
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,
|
* This must happen after $this->configuration is set after ProcessCommand::execute() is run,
|
||||||
* otherwise we get default false positives.
|
* otherwise we get default false positives.
|
||||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0::getLoader();
|
return ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de::getLoader();
|
||||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0
|
class ComposerAutoloaderInitf171f725e817867a26e3a828aeeaf5de
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit6db86b119341b9e9eb732a23233720f0
|
|||||||
return self::$loader;
|
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__));
|
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';
|
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->setClassMapAuthoritative(true);
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$files;
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInit6db86b119341b9e9eb732a23233720f0
|
class ComposerStaticInitf171f725e817867a26e3a828aeeaf5de
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||||
@ -3002,9 +3002,9 @@ class ComposerStaticInit6db86b119341b9e9eb732a23233720f0
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInit6db86b119341b9e9eb732a23233720f0::$classMap;
|
$loader->classMap = ComposerStaticInitf171f725e817867a26e3a828aeeaf5de::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user