Skip to content

Commit

Permalink
Updated Rector to commit 5db390cb7b67d3537acc34d3eabb04de1ef4b35a
Browse files Browse the repository at this point in the history
rectorphp/rector-src@5db390c [Php81] Handle null defined in variable first on NullToStrictStringFuncCallArgRector (#3385)
  • Loading branch information
TomasVotruba committed Feb 15, 2023
1 parent ab02d96 commit 9db8a3e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use PHPStan\Reflection\Native\NativeFunctionReflection;
use PHPStan\Type\ErrorType;
use PHPStan\Type\MixedType;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use Rector\Core\NodeAnalyzer\ArgsAnalyzer;
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
use Rector\Core\Rector\AbstractScopeAwareRector;
Expand Down Expand Up @@ -159,7 +161,10 @@ private function processNullToStrictStringOnNodePosition(FuncCall $funcCall, arr
if ($type->isString()->yes()) {
return null;
}
if (!$type instanceof MixedType || $argValue instanceof Encapsed) {
if (!$type instanceof MixedType && !$type instanceof NullType) {
return null;
}
if ($argValue instanceof Encapsed) {
return null;
}
if ($this->isAnErrorTypeFromParentScope($argValue)) {
Expand All @@ -175,12 +180,15 @@ private function processNullToStrictStringOnNodePosition(FuncCall $funcCall, arr
$funcCall->args = $args;
return $funcCall;
}
private function shouldSkipTrait(Expr $expr, MixedType $mixedType, bool $isTrait) : bool
private function shouldSkipTrait(Expr $expr, Type $type, bool $isTrait) : bool
{
if (!$type instanceof MixedType) {
return \false;
}
if (!$isTrait) {
return \false;
}
if ($mixedType->isExplicitMixed()) {
if ($type->isExplicitMixed()) {
return \false;
}
if (!$expr instanceof MethodCall) {
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '24a976b881b31b643138f24fc089ad8f77898689';
public const PACKAGE_VERSION = '5db390cb7b67d3537acc34d3eabb04de1ef4b35a';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-02-15 12:32:02';
public const RELEASE_DATE = '2023-02-15 15:15:07';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

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

return ComposerAutoloaderInit78b1e5a5d863967d62462ccce00c8d4b::getLoader();
return ComposerAutoloaderInit5360909cc89207cdc7af64c3cd84a781::getLoader();
10 changes: 5 additions & 5 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 ComposerAutoloaderInit78b1e5a5d863967d62462ccce00c8d4b
class ComposerAutoloaderInit5360909cc89207cdc7af64c3cd84a781
{
private static $loader;

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

spl_autoload_register(array('ComposerAutoloaderInit78b1e5a5d863967d62462ccce00c8d4b', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit5360909cc89207cdc7af64c3cd84a781', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit78b1e5a5d863967d62462ccce00c8d4b', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit5360909cc89207cdc7af64c3cd84a781', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit5360909cc89207cdc7af64c3cd84a781::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit5360909cc89207cdc7af64c3cd84a781::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
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 ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b
class ComposerStaticInit5360909cc89207cdc7af64c3cd84a781
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -3121,9 +3121,9 @@ class ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit78b1e5a5d863967d62462ccce00c8d4b::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit5360909cc89207cdc7af64c3cd84a781::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5360909cc89207cdc7af64c3cd84a781::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5360909cc89207cdc7af64c3cd84a781::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 9db8a3e

Please sign in to comment.