mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-06 19:30:50 +00:00
Updated Rector to commit f90d7e5c98
f90d7e5c98
[DX] Add strict PHPStan rules - step #6 (#1335)
This commit is contained in:
parent
97eb75a93d
commit
48f148e3b9
|
@ -6,7 +6,7 @@ namespace Rector\NodeTypeResolver\Contract;
|
|||
use PhpParser\Node;
|
||||
use PHPStan\Type\Type;
|
||||
/**
|
||||
* @template TNode as Node
|
||||
* @template TNode as \PhpParser\Node
|
||||
*/
|
||||
interface NodeTypeResolverInterface
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ declare (strict_types=1);
|
|||
namespace Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Cast;
|
||||
use PhpParser\Node\Expr\Cast\Array_;
|
||||
use PhpParser\Node\Expr\Cast\Bool_;
|
||||
|
@ -32,7 +31,7 @@ final class CastTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeTy
|
|||
*/
|
||||
private const CAST_CLASS_TO_TYPE_MAP = [\PhpParser\Node\Expr\Cast\Bool_::class => \PHPStan\Type\BooleanType::class, \PhpParser\Node\Expr\Cast\String_::class => \PHPStan\Type\StringType::class, \PhpParser\Node\Expr\Cast\Int_::class => \PHPStan\Type\IntegerType::class, \PhpParser\Node\Expr\Cast\Double::class => \PHPStan\Type\FloatType::class];
|
||||
/**
|
||||
* @return array<class-string<Expr>>
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
|||
final class ClassAndInterfaceTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface
|
||||
{
|
||||
/**
|
||||
* @return class-string[]
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ final class ClassMethodOrClassConstTypeResolver implements \Rector\NodeTypeResol
|
|||
$this->nodeTypeResolver = $nodeTypeResolver;
|
||||
}
|
||||
/**
|
||||
* @return class-string[]
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ declare (strict_types=1);
|
|||
namespace Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\New_;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
|
@ -39,7 +38,7 @@ final class NewTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeTyp
|
|||
$this->classAnalyzer = $classAnalyzer;
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Expr>>
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ declare (strict_types=1);
|
|||
namespace Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PHPStan\Analyser\Scope;
|
||||
|
@ -55,7 +54,7 @@ final class PropertyFetchTypeResolver implements \Rector\NodeTypeResolver\Contra
|
|||
$this->nodeTypeResolver = $nodeTypeResolver;
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Expr>>
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ declare (strict_types=1);
|
|||
namespace Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Scalar;
|
||||
use PhpParser\Node\Scalar\DNumber;
|
||||
use PhpParser\Node\Scalar\Encapsed;
|
||||
|
@ -24,7 +23,7 @@ use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
|
|||
final class ScalarTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface
|
||||
{
|
||||
/**
|
||||
* @return array<class-string<Expr>>
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ final class StaticCallMethodCallTypeResolver implements \Rector\NodeTypeResolver
|
|||
$this->nodeTypeResolver = $nodeTypeResolver;
|
||||
}
|
||||
/**
|
||||
* @return class-string[]
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ declare (strict_types=1);
|
|||
namespace Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Param;
|
||||
use PHPStan\Analyser\Scope;
|
||||
|
@ -35,7 +34,7 @@ final class VariableTypeResolver implements \Rector\NodeTypeResolver\Contract\No
|
|||
$this->phpDocInfoFactory = $phpDocInfoFactory;
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Expr>>
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeClasses() : array
|
||||
{
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '21c4a84cd685640b042804914a0c2350b5c03d71';
|
||||
public const PACKAGE_VERSION = 'f90d7e5c98314eacba827c4b2868d4d9967f829a';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-11-28 18:52:07';
|
||||
public const RELEASE_DATE = '2021-11-28 20:20:57';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20211128\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7::getLoader();
|
||||
return ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082::getLoader();
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7
|
||||
class ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit095a7bc9b3794734f916b7f7673c0082::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit095a7bc9b3794734f916b7f7673c0082::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirea7700b0f27e23cf4de3310fc3db5d5c7($fileIdentifier, $file);
|
||||
composerRequire095a7bc9b3794734f916b7f7673c0082($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirea7700b0f27e23cf4de3310fc3db5d5c7($fileIdentifier, $file)
|
||||
function composerRequire095a7bc9b3794734f916b7f7673c0082($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7
|
||||
class ComposerStaticInit095a7bc9b3794734f916b7f7673c0082
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -3770,9 +3770,9 @@ class ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita7700b0f27e23cf4de3310fc3db5d5c7::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit095a7bc9b3794734f916b7f7673c0082::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit095a7bc9b3794734f916b7f7673c0082::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit095a7bc9b3794734f916b7f7673c0082::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
15
vendor/composer/installed.json
vendored
15
vendor/composer/installed.json
vendored
|
@ -2269,17 +2269,17 @@
|
|||
},
|
||||
{
|
||||
"name": "rector\/rector-nette",
|
||||
"version": "0.11.53",
|
||||
"version_normalized": "0.11.53.0",
|
||||
"version": "0.11.54",
|
||||
"version_normalized": "0.11.54.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-nette.git",
|
||||
"reference": "3e11f9b607242be25ffb71cba76766a07cc6c00e"
|
||||
"reference": "0b165f270ec8f73b277ba988bb51b70f8a99a01e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/3e11f9b607242be25ffb71cba76766a07cc6c00e",
|
||||
"reference": "3e11f9b607242be25ffb71cba76766a07cc6c00e",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/0b165f270ec8f73b277ba988bb51b70f8a99a01e",
|
||||
"reference": "0b165f270ec8f73b277ba988bb51b70f8a99a01e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2298,6 +2298,7 @@
|
|||
"nette\/forms": "3.0.*",
|
||||
"phpstan\/extension-installer": "^1.1",
|
||||
"phpstan\/phpstan-nette": "^1.0",
|
||||
"phpstan\/phpstan-strict-rules": "^1.1",
|
||||
"phpstan\/phpstan-webmozart-assert": "^1.0",
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"rector\/phpstan-rules": "^0.4.7",
|
||||
|
@ -2308,7 +2309,7 @@
|
|||
"symplify\/phpstan-rules": "^10.0",
|
||||
"symplify\/rule-doc-generator": "^10.0"
|
||||
},
|
||||
"time": "2021-11-25T17:09:43+00:00",
|
||||
"time": "2021-11-28T19:04:06+00:00",
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -2336,7 +2337,7 @@
|
|||
"description": "Rector upgrades rules for Nette Framework",
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/rectorphp\/rector-nette\/issues",
|
||||
"source": "https:\/\/github.com\/rectorphp\/rector-nette\/tree\/0.11.53"
|
||||
"source": "https:\/\/github.com\/rectorphp\/rector-nette\/tree\/0.11.54"
|
||||
},
|
||||
"install-path": "..\/rector\/rector-nette"
|
||||
},
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
|||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.37'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.13'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.53'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.23'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.42'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.31'));
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.37'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.13'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.54'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.23'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.42'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.31'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
3
vendor/rector/rector-nette/composer.json
vendored
3
vendor/rector/rector-nette/composer.json
vendored
|
@ -24,7 +24,8 @@
|
|||
"symplify\/rule-doc-generator": "^10.0",
|
||||
"phpstan\/extension-installer": "^1.1",
|
||||
"rector\/phpstan-rules": "^0.4.7",
|
||||
"phpstan\/phpstan-webmozart-assert": "^1.0"
|
||||
"phpstan\/phpstan-webmozart-assert": "^1.0",
|
||||
"phpstan\/phpstan-strict-rules": "^1.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
@ -7,7 +7,7 @@ use PhpParser\Node;
|
|||
interface FormControlTypeResolverInterface
|
||||
{
|
||||
/**
|
||||
* @return array<string, class-string>
|
||||
* @return array<string, string>
|
||||
* @param \PhpParser\Node $node
|
||||
*/
|
||||
public function resolve($node) : array;
|
||||
|
|
|
@ -5,13 +5,17 @@ namespace Rector\Nette\Contract\Rector;
|
|||
|
||||
use RectorPrefix20211128\Nette\Neon\Node;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
/**
|
||||
* @template TNode as Node
|
||||
*/
|
||||
interface NeonRectorInterface extends \Rector\Core\Contract\Rector\RectorInterface
|
||||
{
|
||||
/**
|
||||
* @return class-string<Node>
|
||||
* @return class-string<TNode>
|
||||
*/
|
||||
public function getNodeType() : string;
|
||||
/**
|
||||
* @param TNode $node
|
||||
* @return \Nette\Neon\Node|null
|
||||
*/
|
||||
public function enterNode(\RectorPrefix20211128\Nette\Neon\Node $node);
|
||||
|
|
|
@ -27,7 +27,7 @@ final class AssignedVariablesMethodCallsFormTypeResolver implements \Rector\Nett
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireAssignedVariablesMethodCallsFormTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ final class ClassMethodFormTypeResolver implements \Rector\Nette\Contract\FormCo
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireClassMethodFormTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ final class ConstructorFormControlTypeResolver implements \Rector\Nette\Contract
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireConstructorFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ final class GetComponentMethodCallFormControlTypeResolver implements \Rector\Net
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireGetComponentMethodCallFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ final class MagicNetteFactoryInterfaceFormControlTypeResolver implements \Rector
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireMagicNetteFactoryInterfaceFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ final class NewFormControlTypeResolver implements \Rector\Nette\Contract\FormCon
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireNewFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ final class ReturnFormControlTypeResolver implements \Rector\Nette\Contract\Form
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireReturnFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ final class ThisVariableInAnotherMethodFormControlTypeResolver implements \Recto
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireThisVariableInAnotherMethodFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ final class VariableConstructorFormControlTypeResolver implements \Rector\Nette\
|
|||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowireVariableConstructorFormControlTypeResolver(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
public function autowire(\Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver $methodNamesByInputNamesResolver) : void
|
||||
{
|
||||
$this->methodNamesByInputNamesResolver = $methodNamesByInputNamesResolver;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ final class GetSubscribedEventsArrayManipulator
|
|||
}
|
||||
public function change(\PhpParser\Node\Expr\Array_ $array) : void
|
||||
{
|
||||
$arrayItems = \array_filter($array->items, function (\PhpParser\Node\Expr\ArrayItem $arrayItem) : bool {
|
||||
$arrayItems = \array_filter($array->items, function ($arrayItem) : bool {
|
||||
return $arrayItem !== null;
|
||||
});
|
||||
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($arrayItems, function (\PhpParser\Node $node) : ?Node {
|
||||
|
|
|
@ -46,7 +46,7 @@ final class ListeningClassMethodArgumentManipulator
|
|||
foreach ($classMethodsByEventClass as $classMethods) {
|
||||
// are attributes already replaced
|
||||
$classMethod = $classMethods->getClassMethod();
|
||||
$eventParameterReplaced = $classMethod->getAttribute(self::EVENT_PARAMETER_REPLACED);
|
||||
$eventParameterReplaced = (bool) $classMethod->getAttribute(self::EVENT_PARAMETER_REPLACED, \false);
|
||||
if ($eventParameterReplaced) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Nette\Kdyby\Rector\MethodCall;
|
||||
|
||||
use RectorPrefix20211128\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\Util\StringUtils;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
|
@ -93,7 +93,7 @@ CODE_SAMPLE
|
|||
if (!$arrayItem->key instanceof \PhpParser\Node\Scalar\String_) {
|
||||
continue;
|
||||
}
|
||||
if (\RectorPrefix20211128\Nette\Utils\Strings::match($arrayItem->key->value, self::BETWEEN_PERCENT_CHARS_REGEX)) {
|
||||
if (\Rector\Core\Util\StringUtils::isMatch($arrayItem->key->value, self::BETWEEN_PERCENT_CHARS_REGEX)) {
|
||||
continue;
|
||||
}
|
||||
$arrayItem->key = new \PhpParser\Node\Scalar\String_('%' . $arrayItem->key->value . '%');
|
||||
|
|
|
@ -38,8 +38,12 @@ final class FormFieldsFinder
|
|||
public function find(\PhpParser\Node\Stmt\Class_ $class, \PhpParser\Node\Expr\Variable $form) : array
|
||||
{
|
||||
$formFields = [];
|
||||
foreach ($class->getMethods() as $method) {
|
||||
foreach ($method->stmts ?: [] as $stmt) {
|
||||
foreach ($class->getMethods() as $classMethod) {
|
||||
$stmts = $classMethod->getStmts();
|
||||
if ($stmts === null) {
|
||||
continue;
|
||||
}
|
||||
foreach ($stmts as $stmt) {
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
}
|
||||
|
@ -48,7 +52,7 @@ final class FormFieldsFinder
|
|||
continue;
|
||||
}
|
||||
$addFieldMethodCall = $this->findAddFieldMethodCall($methodCall);
|
||||
if (!$addFieldMethodCall) {
|
||||
if (!$addFieldMethodCall instanceof \PhpParser\Node\Expr\MethodCall) {
|
||||
continue;
|
||||
}
|
||||
if (!$this->isFormAddFieldMethodCall($addFieldMethodCall, $form)) {
|
||||
|
|
|
@ -15,8 +15,11 @@ final class FormOnSuccessCallbackFinder
|
|||
{
|
||||
public function find(\PhpParser\Node\Stmt\Class_ $class, \PhpParser\Node\Expr\Variable $form) : ?\PhpParser\Node\Expr
|
||||
{
|
||||
foreach ($class->getMethods() as $method) {
|
||||
$stmts = $method->stmts ?: [];
|
||||
foreach ($class->getMethods() as $classMethod) {
|
||||
$stmts = $classMethod->getStmts();
|
||||
if ($stmts === null) {
|
||||
continue;
|
||||
}
|
||||
foreach ($stmts as $stmt) {
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
|
|
|
@ -24,17 +24,20 @@ final class FormVariableFinder
|
|||
}
|
||||
public function find(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
foreach ($class->getMethods() as $method) {
|
||||
$stmts = $method->stmts ?: [];
|
||||
foreach ($stmts as $stmt) {
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
foreach ($class->getMethods() as $classMethod) {
|
||||
$classMethodStmts = $classMethod->getStmts();
|
||||
if ($classMethodStmts === null) {
|
||||
continue;
|
||||
}
|
||||
foreach ($classMethodStmts as $classMethodStmt) {
|
||||
if (!$classMethodStmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
}
|
||||
if (!$stmt->expr instanceof \PhpParser\Node\Expr\Assign) {
|
||||
if (!$classMethodStmt->expr instanceof \PhpParser\Node\Expr\Assign) {
|
||||
continue;
|
||||
}
|
||||
$var = $stmt->expr->var;
|
||||
$expr = $stmt->expr->expr;
|
||||
$var = $classMethodStmt->expr->var;
|
||||
$expr = $classMethodStmt->expr->expr;
|
||||
if (!$var instanceof \PhpParser\Node\Expr\Variable) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ final class MethodNamesByInputNamesResolver
|
|||
$this->formControlTypeResolvers = $formControlTypeResolvers;
|
||||
}
|
||||
/**
|
||||
* @return array<string, class-string>
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function resolveExpr(\PhpParser\Node $node) : array
|
||||
{
|
||||
|
|
|
@ -106,7 +106,7 @@ CODE_SAMPLE
|
|||
return [\PhpParser\Node\Stmt\Class_::class];
|
||||
}
|
||||
/**
|
||||
* @param array<string, string|string[]> $configuration
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
|
|
|
@ -105,7 +105,10 @@ CODE_SAMPLE
|
|||
private function findVarTypesForAction(\PhpParser\Node\Stmt\ClassMethod $method) : array
|
||||
{
|
||||
$varTypes = [];
|
||||
$stmts = $method->stmts ?: [];
|
||||
$stmts = $method->getStmts();
|
||||
if ($stmts === null) {
|
||||
return [];
|
||||
}
|
||||
foreach ($stmts as $stmt) {
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
|
|
|
@ -135,7 +135,7 @@ CODE_SAMPLE
|
|||
{
|
||||
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
|
||||
$injectTagValueNode = $phpDocInfo->getByName('inject');
|
||||
if ($injectTagValueNode) {
|
||||
if ($injectTagValueNode instanceof \PHPStan\PhpDocParser\Ast\Node) {
|
||||
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $injectTagValueNode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ CODE_SAMPLE
|
|||
return [\PhpParser\Node\Stmt\Class_::class];
|
||||
}
|
||||
/**
|
||||
* @param array<string, string|string[]> $configuration
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ CODE_SAMPLE
|
|||
}
|
||||
$shortClassName = $this->nodeNameResolver->getShortName($node);
|
||||
$fullClassName = $this->nodeNameResolver->getName($node);
|
||||
if (!$fullClassName) {
|
||||
if (!\is_string($fullClassName)) {
|
||||
return null;
|
||||
}
|
||||
$presenterName = \str_replace('Presenter', '', $shortClassName);
|
||||
|
@ -157,7 +157,10 @@ CODE_SAMPLE
|
|||
private function findVarTypesForAction(\PhpParser\Node\Stmt\ClassMethod $method) : array
|
||||
{
|
||||
$varTypes = [];
|
||||
$stmts = $method->stmts ?: [];
|
||||
$stmts = $method->getStmts();
|
||||
if ($stmts === null) {
|
||||
return [];
|
||||
}
|
||||
foreach ($stmts as $stmt) {
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
|
|
|
@ -11,6 +11,8 @@ use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
|||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Nette\Tests\Rector\Neon\RenameMethodNeonRector\RenameMethodNeonRectorTest
|
||||
*
|
||||
* @implements NeonRectorInterface<SetupMethodCall>
|
||||
*/
|
||||
final class RenameMethodNeonRector implements \Rector\Nette\Contract\Rector\NeonRectorInterface
|
||||
{
|
||||
|
@ -40,9 +42,6 @@ services:
|
|||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return class-string<Node>
|
||||
*/
|
||||
public function getNodeType() : string
|
||||
{
|
||||
return \Rector\Nette\NeonParser\Node\Service_\SetupMethodCall::class;
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -12,8 +12,8 @@ if (!class_exists('GenerateChangelogCommand', false) && !interface_exists('Gener
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7', false) && !interface_exists('ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7', false) && !trait_exists('ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\ComposerAutoloaderInita7700b0f27e23cf4de3310fc3db5d5c7');
|
||||
if (!class_exists('ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082', false) && !interface_exists('ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082', false) && !trait_exists('ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\ComposerAutoloaderInit095a7bc9b3794734f916b7f7673c0082');
|
||||
}
|
||||
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('RectorPrefix20211128\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -81,9 +81,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20211128\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequirea7700b0f27e23cf4de3310fc3db5d5c7')) {
|
||||
function composerRequirea7700b0f27e23cf4de3310fc3db5d5c7() {
|
||||
return \RectorPrefix20211128\composerRequirea7700b0f27e23cf4de3310fc3db5d5c7(...func_get_args());
|
||||
if (!function_exists('composerRequire095a7bc9b3794734f916b7f7673c0082')) {
|
||||
function composerRequire095a7bc9b3794734f916b7f7673c0082() {
|
||||
return \RectorPrefix20211128\composerRequire095a7bc9b3794734f916b7f7673c0082(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user