mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 5e78981c52c275786a67ca64a7b7104ef0d8775a
5e78981c52
[Php71] Set public constant on final constant on PublicConstantVisibilityRector (#3431)
This commit is contained in:
parent
cf1958e570
commit
7a073d6432
@ -55,16 +55,7 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
{
|
||||
// already non-public
|
||||
if (!$node->isPublic()) {
|
||||
return null;
|
||||
}
|
||||
// explicitly public
|
||||
if ($node->flags !== 0) {
|
||||
return null;
|
||||
}
|
||||
$this->visibilityManipulator->makePublic($node);
|
||||
return $node;
|
||||
return $this->visibilityManipulator->publicize($node);
|
||||
}
|
||||
public function provideMinPhpVersion() : int
|
||||
{
|
||||
|
@ -128,6 +128,23 @@ final class VisibilityManipulator
|
||||
{
|
||||
$this->removeVisibilityFlag($node, Visibility::READONLY);
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassConst|\PhpParser\Node\Stmt\ClassMethod $node
|
||||
* @return \PhpParser\Node\Stmt\ClassConst|\PhpParser\Node\Stmt\ClassMethod|null
|
||||
*/
|
||||
public function publicize($node)
|
||||
{
|
||||
// already non-public
|
||||
if (!$node->isPublic()) {
|
||||
return null;
|
||||
}
|
||||
// explicitly public
|
||||
if ($this->hasVisibility($node, Visibility::PUBLIC)) {
|
||||
return null;
|
||||
}
|
||||
$this->makePublic($node);
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* This way "abstract", "static", "final" are kept
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\ClassConst $node
|
||||
|
@ -6,7 +6,6 @@ namespace Rector\Visibility\Rector\ClassMethod;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\Visibility;
|
||||
use Rector\Privatization\NodeManipulator\VisibilityManipulator;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
@ -56,15 +55,6 @@ CODE_SAMPLE
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
{
|
||||
// already non-public
|
||||
if (!$node->isPublic()) {
|
||||
return null;
|
||||
}
|
||||
// explicitly public
|
||||
if ($this->visibilityManipulator->hasVisibility($node, Visibility::PUBLIC)) {
|
||||
return null;
|
||||
}
|
||||
$this->visibilityManipulator->makePublic($node);
|
||||
return $node;
|
||||
return $this->visibilityManipulator->publicize($node);
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '2eac878f538ddd1e20346c14d402f7e93ee6033b';
|
||||
public const PACKAGE_VERSION = '5e78981c52c275786a67ca64a7b7104ef0d8775a';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-03-01 01:18:39';
|
||||
public const RELEASE_DATE = '2023-03-01 03:36:40';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit931c0d2eaf587d3a9322637e254e6263::getLoader();
|
||||
return ComposerAutoloaderInited922c55772dbdaccfead0ed112219b5::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit931c0d2eaf587d3a9322637e254e6263
|
||||
class ComposerAutoloaderInited922c55772dbdaccfead0ed112219b5
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit931c0d2eaf587d3a9322637e254e6263
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit931c0d2eaf587d3a9322637e254e6263', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInited922c55772dbdaccfead0ed112219b5', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit931c0d2eaf587d3a9322637e254e6263', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInited922c55772dbdaccfead0ed112219b5', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit931c0d2eaf587d3a9322637e254e6263::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInited922c55772dbdaccfead0ed112219b5::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit931c0d2eaf587d3a9322637e254e6263::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInited922c55772dbdaccfead0ed112219b5::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit931c0d2eaf587d3a9322637e254e6263
|
||||
class ComposerStaticInited922c55772dbdaccfead0ed112219b5
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3126,9 +3126,9 @@ class ComposerStaticInit931c0d2eaf587d3a9322637e254e6263
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit931c0d2eaf587d3a9322637e254e6263::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit931c0d2eaf587d3a9322637e254e6263::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit931c0d2eaf587d3a9322637e254e6263::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInited922c55772dbdaccfead0ed112219b5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInited922c55772dbdaccfead0ed112219b5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInited922c55772dbdaccfead0ed112219b5::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user