Updated Rector to commit c38a120d1193f8878fae85b0d96e88a1c644fd09

c38a120d11 Revert "[Scoper] Fix scoper to fix prefixed regex on doctrine inflector (#6654)" (#6655)
This commit is contained in:
Tomas Votruba 2025-01-06 16:16:03 +00:00
parent 96ec70632f
commit 1e4b4023a5
16 changed files with 42 additions and 42 deletions

View File

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

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd465f0f5c20e70b3fa315a3e9c618a9f9d1ea60b';
public const PACKAGE_VERSION = 'c38a120d1193f8878fae85b0d96e88a1c644fd09';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-01-06 16:07:25';
public const RELEASE_DATE = '2025-01-06 16:13:37';
/**
* @var int
*/

View File

@ -13,7 +13,7 @@ namespace RectorPrefix202501\Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php';
if (\PHP_VERSION_ID < 80000) {
if (!\class_exists('Composer\\BinProxyWrapper')) {
if (!\class_exists('RectorPrefix202501\\Composer\\BinProxyWrapper')) {
/**
* @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';
}
}

View File

@ -13,7 +13,7 @@ namespace RectorPrefix202501\Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..' . '/autoload.php';
if (\PHP_VERSION_ID < 80000) {
if (!\class_exists('Composer\\BinProxyWrapper')) {
if (!\class_exists('RectorPrefix202501\\Composer\\BinProxyWrapper')) {
/**
* @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';
}
}

View File

@ -53,7 +53,7 @@ class InstalledVersions
if (1 === \count($packages)) {
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'
@ -277,7 +277,7 @@ class InstalledVersions
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = \method_exists('Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');
self::$canGetVendors = \method_exists('RectorPrefix202501\\Composer\\Autoload\\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
$copiedLocalDir = \false;

View File

@ -92,8 +92,8 @@ If you want to setup custom singular and plural rules, you can configure these i
->withSingularRules(
new Ruleset(
new Transformations(
new Transformation(new Pattern('/^(bil)er$/i'), '1'),
new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '1ta')
new Transformation(new Pattern('/^(bil)er$/i'), '\1'),
new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta')
),
new Patterns(new Pattern('singulars')),
new Substitutions(new Substitution(new Word('spins'), new Word('spinor')))
@ -102,8 +102,8 @@ If you want to setup custom singular and plural rules, you can configure these i
->withPluralRules(
new Ruleset(
new Transformations(
new Transformation(new Pattern('^(bil)er$'), '1'),
new Transformation(new Pattern('^(inflec|contribu)tors$'), '1ta')
new Transformation(new Pattern('^(bil)er$'), '\1'),
new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta')
),
new Patterns(new Pattern('noflect'), new Pattern('abtuse')),
new Substitutions(

View File

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

View File

@ -12,10 +12,10 @@ class Inflectible
/** @return Transformation[] */
public static function getSingular() : iterable
{
(yield new Transformation(new Pattern('(s)tatuses$'), '1\\2tatus'));
(yield new Transformation(new Pattern('(s)tatus$'), '1\\2tatus'));
(yield new Transformation(new Pattern('(c)ampus$'), '1\\2ampus'));
(yield new Transformation(new Pattern('^(.*)(menu)s$'), '1\\2'));
(yield new Transformation(new Pattern('(s)tatuses$'), 'RectorPrefix202501\\1\\2tatus'));
(yield new Transformation(new Pattern('(s)tatus$'), 'RectorPrefix202501\\1\\2tatus'));
(yield new Transformation(new Pattern('(c)ampus$'), 'RectorPrefix202501\\1\\2ampus'));
(yield new Transformation(new Pattern('^(.*)(menu)s$'), 'RectorPrefix202501\\1\\2'));
(yield new Transformation(new Pattern('(quiz)zes$'), '\\1'));
(yield new Transformation(new Pattern('(matr)ices$'), '\\1ix'));
(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('([m|l])ice$'), '\\1ouse'));
(yield new Transformation(new Pattern('(x|ch|ss|sh)es$'), '\\1'));
(yield new Transformation(new Pattern('(m)ovies$'), '1\\2ovie'));
(yield new Transformation(new Pattern('(s)eries$'), '1\\2eries'));
(yield new Transformation(new Pattern('(m)ovies$'), 'RectorPrefix202501\\1\\2ovie'));
(yield new Transformation(new Pattern('(s)eries$'), 'RectorPrefix202501\\1\\2eries'));
(yield new Transformation(new Pattern('([^aeiouy]|qu)ies$'), '\\1y'));
(yield new Transformation(new Pattern('([lr])ves$'), '\\1f'));
(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('([^fo])ves$'), '\\1fe'));
(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$'), '1\\2sis'));
(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('(tax)a$'), '\\1on'));
(yield new Transformation(new Pattern('(c)riteria$'), '\\1riterion'));
(yield new Transformation(new Pattern('([ti])a(?<!regatta)$'), '\\1um'));
(yield new Transformation(new Pattern('(p)eople$'), '1\\2erson'));
(yield new Transformation(new Pattern('(p)eople$'), 'RectorPrefix202501\\1\\2erson'));
(yield new Transformation(new Pattern('(m)en$'), '\\1an'));
(yield new Transformation(new Pattern('(c)hildren$'), '1\\2hild'));
(yield new Transformation(new Pattern('(c)hildren$'), 'RectorPrefix202501\\1\\2hild'));
(yield new Transformation(new Pattern('(f)eet$'), '\\1oot'));
(yield new Transformation(new Pattern('(n)ews$'), '1\\2ews'));
(yield new Transformation(new Pattern('(n)ews$'), 'RectorPrefix202501\\1\\2ews'));
(yield new Transformation(new Pattern('eaus$'), 'eau'));
(yield new Transformation(new Pattern('^tights$'), 'tights'));
(yield new Transformation(new Pattern('^shorts$'), 'shorts'));
@ -59,15 +59,15 @@ class Inflectible
/** @return Transformation[] */
public static function getPlural() : iterable
{
(yield new Transformation(new Pattern('(s)tatus$'), '1\\2tatuses'));
(yield new Transformation(new Pattern('(s)tatus$'), 'RectorPrefix202501\\1\\2tatuses'));
(yield new Transformation(new Pattern('(quiz)$'), '\\1zes'));
(yield new Transformation(new Pattern('^(ox)$'), '1\\2en'));
(yield new Transformation(new Pattern('^(ox)$'), 'RectorPrefix202501\\1\\2en'));
(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('(x|ch|ss|sh)$'), '\\1es'));
(yield new Transformation(new Pattern('([^aeiouy]|qu)y$'), '\\1ies'));
(yield new Transformation(new Pattern('(hive|gulf)$'), '\\1s'));
(yield new Transformation(new Pattern('(?:([^f])fe|([lr])f)$'), '1\\2ves'));
(yield new Transformation(new Pattern('(?:([^f])fe|([lr])f)$'), 'RectorPrefix202501\\1\\2ves'));
(yield new Transformation(new Pattern('sis$'), 'ses'));
(yield new Transformation(new Pattern('([ti])um$'), '\\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('(c)hild$'), '\\1hildren'));
(yield new Transformation(new Pattern('(f)oot$'), '\\1eet'));
(yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)o$'), '1\\2oes'));
(yield new Transformation(new Pattern('(buffal|her|potat|tomat|volcan)o$'), 'RectorPrefix202501\\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('us$'), 'uses'));
(yield new Transformation(new Pattern('(alias)$'), '\\1es'));

View File

@ -21,11 +21,11 @@ class Inflectible
/** @return Transformation[] */
public static function getPlural() : iterable
{
(yield new Transformation(new Pattern('/ú([sn])$/i'), 'u\\1es'));
(yield new Transformation(new Pattern('/ó([sn])$/i'), 'o\\1es'));
(yield new Transformation(new Pattern('/í([sn])$/i'), 'i\\1es'));
(yield new Transformation(new Pattern('/é([sn])$/i'), 'e\\1es'));
(yield new Transformation(new Pattern('/á([sn])$/i'), 'a\\1es'));
(yield new Transformation(new Pattern('/ú([sn])$/i'), 'RectorPrefix202501\\u\\1es'));
(yield new Transformation(new Pattern('/ó([sn])$/i'), 'RectorPrefix202501\\o\\1es'));
(yield new Transformation(new Pattern('/í([sn])$/i'), 'RectorPrefix202501\\i\\1es'));
(yield new Transformation(new Pattern('/é([sn])$/i'), 'RectorPrefix202501\\e\\1es'));
(yield new Transformation(new Pattern('/á([sn])$/i'), 'RectorPrefix202501\\a\\1es'));
(yield new Transformation(new Pattern('/z$/i'), 'ces'));
(yield new Transformation(new Pattern('/([aeiou]s)$/i'), '\\1'));
(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 . ' ' : '';
$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) {
if ($value === $this->type && \strpos($name, 'TYPE_') === 0) {
$type = \substr($name, 5);

View File

@ -37,7 +37,7 @@ final class ExtLibevLoop implements LoopInterface
private $signalEvents = array();
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');
}
$this->loop = new EventLoop();

View File

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

View File

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

View File

@ -17,7 +17,7 @@ _sf_{{ COMMAND_NAME }}() {
done
# Use newline as only separator to allow space in completion values
local IFS=$'n'
local IFS=$'\n'
local sf_cmd="${COMP_WORDS[0]}"
# for an alias, get the real script behind it
@ -79,7 +79,7 @@ _sf_{{ COMMAND_NAME }}() {
# no quotes: double escaping
suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done)
fi
COMPREPLY=($(IFS=$'n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur")))
COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur")))
__ltrim_colon_completions "$cur"
else
if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then

View File

@ -61,14 +61,14 @@ _sf_{{ COMMAND_NAME }}() {
# Use eval to handle any environment variables and such
out=$(eval ${requestComp} 2>/dev/null)
while IFS='n' read -r comp; do
while IFS='\n' read -r comp; do
if [ -n "$comp" ]; then
# If requested, completions are returned with a description.
# The description is preceded by a TAB character.
# For zsh's _describe, we need to use a : instead of a TAB.
# We first need to escape any : as part of the completion itself.
comp=${comp//:/\\:}
local tab=$(printf 't')
local tab=$(printf '\t')
comp=${comp//$tab/:}
completions+=${comp}
fi

View File

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