Skip to content

Commit

Permalink
Updated Rector to commit f4b71a5406b7a79e7fa09659c6a1ca0014a558e1
Browse files Browse the repository at this point in the history
rectorphp/rector-src@f4b71a5 [TypeDeclaration] Use native type detection instead of docblock on AssignToPropertyTypeInferer for TypedPropertyFromAssignsRector (#4754)
  • Loading branch information
TomasVotruba committed Aug 10, 2023
1 parent 90a98ad commit 852f522
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion rules/DeadCode/PhpDoc/DeadVarTagValueNodeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\DeadCode\PhpDoc;

use PHPStan\Type\IntersectionType;
use PhpParser\Node\Stmt\Property;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use PHPStan\Type\UnionType;
Expand Down Expand Up @@ -34,7 +35,7 @@ public function isDead(VarTagValueNode $varTagValueNode, Property $property) : b
$propertyType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($property->type);
$docType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($varTagValueNode->type, $property);
if ($propertyType instanceof UnionType && !$docType instanceof UnionType) {
return \true;
return !$docType instanceof IntersectionType;
}
if (!$this->typeComparator->arePhpParserAndPhpStanPhpDocTypesEqual($property->type, $varTagValueNode->type, $property)) {
return \false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private function shouldSkipWithDifferentDefaultValueType(?Expr $expr, Type $infe
}
private function resolveExprStaticTypeIncludingDimFetch(Assign $assign) : Type
{
$exprStaticType = $this->nodeTypeResolver->getType($assign->expr);
$exprStaticType = $this->nodeTypeResolver->getNativeType($assign->expr);
if ($assign->var instanceof ArrayDimFetch) {
return new ArrayType(new MixedType(), $exprStaticType);
}
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 = 'fe4d90d829b8bd17eff843f0e3de7a5a9cf0e023';
public const PACKAGE_VERSION = 'f4b71a5406b7a79e7fa09659c6a1ca0014a558e1';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-10 12:58:03';
public const RELEASE_DATE = '2023-08-10 13:07:59';
/**
* @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 ComposerAutoloaderInitbfb8584841a8ff684295ce35ac926789::getLoader();
return ComposerAutoloaderInitba66c56af281cbaddbdf0c396c81d7b8::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 ComposerAutoloaderInitbfb8584841a8ff684295ce35ac926789
class ComposerAutoloaderInitba66c56af281cbaddbdf0c396c81d7b8
{
private static $loader;

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

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

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

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

$filesToLoad = \Composer\Autoload\ComposerStaticInitbfb8584841a8ff684295ce35ac926789::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitba66c56af281cbaddbdf0c396c81d7b8::$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 ComposerStaticInitbfb8584841a8ff684295ce35ac926789
class ComposerStaticInitba66c56af281cbaddbdf0c396c81d7b8
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -2999,9 +2999,9 @@ class ComposerStaticInitbfb8584841a8ff684295ce35ac926789
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitbfb8584841a8ff684295ce35ac926789::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitbfb8584841a8ff684295ce35ac926789::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitbfb8584841a8ff684295ce35ac926789::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitba66c56af281cbaddbdf0c396c81d7b8::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitba66c56af281cbaddbdf0c396c81d7b8::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitba66c56af281cbaddbdf0c396c81d7b8::$classMap;

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

0 comments on commit 852f522

Please sign in to comment.