Updated Rector to commit 780c5afe7b1623fe23e6c198665f692275fe798e

780c5afe7b [automated] Apply Coding Standard (#5031)
This commit is contained in:
Tomas Votruba 2023-09-17 00:30:04 +00:00
parent 279e6b242e
commit 6942fe920b
14 changed files with 22 additions and 24 deletions

View File

@ -4,14 +4,12 @@ declare (strict_types=1);
namespace Rector\CodeQuality\Rector\Equal;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\BinaryOp\Equal;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Expr\BinaryOp\NotEqual;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use Rector\Core\NodeAnalyzer\ExprAnalyzer;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

View File

@ -13,7 +13,6 @@ use PhpParser\Node\Expr\Cast\Int_;
use PhpParser\Node\Expr\Cast\Object_;
use PhpParser\Node\Expr\Cast\String_;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Stmt\ClassMethod;

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\Naming\Matcher;
use PhpParser\Node;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Stmt\ClassMethod;
@ -33,7 +34,7 @@ final class ForeachMatcher
public function match(Foreach_ $foreach, $functionLike) : ?VariableAndCallForeach
{
$call = $this->callMatcher->matchCall($foreach);
if ($call === null) {
if (!$call instanceof Node) {
return null;
}
if (!$foreach->valueVar instanceof Variable) {

View File

@ -41,7 +41,7 @@ final class VariableAndCallAssignMatcher
public function match(Assign $assign, $functionLike) : ?VariableAndCallAssign
{
$call = $this->callMatcher->matchCall($assign);
if ($call === null) {
if (!$call instanceof Node) {
return null;
}
if (!$assign->var instanceof Variable) {

View File

@ -5,7 +5,6 @@ namespace Rector\Privatization\Guard;
use PhpParser\Node;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;

View File

@ -46,7 +46,7 @@ CODE_SAMPLE
return null;
}
$returnTypeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::RETURN);
if ($returnTypeNode === null) {
if (!$returnTypeNode instanceof Node) {
return null;
}
$node->returnType = $returnTypeNode;

View File

@ -70,7 +70,7 @@ CODE_SAMPLE
continue;
}
$typeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($addPropertyTypeDeclaration->getType(), TypeKind::PROPERTY);
if ($typeNode === null) {
if (!$typeNode instanceof Node) {
// invalid configuration
throw new ShouldNotHappenException();
}

View File

@ -148,7 +148,7 @@ CODE_SAMPLE
}
$inferredType = $this->decorateTypeWithNullableIfDefaultPropertyNull($property, $inferredType);
$typeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($inferredType, TypeKind::PROPERTY);
if ($typeNode === null) {
if (!$typeNode instanceof Node) {
continue;
}
$hasChanged = \true;

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '0acf4bd13469aff2ad461317d026234840aa8091';
public const PACKAGE_VERSION = '780c5afe7b1623fe23e6c198665f692275fe798e';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-09-16 13:53:39';
public const RELEASE_DATE = '2023-09-17 00:27:18';
/**
* @var int
*/

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\Core\NodeDecorator;
use PhpParser\Node;
use PhpParser\Node\Stmt\Property;
use PHPStan\Type\Generic\GenericObjectType;
use PHPStan\Type\Type;
@ -49,7 +50,7 @@ final class PropertyTypeDecorator
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
if ($this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::TYPED_PROPERTIES)) {
$phpParserType = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PROPERTY);
if ($phpParserType !== null) {
if ($phpParserType instanceof Node) {
$property->type = $phpParserType;
if ($type instanceof GenericObjectType) {
$this->phpDocTypeChanger->changeVarType($property, $phpDocInfo, $type);

View File

@ -159,7 +159,7 @@ final class NodeFactory
$param = new ParamBuilder($name);
if ($type instanceof Type) {
$typeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PARAM);
if ($typeNode !== null) {
if ($typeNode instanceof Node) {
$param->setType($typeNode);
}
}
@ -279,7 +279,7 @@ final class NodeFactory
$propertyType = $propertyMetadata->getType();
if ($propertyType instanceof Type) {
$typeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($propertyType, TypeKind::PROPERTY);
if ($typeNode !== null) {
if ($typeNode instanceof Node) {
$paramBuilder->setType($typeNode);
}
}

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit094d7b995b2bd66adbf9d22d39e15d69
class ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit094d7b995b2bd66adbf9d22d39e15d69
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit094d7b995b2bd66adbf9d22d39e15d69', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit094d7b995b2bd66adbf9d22d39e15d69', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitbdae5ad336e59a52785a0110a2567f70', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$files;
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69
class ComposerStaticInitbdae5ad336e59a52785a0110a2567f70
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2593,9 +2593,9 @@ class ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit094d7b995b2bd66adbf9d22d39e15d69::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitbdae5ad336e59a52785a0110a2567f70::$classMap;
}, null, ClassLoader::class);
}