Updated Rector to commit 332aad337e

332aad337e fix casing of enums
This commit is contained in:
Tomas Votruba 2022-06-13 09:09:58 +00:00
parent b8c32ad549
commit 1ca568d18c
7 changed files with 26 additions and 24 deletions

View File

@ -8724,9 +8724,9 @@ Refactor Spatie enum class to native Enum
-class StatusEnum extends Enum
+enum StatusEnum : string
{
+ case draft = 'draft';
+ case published = 'published';
+ case archived = 'archived';
+ case DRAFT = 'draft';
+ case PUBLISHED = 'published';
+ case ARCHIVED = 'archived';
}
```

View File

@ -64,9 +64,9 @@ final class EnumFactory
$shortClassName = $this->nodeNameResolver->getShortName($class);
$enum = new Enum_($shortClassName);
// constant to cases
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($class);
$docBlockMethods = ($phpDocInfo2 = $phpDocInfo) ? $phpDocInfo2->getTagsByName('@method') : null;
if ($docBlockMethods !== null) {
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
$docBlockMethods = $phpDocInfo->getTagsByName('@method');
if ($docBlockMethods !== []) {
$enum->scalarType = new Identifier('string');
foreach ($docBlockMethods as $docBlockMethod) {
$enum->stmts[] = $this->createEnumCaseFromDocComment($docBlockMethod);
@ -87,6 +87,8 @@ final class EnumFactory
{
/** @var MethodTagValueNode $nodeValue */
$nodeValue = $phpDocTagNode->value;
return new EnumCase($nodeValue->methodName, $this->builderFactory->val($nodeValue->methodName));
$enumName = \strtoupper($nodeValue->methodName);
$enumExpr = $this->builderFactory->val($nodeValue->methodName);
return new EnumCase($enumName, $enumExpr);
}
}

View File

@ -51,9 +51,9 @@ CODE_SAMPLE
, <<<'CODE_SAMPLE'
enum StatusEnum : string
{
case draft = 'draft';
case published = 'published';
case archived = 'archived';
case DRAFT = 'draft';
case PUBLISHED = 'published';
case ARCHIVED = 'archived';
}
CODE_SAMPLE
)]);

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '6f164da43933c1fa957b1cf62c23e4ceed4839f8';
public const PACKAGE_VERSION = '332aad337e900bc5a23da5db3601d45b4fe901d4';
/**
* @var string
*/
public const RELEASE_DATE = '2022-06-13 08:53:39';
public const RELEASE_DATE = '2022-06-13 11:04:14';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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