Skip to content

Commit

Permalink
Rector 0.11.41
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 2, 2021
1 parent 1452c5d commit 46c5557
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public function isReturnTypeChangeAllowed(\PhpParser\Node\Stmt\ClassMethod $clas
}
return \strpos($fileName, '/vendor/') === \false;
}
public function hasParentClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
{
return $this->getParentClassMethod($classMethod) instanceof \PHPStan\Reflection\MethodReflection;
}
private function getParentClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : ?\PHPStan\Reflection\MethodReflection
{
$scope = $classMethod->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use Rector\Core\Rector\AbstractRector;
use Rector\Defluent\ConflictGuard\ParentClassMethodTypeOverrideGuard;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\TypeDeclaration\NodeAnalyzer\CallerParamMatcher;
use RectorPrefix20210802\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
Expand All @@ -36,10 +37,15 @@ final class ParamTypeByMethodCallTypeRector extends \Rector\Core\Rector\Abstract
* @var \Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser
*/
private $simpleCallableNodeTraverser;
public function __construct(\Rector\TypeDeclaration\NodeAnalyzer\CallerParamMatcher $callerParamMatcher, \RectorPrefix20210802\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser)
/**
* @var \Rector\Defluent\ConflictGuard\ParentClassMethodTypeOverrideGuard
*/
private $parentClassMethodTypeOverrideGuard;
public function __construct(\Rector\TypeDeclaration\NodeAnalyzer\CallerParamMatcher $callerParamMatcher, \RectorPrefix20210802\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\Defluent\ConflictGuard\ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard)
{
$this->callerParamMatcher = $callerParamMatcher;
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->parentClassMethodTypeOverrideGuard = $parentClassMethodTypeOverrideGuard;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
Expand Down Expand Up @@ -129,6 +135,9 @@ private function shouldSkipClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMe
if ($classMethod->params === []) {
return \true;
}
if ($this->parentClassMethodTypeOverrideGuard->hasParentClassMethod($classMethod)) {
return \true;
}
$scope = $classMethod->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if (!$scope instanceof \PHPStan\Analyser\Scope) {
return \true;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'b3480900f3da86846dfabdfcd7e12f07b16a3f78';
public const PACKAGE_VERSION = 'd936944aedeaa6687e4eeca55aab8148e9104436';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-02 17:39:36';
public const RELEASE_DATE = '2021-08-02 19:12:49';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210802\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2::getLoader();
return ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2
class ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e', '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\ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand All @@ -42,19 +42,19 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire515a7719282ef2aa9111616aa962f8f2($fileIdentifier, $file);
composerRequire4c0fdd8ae9e558b3dcc5b77b57b9be6e($fileIdentifier, $file);
}

return $loader;
}
}

function composerRequire515a7719282ef2aa9111616aa962f8f2($fileIdentifier, $file)
function composerRequire4c0fdd8ae9e558b3dcc5b77b57b9be6e($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit515a7719282ef2aa9111616aa962f8f2
class ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
Expand Down Expand Up @@ -3847,9 +3847,9 @@ class ComposerStaticInit515a7719282ef2aa9111616aa962f8f2
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4c0fdd8ae9e558b3dcc5b77b57b9be6e::$classMap;

}, null, ClassLoader::class);
}
Expand Down
10 changes: 5 additions & 5 deletions vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210802\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false) && !interface_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false) && !trait_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false)) {
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2');
if (!class_exists('ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e', false) && !interface_exists('ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e', false) && !trait_exists('ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e', false)) {
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInit4c0fdd8ae9e558b3dcc5b77b57b9be6e');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210802\Doctrine\Inflector\Inflector');
Expand Down Expand Up @@ -3308,9 +3308,9 @@ function print_node() {
return \RectorPrefix20210802\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire515a7719282ef2aa9111616aa962f8f2')) {
function composerRequire515a7719282ef2aa9111616aa962f8f2() {
return \RectorPrefix20210802\composerRequire515a7719282ef2aa9111616aa962f8f2(...func_get_args());
if (!function_exists('composerRequire4c0fdd8ae9e558b3dcc5b77b57b9be6e')) {
function composerRequire4c0fdd8ae9e558b3dcc5b77b57b9be6e() {
return \RectorPrefix20210802\composerRequire4c0fdd8ae9e558b3dcc5b77b57b9be6e(...func_get_args());
}
}
if (!function_exists('parseArgs')) {
Expand Down

0 comments on commit 46c5557

Please sign in to comment.