Updated Rector to commit 9cb0a5efb59c51c662a4b6eb56753b9cc2174e21

9cb0a5efb5 [PHPStan] Resolve duplicated regex value (#2690)
This commit is contained in:
Tomas Votruba 2022-07-20 05:00:44 +00:00
parent f01bc715ee
commit 8a0350a804
7 changed files with 21 additions and 32 deletions

View File

@ -32,7 +32,7 @@ final class BreakingVariableRenameGuard
* @var string
* @see https://regex101.com/r/1pKLgf/1
*/
private const AT_NAMING_REGEX = '#[\\w+]At$#';
public const AT_NAMING_REGEX = '#[\\w+]At$#';
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder

View File

@ -16,11 +16,6 @@ use Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper;
*/
final class DateTimeAtNamingConventionGuard implements ConflictingNameGuardInterface
{
/**
* @var string
* @see https://regex101.com/r/1pKLgf/1/
*/
private const AT_NAMING_REGEX = '#[\\w+]At$#';
/**
* @readonly
* @var \Rector\NodeTypeResolver\NodeTypeResolver
@ -53,6 +48,6 @@ final class DateTimeAtNamingConventionGuard implements ConflictingNameGuardInter
if (!\is_a($type->getClassName(), DateTimeInterface::class, \true)) {
return \false;
}
return StringUtils::isMatch($propertyRename->getCurrentName(), self::AT_NAMING_REGEX . '');
return StringUtils::isMatch($propertyRename->getCurrentName(), \Rector\Naming\Guard\BreakingVariableRenameGuard::AT_NAMING_REGEX . '');
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'c74cda7cead18dc51061bd8540c64e98a6aec3b8';
public const PACKAGE_VERSION = '9cb0a5efb59c51c662a4b6eb56753b9cc2174e21';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-19 22:36:17';
public const RELEASE_DATE = '2022-07-20 06:55:29';
/**
* @var int
*/

View File

@ -35,12 +35,13 @@ final class RectorAssert
*/
private const PROPERTY_NAME_REGEX = '#^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$#';
/**
* @see https://regex101.com/r/uh5B0S/1
* @see https://regex101.com/r/uh5B0S/2
* @see https://www.php.net/manual/en/functions.user-defined.php
* @see https://www.php.net/manual/en/language.constants.php
*
* @var string
*/
private const METHOD_NAME_REGEX = '#^[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*$#';
private const METHOD_OR_CONSTANT_NAME_REGEX = '#^[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*$#';
/**
* @see https://regex101.com/r/uh5B0S/1
* @see https://www.php.net/manual/en/functions.user-defined.php
@ -48,20 +49,13 @@ final class RectorAssert
* @var string
*/
private const FUNCTION_NAME_REGEX = '#^(' . self::NAKED_NAMESPACE_REGEX . '\\\\)?([a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)$#';
/**
* @see https://www.php.net/manual/en/language.constants.php
* @see https://regex101.com/r/Fu6WHQ/1
*
* @var string
*/
private const CONSTANT_REGEX = '#^[a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*$#';
public static function namespaceName(string $name) : void
{
self::elementName($name, self::NAMESPACE_REGEX, 'namespace');
}
public static function constantName(string $name) : void
{
self::elementName($name, self::CONSTANT_REGEX, 'constant');
self::elementName($name, self::METHOD_OR_CONSTANT_NAME_REGEX, 'constant');
}
public static function className(string $name) : void
{
@ -73,7 +67,7 @@ final class RectorAssert
}
public static function methodName(string $name) : void
{
self::elementName($name, self::METHOD_NAME_REGEX, 'method');
self::elementName($name, self::METHOD_OR_CONSTANT_NAME_REGEX, 'method');
}
public static function functionName(string $name) : void
{

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf9108b5fc49468cd7aa425fa6979c934
class ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitf9108b5fc49468cd7aa425fa6979c934
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf9108b5fc49468cd7aa425fa6979c934', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitf9108b5fc49468cd7aa425fa6979c934', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8e6da83dabd79e423bc3c7245685560a', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiref9108b5fc49468cd7aa425fa6979c934($fileIdentifier, $file);
composerRequire8e6da83dabd79e423bc3c7245685560a($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitf9108b5fc49468cd7aa425fa6979c934
* @param string $file
* @return void
*/
function composerRequiref9108b5fc49468cd7aa425fa6979c934($fileIdentifier, $file)
function composerRequire8e6da83dabd79e423bc3c7245685560a($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 ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934
class ComposerStaticInit8e6da83dabd79e423bc3c7245685560a
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3402,9 +3402,9 @@ class ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf9108b5fc49468cd7aa425fa6979c934::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8e6da83dabd79e423bc3c7245685560a::$classMap;
}, null, ClassLoader::class);
}