mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-28 13:43:31 +00:00
Updated Rector to commit 20c0d2eca8
20c0d2eca8
[PHPStan 1.0] Remove ReflectionWithFilename (#1118)
This commit is contained in:
parent
54f8d6dc33
commit
0420629279
|
@ -112,7 +112,7 @@ CODE_SAMPLE
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// skip those in vendor
|
// skip those in vendor
|
||||||
if ($this->vendorLocationDetector->detectFunctionLikeReflection($methodReflection)) {
|
if ($this->vendorLocationDetector->detectMethodReflection($methodReflection)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$spreadParameterReflections = $this->spreadVariablesCollector->resolveFromMethodReflection($methodReflection);
|
$spreadParameterReflections = $this->spreadVariablesCollector->resolveFromMethodReflection($methodReflection);
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
declare (strict_types=1);
|
declare (strict_types=1);
|
||||||
namespace Rector\CodingStyle\Reflection;
|
namespace Rector\CodingStyle\Reflection;
|
||||||
|
|
||||||
use PHPStan\Reflection\FunctionReflection;
|
|
||||||
use PHPStan\Reflection\MethodReflection;
|
use PHPStan\Reflection\MethodReflection;
|
||||||
use PHPStan\Reflection\ReflectionWithFilename;
|
|
||||||
use RectorPrefix20211031\Symplify\SmartFileSystem\Normalizer\PathNormalizer;
|
use RectorPrefix20211031\Symplify\SmartFileSystem\Normalizer\PathNormalizer;
|
||||||
final class VendorLocationDetector
|
final class VendorLocationDetector
|
||||||
{
|
{
|
||||||
|
@ -17,12 +15,10 @@ final class VendorLocationDetector
|
||||||
{
|
{
|
||||||
$this->pathNormalizer = $pathNormalizer;
|
$this->pathNormalizer = $pathNormalizer;
|
||||||
}
|
}
|
||||||
/**
|
public function detectMethodReflection(\PHPStan\Reflection\MethodReflection $methodReflection) : bool
|
||||||
* @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|\PHPStan\Reflection\ReflectionWithFilename $reflection
|
|
||||||
*/
|
|
||||||
public function detectFunctionLikeReflection($reflection) : bool
|
|
||||||
{
|
{
|
||||||
$fileName = $this->resolveReflectionFileName($reflection);
|
$declaringClassReflection = $methodReflection->getDeclaringClass();
|
||||||
|
$fileName = $declaringClassReflection->getFileName();
|
||||||
// probably internal
|
// probably internal
|
||||||
if ($fileName === null) {
|
if ($fileName === null) {
|
||||||
return \false;
|
return \false;
|
||||||
|
@ -30,18 +26,4 @@ final class VendorLocationDetector
|
||||||
$normalizedFileName = $this->pathNormalizer->normalizePath($fileName);
|
$normalizedFileName = $this->pathNormalizer->normalizePath($fileName);
|
||||||
return \strpos($normalizedFileName, '/vendor/') !== \false;
|
return \strpos($normalizedFileName, '/vendor/') !== \false;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|\PHPStan\Reflection\ReflectionWithFilename $reflection
|
|
||||||
*/
|
|
||||||
private function resolveReflectionFileName($reflection) : ?string
|
|
||||||
{
|
|
||||||
if ($reflection instanceof \PHPStan\Reflection\ReflectionWithFilename) {
|
|
||||||
return $reflection->getFileName();
|
|
||||||
}
|
|
||||||
if ($reflection instanceof \PHPStan\Reflection\FunctionReflection) {
|
|
||||||
return $reflection->getFileName();
|
|
||||||
}
|
|
||||||
$declaringClassReflection = $reflection->getDeclaringClass();
|
|
||||||
return $declaringClassReflection->getFileName();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ CODE_SAMPLE
|
||||||
*/
|
*/
|
||||||
private function resolveExpectedArgParamOrderIfDifferent(\PHPStan\Reflection\MethodReflection $methodReflection, array $argsOrParams) : ?array
|
private function resolveExpectedArgParamOrderIfDifferent(\PHPStan\Reflection\MethodReflection $methodReflection, array $argsOrParams) : ?array
|
||||||
{
|
{
|
||||||
if ($this->vendorLocationDetector->detectFunctionLikeReflection($methodReflection)) {
|
if ($this->vendorLocationDetector->detectMethodReflection($methodReflection)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$parametersAcceptor = \PHPStan\Reflection\ParametersAcceptorSelector::selectSingle($methodReflection->getVariants());
|
$parametersAcceptor = \PHPStan\Reflection\ParametersAcceptorSelector::selectSingle($methodReflection->getVariants());
|
||||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = 'da4d598bf0fc20b831e138407263b82645109bdf';
|
public const PACKAGE_VERSION = '20c0d2eca882793ce82b9c692ae9b475695a7c61';
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2021-10-31 16:11:30';
|
public const RELEASE_DATE = '2021-10-31 17:44:44';
|
||||||
public static function resolvePackageVersion() : string
|
public static function resolvePackageVersion() : string
|
||||||
{
|
{
|
||||||
$process = new \RectorPrefix20211031\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
$process = new \RectorPrefix20211031\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';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67::getLoader();
|
return ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c::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
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67
|
class ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67
|
||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c', 'loadClassLoader'));
|
||||||
|
|
||||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||||
if ($useStaticLoader) {
|
if ($useStaticLoader) {
|
||||||
require __DIR__ . '/autoload_static.php';
|
require __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInit6ead72988a16b4d62b8b807662972d67::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInitf420dadddc42464f58a1fb565370ec9c::getInitializer($loader));
|
||||||
} else {
|
} else {
|
||||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||||
if ($classMap) {
|
if ($classMap) {
|
||||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
if ($useStaticLoader) {
|
if ($useStaticLoader) {
|
||||||
$includeFiles = Composer\Autoload\ComposerStaticInit6ead72988a16b4d62b8b807662972d67::$files;
|
$includeFiles = Composer\Autoload\ComposerStaticInitf420dadddc42464f58a1fb565370ec9c::$files;
|
||||||
} else {
|
} else {
|
||||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||||
}
|
}
|
||||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||||
composerRequire6ead72988a16b4d62b8b807662972d67($fileIdentifier, $file);
|
composerRequiref420dadddc42464f58a1fb565370ec9c($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequire6ead72988a16b4d62b8b807662972d67($fileIdentifier, $file)
|
function composerRequiref420dadddc42464f58a1fb565370ec9c($fileIdentifier, $file)
|
||||||
{
|
{
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
require $file;
|
require $file;
|
||||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInit6ead72988a16b4d62b8b807662972d67
|
class ComposerStaticInitf420dadddc42464f58a1fb565370ec9c
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||||
|
@ -3888,9 +3888,9 @@ class ComposerStaticInit6ead72988a16b4d62b8b807662972d67
|
||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInit6ead72988a16b4d62b8b807662972d67::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInitf420dadddc42464f58a1fb565370ec9c::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInit6ead72988a16b4d62b8b807662972d67::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInitf420dadddc42464f58a1fb565370ec9c::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInit6ead72988a16b4d62b8b807662972d67::$classMap;
|
$loader->classMap = ComposerStaticInitf420dadddc42464f58a1fb565370ec9c::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
|
16
vendor/composer/installed.json
vendored
16
vendor/composer/installed.json
vendored
|
@ -833,12 +833,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
|
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
|
||||||
"reference": "90f09b0be365c5d7619b1ccbe969fb566de89cf6"
|
"reference": "4453ce4f09ef4a52ff5dedbc3e36061ace5e83d2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/90f09b0be365c5d7619b1ccbe969fb566de89cf6",
|
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/4453ce4f09ef4a52ff5dedbc3e36061ace5e83d2",
|
||||||
"reference": "90f09b0be365c5d7619b1ccbe969fb566de89cf6",
|
"reference": "4453ce4f09ef4a52ff5dedbc3e36061ace5e83d2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -847,7 +847,7 @@
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpstan\/phpstan-shim": "*"
|
"phpstan\/phpstan-shim": "*"
|
||||||
},
|
},
|
||||||
"time": "2021-10-31T14:20:02+00:00",
|
"time": "2021-10-31T16:21:01+00:00",
|
||||||
"default-branch": true,
|
"default-branch": true,
|
||||||
"bin": [
|
"bin": [
|
||||||
"phpstan",
|
"phpstan",
|
||||||
|
@ -4278,12 +4278,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https:\/\/github.com\/symplify\/package-builder.git",
|
"url": "https:\/\/github.com\/symplify\/package-builder.git",
|
||||||
"reference": "09fac6ba61ebe908911f7312b7b6449dcd3a57d1"
|
"reference": "7e6d72a355b51a79be3f441d4f86080a2f64a578"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/09fac6ba61ebe908911f7312b7b6449dcd3a57d1",
|
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/7e6d72a355b51a79be3f441d4f86080a2f64a578",
|
||||||
"reference": "09fac6ba61ebe908911f7312b7b6449dcd3a57d1",
|
"reference": "7e6d72a355b51a79be3f441d4f86080a2f64a578",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -4330,7 +4330,7 @@
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit\/phpunit": "^9.5"
|
"phpunit\/phpunit": "^9.5"
|
||||||
},
|
},
|
||||||
"time": "2021-10-30T00:10:09+00:00",
|
"time": "2021-10-31T17:28:48+00:00",
|
||||||
"default-branch": true,
|
"default-branch": true,
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
Binary file not shown.
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
|
@ -1,16 +1,16 @@
|
||||||
-----BEGIN PGP SIGNATURE-----
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmF+phIACgkQzxoQjQ56
|
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmF+wm0ACgkQzxoQjQ56
|
||||||
5yCqtw//XVPOksNf9UmM5B4tpfhe6cxD4fH4EiIN/fckbrGdntZc9K8BW7vspHWY
|
5yBMOQ/9GL6mpTscC1zSutC4AIDeBHuCGJFxA25YN27THPnUFz6lVsefaByVusd/
|
||||||
P7xkTDZ+E3IFKEyWMTMoLIVWvjSTb+zw4YGqgSUPbVmlne09C4ATA1bQjNlQfRVC
|
va0F0pW5pH0fuO0fkoTc0IrkdRZqVpyKIspJakgyXdH8uhMKv5ChLIJWGfkjAsxu
|
||||||
04dHumiF7xn3XcJn4orOfC23X4t9pd+UPUG3gBlk0PgQ0XJZ68b5AT3Wyb1syegD
|
hKY92smyTiGn7UfvQGAsrS14fILqM+4IfQuCZHBFV8TsjnNDs4wIAbK1b/HmzOi5
|
||||||
zkfHChmckRYFyv/ZevVnTIYZ3TInXq1eKltIPkn0FK0v8hyT3JtAUsPBqDm8rRC9
|
dmr377e7cV8VY0idVPPnY2nzXgIm6B/dWfaMcdRnljO/UHg9VlWLI9uVfjX5GJsk
|
||||||
5ZyNxAE+5krc6i3WDkDolWkStgAtOiAlDrj4eL99Gyfte+j6byzNl4R8s89lt1JO
|
XkyVS7kROPLOmEKkQ8TxhgdAOzYpM642WvLBhUKVKDvfXJVzHPLozIHhq2Zd3Llj
|
||||||
5Ebh0TvGmgywTZesuXWBzdcThat/GG8PcNVZdNb6g8YzWB8YvR4cI30j3p04+nnx
|
QgB3ih7HSoulf9NRdzsc3Irgtc/5uV5CBRPbwVST6jP2ZJsg8TnW83gK3GAzeXDY
|
||||||
V59x5PwN2Zq0co8YX47s+KXXz70Yb/EZyNdGQXylAC4/uuNAWJGZ9Gh71l1GQtyk
|
Jxi3pRV9UobjlPmOqpgghR/JTu2wR1igeGeUU/7xOidpdMKFZugnyxFfOhk3YBS8
|
||||||
ZMRbQhfGT5VcS/DgFEDbLEQ6K3VcCROGXCmbZWRLuIIAldAICFG0WiNrP/NcA7GK
|
y8e7ONYCG+05UEVzRr39B/4OER4GDiVSgtasZd5xOoOJkntOEbrDHk0fDDSPRPU+
|
||||||
iVbw+PN1tftU8bJ2uDRqWSoCOoMrJbFLPnW9wgZsiAZg/BzhyW1LrSRVpzmLWXtI
|
QDlIQM5OY7+6H6NcjB7PHKu0Ybayox2HgcpEp1NnEMr9fu2WuIIR00EBYcmA9yVA
|
||||||
bjYKc+jp+eE1wTma0I4M0SWMd71M4idrFxJgvXzI2fTGNx775wQCbGfZTemE/8AU
|
prsuxoG0sT7zqxLnkU2ZJkBwr4NxRCc4TssQ/jNcHkpW9gj+IuOnVQqkSu8PjsiA
|
||||||
D7UPq6TOobc7UC3WbLMnmqbCWTqvmDj3i7zLVEssf56CK9xj95E=
|
zQvLTrCbHh4ZccKXVet/reLX/EvvvwyWFElzpRZpgAc4+UNFYvA=
|
||||||
=Qk/l
|
=gJ4L
|
||||||
-----END PGP SIGNATURE-----
|
-----END PGP SIGNATURE-----
|
||||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
||||||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||||
spl_autoload_call('RectorPrefix20211031\AutoloadIncluder');
|
spl_autoload_call('RectorPrefix20211031\AutoloadIncluder');
|
||||||
}
|
}
|
||||||
if (!class_exists('ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67', false) && !interface_exists('ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67', false) && !trait_exists('ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67', false)) {
|
if (!class_exists('ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c', false) && !interface_exists('ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c', false) && !trait_exists('ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c', false)) {
|
||||||
spl_autoload_call('RectorPrefix20211031\ComposerAutoloaderInit6ead72988a16b4d62b8b807662972d67');
|
spl_autoload_call('RectorPrefix20211031\ComposerAutoloaderInitf420dadddc42464f58a1fb565370ec9c');
|
||||||
}
|
}
|
||||||
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)) {
|
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('RectorPrefix20211031\Helmich\TypoScriptParser\Parser\AST\Statement');
|
spl_autoload_call('RectorPrefix20211031\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||||
|
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
|
||||||
return \RectorPrefix20211031\print_node(...func_get_args());
|
return \RectorPrefix20211031\print_node(...func_get_args());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!function_exists('composerRequire6ead72988a16b4d62b8b807662972d67')) {
|
if (!function_exists('composerRequiref420dadddc42464f58a1fb565370ec9c')) {
|
||||||
function composerRequire6ead72988a16b4d62b8b807662972d67() {
|
function composerRequiref420dadddc42464f58a1fb565370ec9c() {
|
||||||
return \RectorPrefix20211031\composerRequire6ead72988a16b4d62b8b807662972d67(...func_get_args());
|
return \RectorPrefix20211031\composerRequiref420dadddc42464f58a1fb565370ec9c(...func_get_args());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!function_exists('parseArgs')) {
|
if (!function_exists('parseArgs')) {
|
||||||
|
|
|
@ -29,10 +29,6 @@ abstract class AbstractKernelTestCase extends \RectorPrefix20211031\PHPUnit\Fram
|
||||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||||
*/
|
*/
|
||||||
protected static $container;
|
protected static $container;
|
||||||
/**
|
|
||||||
* @var array<string, KernelInterface>
|
|
||||||
*/
|
|
||||||
private static $kernelsByHash = [];
|
|
||||||
/**
|
/**
|
||||||
* @param class-string<KernelInterface> $kernelClass
|
* @param class-string<KernelInterface> $kernelClass
|
||||||
* @param string[]|SmartFileInfo[] $configs
|
* @param string[]|SmartFileInfo[] $configs
|
||||||
|
@ -47,25 +43,6 @@ abstract class AbstractKernelTestCase extends \RectorPrefix20211031\PHPUnit\Fram
|
||||||
static::$kernel = $bootedKernel;
|
static::$kernel = $bootedKernel;
|
||||||
return $bootedKernel;
|
return $bootedKernel;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @param class-string<KernelInterface> $kernelClass
|
|
||||||
* @param string[]|SmartFileInfo[] $configs
|
|
||||||
*/
|
|
||||||
protected function bootKernelWithConfigsAndStaticCache($kernelClass, $configs) : \RectorPrefix20211031\Symfony\Component\HttpKernel\KernelInterface
|
|
||||||
{
|
|
||||||
// unwrap file infos to real paths
|
|
||||||
$configFilePaths = $this->resolveConfigFilePaths($configs);
|
|
||||||
$configsHash = $this->resolveConfigsHash($configFilePaths);
|
|
||||||
if (isset(self::$kernelsByHash[$configsHash])) {
|
|
||||||
static::$kernel = self::$kernelsByHash[$configsHash];
|
|
||||||
self::$container = static::$kernel->getContainer();
|
|
||||||
} else {
|
|
||||||
$bootedKernel = $this->createBootedKernelFromConfigs($kernelClass, $configsHash, $configFilePaths);
|
|
||||||
static::$kernel = $bootedKernel;
|
|
||||||
self::$kernelsByHash[$configsHash] = $bootedKernel;
|
|
||||||
}
|
|
||||||
return static::$kernel;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Syntax sugger to remove static from the test cases vission
|
* Syntax sugger to remove static from the test cases vission
|
||||||
*
|
*
|
||||||
|
@ -76,7 +53,7 @@ abstract class AbstractKernelTestCase extends \RectorPrefix20211031\PHPUnit\Fram
|
||||||
protected function getService($type)
|
protected function getService($type)
|
||||||
{
|
{
|
||||||
if (self::$container === null) {
|
if (self::$container === null) {
|
||||||
throw new \RectorPrefix20211031\Symplify\SymplifyKernel\Exception\ShouldNotHappenException('First, crewate container with booKernel(KernelClass::class)');
|
throw new \RectorPrefix20211031\Symplify\SymplifyKernel\Exception\ShouldNotHappenException('First, create container with booKernel(KernelClass::class)');
|
||||||
}
|
}
|
||||||
$service = self::$container->get($type);
|
$service = self::$container->get($type);
|
||||||
if ($service === null) {
|
if ($service === null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user