mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 1f9829d2a3820f39fe0601b996c5cba71ffb42b0
1f9829d2a3
[Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector (#5428)
This commit is contained in:
parent
da887b253b
commit
5457aea4e0
|
@ -5,6 +5,7 @@ namespace Rector\Strict\NodeAnalyzer;
|
||||||
|
|
||||||
use PhpParser\Node\Expr;
|
use PhpParser\Node\Expr;
|
||||||
use PhpParser\Node\Expr\PropertyFetch;
|
use PhpParser\Node\Expr\PropertyFetch;
|
||||||
|
use PhpParser\Node\Expr\StaticPropertyFetch;
|
||||||
use PhpParser\Node\Stmt\ClassLike;
|
use PhpParser\Node\Stmt\ClassLike;
|
||||||
use PhpParser\Node\Stmt\Property;
|
use PhpParser\Node\Stmt\Property;
|
||||||
use PHPStan\Type\ThisType;
|
use PHPStan\Type\ThisType;
|
||||||
|
@ -44,10 +45,10 @@ final class UnitializedPropertyAnalyzer
|
||||||
}
|
}
|
||||||
public function isUnitialized(Expr $expr) : bool
|
public function isUnitialized(Expr $expr) : bool
|
||||||
{
|
{
|
||||||
if (!$expr instanceof PropertyFetch) {
|
if (!$expr instanceof PropertyFetch && !$expr instanceof StaticPropertyFetch) {
|
||||||
return \false;
|
return \false;
|
||||||
}
|
}
|
||||||
$varType = $this->nodeTypeResolver->getType($expr->var);
|
$varType = $expr instanceof PropertyFetch ? $this->nodeTypeResolver->getType($expr->var) : $this->nodeTypeResolver->getType($expr->class);
|
||||||
if ($varType instanceof ThisType) {
|
if ($varType instanceof ThisType) {
|
||||||
$varType = $varType->getStaticObjectType();
|
$varType = $varType->getStaticObjectType();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = 'f85e8c27b3932196d882c70b063f517a48b5aaac';
|
public const PACKAGE_VERSION = '1f9829d2a3820f39fe0601b996c5cba71ffb42b0';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-01-03 14:06:43';
|
public const RELEASE_DATE = '2024-01-04 22:47:15';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue