Updated Rector to commit dc9189280f

dc9189280f [PHPStan] Update to PHPStan ^1.7.0 (#2354)
This commit is contained in:
Tomas Votruba 2022-05-24 13:01:35 +00:00
parent 3e7be42701
commit b93cf80a4f
17 changed files with 59 additions and 52 deletions

View File

@ -7,7 +7,7 @@
],
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "1.6.9"
"phpstan/phpstan": "^1.7.1"
},
"autoload": {
"files": [

View File

@ -165,7 +165,7 @@ final class ArrayTypeAnalyzer
$phpPropertyReflection = $this->reflectionResolver->resolvePropertyReflectionFromPropertyFetch($node);
if ($phpPropertyReflection instanceof \PHPStan\Reflection\Php\PhpPropertyReflection) {
$reflectionProperty = $phpPropertyReflection->getNativeReflection();
return \is_array($reflectionProperty->getDeclaringClass()->getDefaultProperties()[$reflectionProperty->getName()] ?? null);
return \is_array($reflectionProperty->getDefaultValue());
}
return \false;
}

View File

@ -178,12 +178,12 @@ CODE_SAMPLE
if (!$classReflection->hasMethod($methodName)) {
return null;
}
$reflectionClass = $classReflection->getNativeReflection();
if (!$reflectionClass->hasMethod($methodName)) {
$nativeReflection = $classReflection->getNativeReflection();
if (!$nativeReflection->hasMethod($methodName)) {
return null;
}
// Find the param we're looking for
return $reflectionClass->getMethod($methodName);
return $nativeReflection->getMethod($methodName);
}
private function getDifferentParamTypeFromReflectionMethod(\ReflectionMethod $reflectionMethod, string $paramName, string $paramTypeName) : ?string
{

View File

@ -118,7 +118,10 @@ CODE_SAMPLE
if (!$node instanceof \PhpParser\Node\Expr\Assign) {
return \false;
}
return $this->isObjectType($node->expr, new \PHPStan\Type\ObjectType('mysqli'));
if ($this->isObjectType($node->expr, new \PHPStan\Type\ObjectType('mysqli'))) {
return \true;
}
return $node->expr instanceof \PhpParser\Node\Expr\FuncCall && $this->nodeNameResolver->isName($node->expr, 'mysqli_connect');
});
if (!$connectionAssign instanceof \PhpParser\Node\Expr\Assign) {
return null;

View File

@ -170,8 +170,8 @@ CODE_SAMPLE
return \false;
}
$classReflection = $this->reflectionProvider->getClass($className);
$reflectionClass = $classReflection->getNativeReflection();
$reflectionMethod = $reflectionClass->getConstructor();
$nativeReflection = $classReflection->getNativeReflection();
$reflectionMethod = $nativeReflection->getConstructor();
if (!$reflectionMethod instanceof \ReflectionMethod) {
return \true;
}

View File

@ -31,8 +31,8 @@ final class ClassConstantsResolver
return [];
}
$classReflection = $this->reflectionProvider->getClass($classWithConstants);
$reflectionClass = $classReflection->getNativeReflection();
$constantNamesToValues = $reflectionClass->getConstants();
$nativeReflection = $classReflection->getNativeReflection();
$constantNamesToValues = $nativeReflection->getConstants();
$this->cachedConstantNamesToValues = $constantNamesToValues;
return $constantNamesToValues;
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'a14bd2665535ea0d8ec6f3307db302c7f8a5fc68';
public const PACKAGE_VERSION = 'dc9189280f34a29309ee3b9de20c788ed46402c8';
/**
* @var string
*/
public const RELEASE_DATE = '2022-05-24 08:59:18';
public const RELEASE_DATE = '2022-05-24 19:55:12';
/**
* @var string
*/

View File

@ -146,8 +146,8 @@ final class PropertyPresenceChecker
private function resolveNonPrivatePropertyNames(\PHPStan\Reflection\ClassReflection $classReflection) : array
{
$propertyNames = [];
$reflectionClass = $classReflection->getNativeReflection();
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
$nativeReflection = $classReflection->getNativeReflection();
foreach ($nativeReflection->getProperties() as $reflectionProperty) {
if ($reflectionProperty->isPrivate()) {
continue;
}

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa
class ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit1d71cc90e37f236bc02c7c114b395455::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit1d71cc90e37f236bc02c7c114b395455::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire31cf8238e92e71a0eecfce265e2994fa($fileIdentifier, $file);
composerRequire1d71cc90e37f236bc02c7c114b395455($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa
* @param string $file
* @return void
*/
function composerRequire31cf8238e92e71a0eecfce265e2994fa($fileIdentifier, $file)
function composerRequire1d71cc90e37f236bc02c7c114b395455($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 ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa
class ComposerStaticInit1d71cc90e37f236bc02c7c114b395455
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3914,9 +3914,9 @@ class ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit31cf8238e92e71a0eecfce265e2994fa::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit1d71cc90e37f236bc02c7c114b395455::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit1d71cc90e37f236bc02c7c114b395455::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit1d71cc90e37f236bc02c7c114b395455::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1099,17 +1099,17 @@
},
{
"name": "phpstan\/phpstan",
"version": "1.6.9",
"version_normalized": "1.6.9.0",
"version": "1.7.1",
"version_normalized": "1.7.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
"reference": "8c98899c7c54251a098befd23b50a983594a20f9"
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/8c98899c7c54251a098befd23b50a983594a20f9",
"reference": "8c98899c7c54251a098befd23b50a983594a20f9",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719",
"reference": "e3baed2ee2ef322e0f9b8fe8f87fdbe024c7c719",
"shasum": ""
},
"require": {
@ -1118,7 +1118,7 @@
"conflict": {
"phpstan\/phpstan-shim": "*"
},
"time": "2022-05-21T11:34:44+00:00",
"time": "2022-05-24T09:05:09+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@ -1137,7 +1137,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.6.9"
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.7.1"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -57,6 +57,10 @@ can be checked before you run the actual line.
<a href="https://www.campoint.net/"><img src="https://i.imgur.com/fR6eMUm.png" alt="campoint AG" width="283" height="64"></a>
<br>
<a href="https://www.crisp.nl/"><img src="https://i.imgur.com/jRJyPve.png" alt="Crisp.nl" width="283" height="64"></a>
&nbsp;&nbsp;&nbsp;
<a href="https://inviqa.com/"><img src="https://i.imgur.com/G99rj45.png" alt="Inviqa" width="254" height="65"></a>
<br>
<a href="https://www.psyonix.com/"><img src="https://i.imgur.com/p8svxQZ.png" alt="Psyonix" width="254" height="65"></a>
[**You can now sponsor my open-source work on PHPStan through GitHub Sponsors.**](https://github.com/sponsors/ondrejmirtes)

Binary file not shown.

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmKIzkoACgkQzxoQjQ56
5yACNhAAoPI8mTshFnoEHHGs1+9kxQ0VxNL0LhxLiL+uIY65cYvgc75ZaXytjE9E
NNXfDz21/hKNtOgXvTc6vzp1uItEJlu2o2eLJMXAR4ksYjaHeXMxD+KMtsUwQvLh
Ieof/WUQiLNjmO0OaIp8ph/zjeoOJQvM1FtsE4x5TpjZDpcsUG7gWlIf+nWoERhd
18lKMwx+azl14TIAG51QVjitOUNJPoub/+dQBna2i34ZQkgZvPriziivcS7xuZUc
iPoBhL5/1WaxN+34Gfg4T+kjv/VRWVyAEICwUoloGElATgfs5weixNBagQgdu6g2
ZOXf7mADLaaXAw50E/EtYN+VamPp4/qye4J2R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INGgeQfTYxXCHUisRMY6ADQ3TRA4=
=PFW6
-----END PGP SIGNATURE-----

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220524\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa', false) && !interface_exists('ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa', false) && !trait_exists('ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa', false)) {
spl_autoload_call('RectorPrefix20220524\ComposerAutoloaderInit31cf8238e92e71a0eecfce265e2994fa');
if (!class_exists('ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455', false) && !interface_exists('ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455', false) && !trait_exists('ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455', false)) {
spl_autoload_call('RectorPrefix20220524\ComposerAutoloaderInit1d71cc90e37f236bc02c7c114b395455');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220524\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220524\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire31cf8238e92e71a0eecfce265e2994fa')) {
function composerRequire31cf8238e92e71a0eecfce265e2994fa() {
return \RectorPrefix20220524\composerRequire31cf8238e92e71a0eecfce265e2994fa(...func_get_args());
if (!function_exists('composerRequire1d71cc90e37f236bc02c7c114b395455')) {
function composerRequire1d71cc90e37f236bc02c7c114b395455() {
return \RectorPrefix20220524\composerRequire1d71cc90e37f236bc02c7c114b395455(...func_get_args());
}
}
if (!function_exists('scanPath')) {