Skip to content

Commit

Permalink
Updated Rector to commit 0fb4f5b
Browse files Browse the repository at this point in the history
rectorphp/rector-src@0fb4f5b [Core] Apply Scope Refresh on Enum_ (#2549)
  • Loading branch information
TomasVotruba committed Jun 21, 2022
1 parent 7e8b6a2 commit c9b4c3f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions packages/Parallel/Command/WorkerCommandLineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function create(string $mainScript, string $mainCommandClass, string $wor
if (\in_array($arg, $mainCommandNames, \true)) {
break;
}
$workerCommandArray[] = \escapeshellarg($arg);
$workerCommandArray[] = \escapeshellarg((string) $arg);
}
$workerCommandArray[] = $workerCommandName;
$mainCommandOptionNames = $this->getCommandOptionNames($mainCommand);
Expand Down Expand Up @@ -89,7 +89,7 @@ public function create(string $mainScript, string $mainCommandClass, string $wor
*
* tested in macOS and Ubuntu (github action)
*/
$workerCommandArray[] = \escapeshellarg($input->getOption(Option::CONFIG));
$workerCommandArray[] = \escapeshellarg((string) $input->getOption(Option::CONFIG));
}
return \implode(' ', $workerCommandArray);
}
Expand Down
8 changes: 2 additions & 6 deletions rules/Naming/Naming/PropertyNaming.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getExpectedNameFromMethodName(string $methodName) : ?ExpectedNam
if ($matches === null) {
return null;
}
$originalName = \lcfirst($matches['root_name']);
$originalName = \lcfirst((string) $matches['root_name']);
return new ExpectedName($originalName, $this->rectorNamingInflector->singularize($originalName));
}
public function getExpectedNameFromType(Type $type) : ?ExpectedName
Expand Down Expand Up @@ -118,11 +118,7 @@ public function fqnToVariableName($objectType) : string
$objectType = $objectType->getStaticObjectType();
}
$className = $this->resolveClassName($objectType);
if (\strpos($className, '\\') !== \false) {
$shortClassName = (string) Strings::after($className, '\\', -1);
} else {
$shortClassName = $className;
}
$shortClassName = \strpos($className, '\\') !== \false ? (string) Strings::after($className, '\\', -1) : $className;
$variableName = $this->removeInterfaceSuffixPrefix($shortClassName, 'interface');
$variableName = $this->removeInterfaceSuffixPrefix($variableName, 'abstract');
$variableName = $this->fqnToShortName($variableName);
Expand Down
2 changes: 2 additions & 0 deletions rules/Php81/NodeFactory/EnumFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function createFromClass(Class_ $class) : Enum_
{
$shortClassName = $this->nodeNameResolver->getShortName($class);
$enum = new Enum_($shortClassName);
$enum->namespacedName = $class->namespacedName;
$constants = $class->getConstants();
if ($constants !== []) {
$value = $this->valueResolver->getValue($constants[0]->consts[0]->value);
Expand All @@ -63,6 +64,7 @@ public function createFromSpatieClass(Class_ $class) : Enum_
{
$shortClassName = $this->nodeNameResolver->getShortName($class);
$enum = new Enum_($shortClassName);
$enum->namespacedName = $class->namespacedName;
// constant to cases
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
$docBlockMethods = $phpDocInfo->getTagsByName('@method');
Expand Down
8 changes: 4 additions & 4 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'e8ca23fd1592e9a0e6587d0ecddc6199a5c219d3';
public const PACKAGE_VERSION = '0fb4f5bfbbf4460ddb40b168cf40555f089d3a45';
/**
* @var string
*/
public const RELEASE_DATE = '2022-06-21 10:21:43';
public const RELEASE_DATE = '2022-06-21 16:54:05';
/**
* @var int
*/
Expand All @@ -42,7 +42,7 @@ public static function resolvePackageVersion() : string
if ($commitHashResultCode !== 0) {
throw new VersionException('Ensure to run compile from composer git repository clone and that git binary is available.');
}
$version = \trim($commitHashExecOutput[0]);
$version = \trim((string) $commitHashExecOutput[0]);
return \trim($version, '"');
}
public static function resolverReleaseDateTime() : DateTime
Expand All @@ -51,6 +51,6 @@ public static function resolverReleaseDateTime() : DateTime
if ($resultCode !== self::SUCCESS_CODE) {
throw new VersionException('You must ensure to run compile from composer git repository clone and that git binary is available.');
}
return new DateTime(\trim($output[0]));
return new DateTime(\trim((string) $output[0]));
}
}
3 changes: 1 addition & 2 deletions src/NodeAnalyzer/ScopeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\Enum_;
use PhpParser\Node\Stmt\Namespace_;
use Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace;
final class ScopeAnalyzer
{
/**
* @var array<class-string<Node>>
*/
private const NO_SCOPE_NODES = [Name::class, Namespace_::class, FileWithoutNamespace::class, Identifier::class, Enum_::class, Param::class, Arg::class];
private const NO_SCOPE_NODES = [Name::class, Namespace_::class, FileWithoutNamespace::class, Identifier::class, Param::class, Arg::class];
public function hasScope(Node $node) : bool
{
foreach (self::NO_SCOPE_NODES as $noScopeNode) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit7482d1e410f5a1f00d4671b7483d3336::getLoader();
return ComposerAutoloaderInitac80dd3f96317ef2ed4178b809982462::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit7482d1e410f5a1f00d4671b7483d3336
class ComposerAutoloaderInitac80dd3f96317ef2ed4178b809982462
{
private static $loader;

Expand All @@ -22,19 +22,19 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit7482d1e410f5a1f00d4671b7483d3336', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitac80dd3f96317ef2ed4178b809982462', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit7482d1e410f5a1f00d4671b7483d3336', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitac80dd3f96317ef2ed4178b809982462', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitac80dd3f96317ef2ed4178b809982462::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$includeFiles = \Composer\Autoload\ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInitac80dd3f96317ef2ed4178b809982462::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire7482d1e410f5a1f00d4671b7483d3336($fileIdentifier, $file);
composerRequireac80dd3f96317ef2ed4178b809982462($fileIdentifier, $file);
}

return $loader;
Expand All @@ -46,7 +46,7 @@ public static function getLoader()
* @param string $file
* @return void
*/
function composerRequire7482d1e410f5a1f00d4671b7483d3336($fileIdentifier, $file)
function composerRequireac80dd3f96317ef2ed4178b809982462($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336
class ComposerStaticInitac80dd3f96317ef2ed4178b809982462
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
Expand Down Expand Up @@ -3401,9 +3401,9 @@ class ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7482d1e410f5a1f00d4671b7483d3336::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitac80dd3f96317ef2ed4178b809982462::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitac80dd3f96317ef2ed4178b809982462::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitac80dd3f96317ef2ed4178b809982462::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit c9b4c3f

Please sign in to comment.