mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 8f8074f6d30e657621bf6ead352d062d228274ed
8f8074f6d3
SimplifyIfNullableReturnRector: fix example (#5032)
This commit is contained in:
parent
3939ac0648
commit
77cbaa7c42
|
@ -58,14 +58,16 @@ class SomeClass
|
|||
{
|
||||
public function run()
|
||||
{
|
||||
/** @var \stdClass|null $value */
|
||||
$value = $this->foo->bar();
|
||||
$value = $this->get();
|
||||
if (! $value instanceof \stdClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function get(): ?stdClass {
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
|
@ -73,7 +75,10 @@ class SomeClass
|
|||
{
|
||||
public function run()
|
||||
{
|
||||
return $this->foo->bar();
|
||||
return $this->get();
|
||||
}
|
||||
|
||||
public function get(): ?stdClass {
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '173399b8894b7bfe802662064a8814e5560c3328';
|
||||
public const PACKAGE_VERSION = '8f8074f6d30e657621bf6ead352d062d228274ed';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-09-17 12:00:30';
|
||||
public const RELEASE_DATE = '2023-09-17 13:40:23';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit5289bf82de56706251410b0757528dce::getLoader();
|
||||
return ComposerAutoloaderInit2294659d922c969e194b90f0f1af313d::getLoader();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit5289bf82de56706251410b0757528dce
|
||||
class ComposerAutoloaderInit2294659d922c969e194b90f0f1af313d
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit5289bf82de56706251410b0757528dce
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5289bf82de56706251410b0757528dce', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit2294659d922c969e194b90f0f1af313d', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5289bf82de56706251410b0757528dce', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit2294659d922c969e194b90f0f1af313d', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5289bf82de56706251410b0757528dce::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit2294659d922c969e194b90f0f1af313d::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit5289bf82de56706251410b0757528dce::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit2294659d922c969e194b90f0f1af313d::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit5289bf82de56706251410b0757528dce
|
||||
class ComposerStaticInit2294659d922c969e194b90f0f1af313d
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -2593,9 +2593,9 @@ class ComposerStaticInit5289bf82de56706251410b0757528dce
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5289bf82de56706251410b0757528dce::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5289bf82de56706251410b0757528dce::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5289bf82de56706251410b0757528dce::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit2294659d922c969e194b90f0f1af313d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit2294659d922c969e194b90f0f1af313d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit2294659d922c969e194b90f0f1af313d::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue