Updated Rector to commit 4b18c82b21ad76410037090b0bf4c019fa983f08

4b18c82b21 [Scoper] Fix scoper to fix prefixed regex on doctrine inflector take 3 (#6657)
This commit is contained in:
Tomas Votruba 2025-01-06 16:26:54 +00:00
parent 47516301bf
commit bad8f383f5
13 changed files with 34 additions and 34 deletions

View File

@ -93,7 +93,7 @@ final class AutoloadIncluder
require_once $filePath; require_once $filePath;
} }
} }
\class_alias('\\AutoloadIncluder', 'AutoloadIncluder', \false); \class_alias('RectorPrefix202501\\AutoloadIncluder', 'AutoloadIncluder', \false);
if (\file_exists(__DIR__ . '/../preload.php') && \is_dir(__DIR__ . '/../vendor')) { if (\file_exists(__DIR__ . '/../preload.php') && \is_dir(__DIR__ . '/../vendor')) {
require_once __DIR__ . '/../preload.php'; require_once __DIR__ . '/../preload.php';
} }

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '3b42813953f335c8d2986c391629ce007ad06ea4'; public const PACKAGE_VERSION = '4b18c82b21ad76410037090b0bf4c019fa983f08';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2025-01-06 16:18:51'; public const RELEASE_DATE = '2025-01-06 16:24:17';
/** /**
* @var int * @var int
*/ */

View File

@ -13,7 +13,7 @@ namespace RectorPrefix202501\Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__; $GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php'; $GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php';
if (\PHP_VERSION_ID < 80000) { if (\PHP_VERSION_ID < 80000) {
if (!\class_exists('\\Composer\\BinProxyWrapper')) { if (!\class_exists('RectorPrefix202501\\Composer\\BinProxyWrapper')) {
/** /**
* @internal * @internal
*/ */
@ -87,7 +87,7 @@ if (\PHP_VERSION_ID < 80000) {
} }
} }
} }
if (\function_exists('stream_get_wrappers') && \in_array('phpvfscomposer', \stream_get_wrappers(), \true) || \function_exists('stream_wrapper_register') && \stream_wrapper_register('phpvfscomposer', '\\Composer\\BinProxyWrapper')) { if (\function_exists('stream_get_wrappers') && \in_array('phpvfscomposer', \stream_get_wrappers(), \true) || \function_exists('stream_wrapper_register') && \stream_wrapper_register('phpvfscomposer', 'RectorPrefix202501\\Composer\\BinProxyWrapper')) {
return include "phpvfscomposer://" . __DIR__ . '/..' . '/nikic/php-parser/bin/php-parse'; return include "phpvfscomposer://" . __DIR__ . '/..' . '/nikic/php-parser/bin/php-parse';
} }
} }

View File

@ -13,7 +13,7 @@ namespace RectorPrefix202501\Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__; $GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php'; $GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php';
if (\PHP_VERSION_ID < 80000) { if (\PHP_VERSION_ID < 80000) {
if (!\class_exists('\\Composer\\BinProxyWrapper')) { if (!\class_exists('RectorPrefix202501\\Composer\\BinProxyWrapper')) {
/** /**
* @internal * @internal
*/ */
@ -87,7 +87,7 @@ if (\PHP_VERSION_ID < 80000) {
} }
} }
} }
if (\function_exists('stream_get_wrappers') && \in_array('phpvfscomposer', \stream_get_wrappers(), \true) || \function_exists('stream_wrapper_register') && \stream_wrapper_register('phpvfscomposer', '\\Composer\\BinProxyWrapper')) { if (\function_exists('stream_get_wrappers') && \in_array('phpvfscomposer', \stream_get_wrappers(), \true) || \function_exists('stream_wrapper_register') && \stream_wrapper_register('phpvfscomposer', 'RectorPrefix202501\\Composer\\BinProxyWrapper')) {
return include "phpvfscomposer://" . __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint'; return include "phpvfscomposer://" . __DIR__ . '/..' . '/symfony/yaml/Resources/bin/yaml-lint';
} }
} }

View File

@ -53,7 +53,7 @@ class InstalledVersions
if (1 === \count($packages)) { if (1 === \count($packages)) {
return $packages[0]; return $packages[0];
} }
return \array_keys(\array_flip(\call_user_func_array('\\array_merge', $packages))); return \array_keys(\array_flip(\call_user_func_array('RectorPrefix202501\\array_merge', $packages)));
} }
/** /**
* Returns a list of all package names with a specific type e.g. 'library' * Returns a list of all package names with a specific type e.g. 'library'
@ -277,7 +277,7 @@ class InstalledVersions
private static function getInstalled() private static function getInstalled()
{ {
if (null === self::$canGetVendors) { if (null === self::$canGetVendors) {
self::$canGetVendors = \method_exists('\\Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders'); self::$canGetVendors = \method_exists('RectorPrefix202501\\Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');
} }
$installed = array(); $installed = array();
$copiedLocalDir = \false; $copiedLocalDir = \false;

View File

@ -168,7 +168,7 @@ class Inflector
} else { } else {
$lowered = strtolower($unaccented); $lowered = strtolower($unaccented);
} }
$replacements = ['/\\W/' => ' ', '/([A-Z]+)([A-Z][a-z])/' => 'RectorPrefix202501\\1_\\2', '/([a-z\\d])([A-Z])/' => 'RectorPrefix202501\\1_\\2', '/[^A-Z^a-z^0-9^\\/]+/' => '-']; $replacements = ['/\\W/' => ' ', '/([A-Z]+)([A-Z][a-z])/' => '\\1_\\2', '/([a-z\\d])([A-Z])/' => '\\1_\\2', '/[^A-Z^a-z^0-9^\\/]+/' => '-'];
$urlized = $lowered; $urlized = $lowered;
foreach ($replacements as $pattern => $replacement) { foreach ($replacements as $pattern => $replacement) {
$replaced = preg_replace($pattern, $replacement, $urlized); $replaced = preg_replace($pattern, $replacement, $urlized);

View File

@ -12,10 +12,10 @@ class Inflectible
/** @return Transformation[] */ /** @return Transformation[] */
public static function getSingular() : iterable public static function getSingular() : iterable
{ {
(yield new Transformation(new Pattern('(s)tatuses$'), 'RectorPrefix202501\\1\\2tatus')); (yield new Transformation(new Pattern('(s)tatuses$'), '\\1\\2tatus'));
(yield new Transformation(new Pattern('(s)tatus$'), 'RectorPrefix202501\\1\\2tatus')); (yield new Transformation(new Pattern('(s)tatus$'), '\\1\\2tatus'));
(yield new Transformation(new Pattern('(c)ampus$'), 'RectorPrefix202501\\1\\2ampus')); (yield new Transformation(new Pattern('(c)ampus$'), '\\1\\2ampus'));
(yield new Transformation(new Pattern('^(.*)(menu)s$'), 'RectorPrefix202501\\1\\2')); (yield new Transformation(new Pattern('^(.*)(menu)s$'), '\\1\\2'));
(yield new Transformation(new Pattern('(quiz)zes$'), '\\1')); (yield new Transformation(new Pattern('(quiz)zes$'), '\\1'));
(yield new Transformation(new Pattern('(matr)ices$'), '\\1ix')); (yield new Transformation(new Pattern('(matr)ices$'), '\\1ix'));
(yield new Transformation(new Pattern('(vert|ind)ices$'), '\\1ex')); (yield new Transformation(new Pattern('(vert|ind)ices$'), '\\1ex'));
@ -31,8 +31,8 @@ class Inflectible
(yield new Transformation(new Pattern('([^a])uses$'), '\\1us')); (yield new Transformation(new Pattern('([^a])uses$'), '\\1us'));
(yield new Transformation(new Pattern('([m|l])ice$'), '\\1ouse')); (yield new Transformation(new Pattern('([m|l])ice$'), '\\1ouse'));
(yield new Transformation(new Pattern('(x|ch|ss|sh)es$'), '\\1')); (yield new Transformation(new Pattern('(x|ch|ss|sh)es$'), '\\1'));
(yield new Transformation(new Pattern('(m)ovies$'), 'RectorPrefix202501\\1\\2ovie')); (yield new Transformation(new Pattern('(m)ovies$'), '\\1\\2ovie'));
(yield new Transformation(new Pattern('(s)eries$'), 'RectorPrefix202501\\1\\2eries')); (yield new Transformation(new Pattern('(s)eries$'), '\\1\\2eries'));
(yield new Transformation(new Pattern('([^aeiouy]|qu)ies$'), '\\1y')); (yield new Transformation(new Pattern('([^aeiouy]|qu)ies$'), '\\1y'));
(yield new Transformation(new Pattern('([lr])ves$'), '\\1f')); (yield new Transformation(new Pattern('([lr])ves$'), '\\1f'));
(yield new Transformation(new Pattern('(tive)s$'), '\\1')); (yield new Transformation(new Pattern('(tive)s$'), '\\1'));
@ -42,15 +42,15 @@ class Inflectible
(yield new Transformation(new Pattern('(olive)s$'), '\\1')); (yield new Transformation(new Pattern('(olive)s$'), '\\1'));
(yield new Transformation(new Pattern('([^fo])ves$'), '\\1fe')); (yield new Transformation(new Pattern('([^fo])ves$'), '\\1fe'));
(yield new Transformation(new Pattern('(^analy)ses$'), '\\1sis')); (yield new Transformation(new Pattern('(^analy)ses$'), '\\1sis'));
(yield new Transformation(new Pattern('(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$'), 'RectorPrefix202501\\1\\2sis')); (yield new Transformation(new Pattern('(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$'), '\\1\\2sis'));
(yield new Transformation(new Pattern('(tax)a$'), '\\1on')); (yield new Transformation(new Pattern('(tax)a$'), '\\1on'));
(yield new Transformation(new Pattern('(c)riteria$'), '\\1riterion')); (yield new Transformation(new Pattern('(c)riteria$'), '\\1riterion'));
(yield new Transformation(new Pattern('([ti])a(?<!regatta)$'), '\\1um')); (yield new Transformation(new Pattern('([ti])a(?<!regatta)$'), '\\1um'));
(yield new Transformation(new Pattern('(p)eople$'), 'RectorPrefix202501\\1\\2erson')); (yield new Transformation(new Pattern('(p)eople$'), '\\1\\2erson'));
(yield new Transformation(new Pattern('(m)en$'), '\\1an')); (yield new Transformation(new Pattern('(m)en$'), '\\1an'));
(yield new Transformation(new Pattern('(c)hildren$'), 'RectorPrefix202501\\1\\2hild')); (yield new Transformation(new Pattern('(c)hildren$'), '\\1\\2hild'));
(yield new Transformation(new Pattern('(f)eet$'), '\\1oot')); (yield new Transformation(new Pattern('(f)eet$'), '\\1oot'));
(yield new Transformation(new Pattern('(n)ews$'), 'RectorPrefix202501\\1\\2ews')); (yield new Transformation(new Pattern('(n)ews$'), '\\1\\2ews'));
(yield new Transformation(new Pattern('eaus$'), 'eau')); (yield new Transformation(new Pattern('eaus$'), 'eau'));
(yield new Transformation(new Pattern('^tights$'), 'tights')); (yield new Transformation(new Pattern('^tights$'), 'tights'));
(yield new Transformation(new Pattern('^shorts$'), 'shorts')); (yield new Transformation(new Pattern('^shorts$'), 'shorts'));
@ -59,15 +59,15 @@ class Inflectible
/** @return Transformation[] */ /** @return Transformation[] */
public static function getPlural() : iterable public static function getPlural() : iterable
{ {
(yield new Transformation(new Pattern('(s)tatus$'), 'RectorPrefix202501\\1\\2tatuses')); (yield new Transformation(new Pattern('(s)tatus$'), '\\1\\2tatuses'));
(yield new Transformation(new Pattern('(quiz)$'), '\\1zes')); (yield new Transformation(new Pattern('(quiz)$'), '\\1zes'));
(yield new Transformation(new Pattern('^(ox)$'), 'RectorPrefix202501\\1\\2en')); (yield new Transformation(new Pattern('^(ox)$'), '\\1\\2en'));
(yield new Transformation(new Pattern('([m|l])ouse$'), '\\1ice')); (yield new Transformation(new Pattern('([m|l])ouse$'), '\\1ice'));
(yield new Transformation(new Pattern('(matr|vert|ind)(ix|ex)$'), '\\1ices')); (yield new Transformation(new Pattern('(matr|vert|ind)(ix|ex)$'), '\\1ices'));
(yield new Transformation(new Pattern('(x|ch|ss|sh)$'), '\\1es')); (yield new Transformation(new Pattern('(x|ch|ss|sh)$'), '\\1es'));
(yield new Transformation(new Pattern('([^aeiouy]|qu)y$'), '\\1ies')); (yield new Transformation(new Pattern('([^aeiouy]|qu)y$'), '\\1ies'));
(yield new Transformation(new Pattern('(hive|gulf)$'), '\\1s')); (yield new Transformation(new Pattern('(hive|gulf)$'), '\\1s'));
(yield new Transformation(new Pattern('(?:([^f])fe|([lr])f)$'), 'RectorPrefix202501\\1\\2ves')); (yield new Transformation(new Pattern('(?:([^f])fe|([lr])f)$'), '\\1\\2ves'));
(yield new Transformation(new Pattern('sis$'), 'ses')); (yield new Transformation(new Pattern('sis$'), 'ses'));
(yield new Transformation(new Pattern('([ti])um$'), '\\1a')); (yield new Transformation(new Pattern('([ti])um$'), '\\1a'));
(yield new Transformation(new Pattern('(tax)on$'), '\\1a')); (yield new Transformation(new Pattern('(tax)on$'), '\\1a'));
@ -76,7 +76,7 @@ class Inflectible
(yield new Transformation(new Pattern('(m)an$'), '\\1en')); (yield new Transformation(new Pattern('(m)an$'), '\\1en'));
(yield new Transformation(new Pattern('(c)hild$'), '\\1hildren')); (yield new Transformation(new Pattern('(c)hild$'), '\\1hildren'));
(yield new Transformation(new Pattern('(f)oot$'), '\\1eet')); (yield new Transformation(new Pattern('(f)oot$'), '\\1eet'));
(yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)o$'), 'RectorPrefix202501\\1\\2oes')); (yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)o$'), '\\1\\2oes'));
(yield new Transformation(new Pattern('(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$'), '\\1i')); (yield new Transformation(new Pattern('(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$'), '\\1i'));
(yield new Transformation(new Pattern('us$'), 'uses')); (yield new Transformation(new Pattern('us$'), 'uses'));
(yield new Transformation(new Pattern('(alias)$'), '\\1es')); (yield new Transformation(new Pattern('(alias)$'), '\\1es'));

View File

@ -21,11 +21,11 @@ class Inflectible
/** @return Transformation[] */ /** @return Transformation[] */
public static function getPlural() : iterable public static function getPlural() : iterable
{ {
(yield new Transformation(new Pattern('/ú([sn])$/i'), 'RectorPrefix202501\\u\\1es')); (yield new Transformation(new Pattern('/ú([sn])$/i'), '\\u\\1es'));
(yield new Transformation(new Pattern('/ó([sn])$/i'), 'RectorPrefix202501\\o\\1es')); (yield new Transformation(new Pattern('/ó([sn])$/i'), '\\o\\1es'));
(yield new Transformation(new Pattern('/í([sn])$/i'), 'RectorPrefix202501\\i\\1es')); (yield new Transformation(new Pattern('/í([sn])$/i'), '\\i\\1es'));
(yield new Transformation(new Pattern('/é([sn])$/i'), 'RectorPrefix202501\\e\\1es')); (yield new Transformation(new Pattern('/é([sn])$/i'), '\\e\\1es'));
(yield new Transformation(new Pattern('/á([sn])$/i'), 'RectorPrefix202501\\a\\1es')); (yield new Transformation(new Pattern('/á([sn])$/i'), '\\a\\1es'));
(yield new Transformation(new Pattern('/z$/i'), 'ces')); (yield new Transformation(new Pattern('/z$/i'), 'ces'));
(yield new Transformation(new Pattern('/([aeiou]s)$/i'), '\\1')); (yield new Transformation(new Pattern('/([aeiou]s)$/i'), '\\1'));
(yield new Transformation(new Pattern('/([^aeéiou])$/i'), '\\1es')); (yield new Transformation(new Pattern('/([^aeéiou])$/i'), '\\1es'));

View File

@ -50,7 +50,7 @@ final class Query
{ {
$class = $this->class !== Message::CLASS_IN ? 'CLASS' . $this->class . ' ' : ''; $class = $this->class !== Message::CLASS_IN ? 'CLASS' . $this->class . ' ' : '';
$type = 'TYPE' . $this->type; $type = 'TYPE' . $this->type;
$ref = new \ReflectionClass('\\React\\Dns\\Model\\Message'); $ref = new \ReflectionClass('RectorPrefix202501\\React\\Dns\\Model\\Message');
foreach ($ref->getConstants() as $name => $value) { foreach ($ref->getConstants() as $name => $value) {
if ($value === $this->type && \strpos($name, 'TYPE_') === 0) { if ($value === $this->type && \strpos($name, 'TYPE_') === 0) {
$type = \substr($name, 5); $type = \substr($name, 5);

View File

@ -37,7 +37,7 @@ final class ExtLibevLoop implements LoopInterface
private $signalEvents = array(); private $signalEvents = array();
public function __construct() public function __construct()
{ {
if (!\class_exists('\\libev\\EventLoop', \false)) { if (!\class_exists('RectorPrefix202501\\libev\\EventLoop', \false)) {
throw new BadMethodCallException('Cannot create ExtLibevLoop, ext-libev extension missing'); throw new BadMethodCallException('Cannot create ExtLibevLoop, ext-libev extension missing');
} }
$this->loop = new EventLoop(); $this->loop = new EventLoop();

View File

@ -48,7 +48,7 @@ final class Factory
// only use ext-uv on PHP 7 // only use ext-uv on PHP 7
return new ExtUvLoop(); return new ExtUvLoop();
} }
if (\class_exists('\\libev\\EventLoop', \false)) { if (\class_exists('RectorPrefix202501\\libev\\EventLoop', \false)) {
return new ExtLibevLoop(); return new ExtLibevLoop();
} }
if (\class_exists('EvLoop', \false)) { if (\class_exists('EvLoop', \false)) {

View File

@ -2,6 +2,6 @@
namespace RectorPrefix202501; namespace RectorPrefix202501;
if (!\function_exists('\\React\\Promise\\resolve')) { if (!\function_exists('RectorPrefix202501\\React\\Promise\\resolve')) {
require __DIR__ . '/functions.php'; require __DIR__ . '/functions.php';
} }

View File

@ -10,7 +10,7 @@ namespace RectorPrefix202501;
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
if (!\function_exists('\\trigger_deprecation')) { if (!\function_exists('RectorPrefix202501\\trigger_deprecation')) {
/** /**
* Triggers a silenced deprecation notice. * Triggers a silenced deprecation notice.
* *