mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 12:29:43 +01:00
Updated Rector to commit f7b9dd9035931da5a040f5c714c79c32c424b677
f7b9dd9035
Update rector.php of skip() to allow file name has word: "Expected" (#5347)
This commit is contained in:
parent
34915563d5
commit
5c2f93e7b7
@ -119,7 +119,7 @@ final class ExpectedNameResolver
|
||||
return null;
|
||||
}
|
||||
$expectedName = $this->propertyNaming->getExpectedNameFromType($returnedType);
|
||||
if ($expectedName !== null) {
|
||||
if ($expectedName instanceof ExpectedName) {
|
||||
return $expectedName->getName();
|
||||
}
|
||||
// call with args can return different value, so skip there if not sure about the type
|
||||
@ -127,22 +127,22 @@ final class ExpectedNameResolver
|
||||
return null;
|
||||
}
|
||||
$expectedNameFromMethodName = $this->propertyNaming->getExpectedNameFromMethodName($name);
|
||||
if ($expectedNameFromMethodName !== null) {
|
||||
if ($expectedNameFromMethodName instanceof ExpectedName) {
|
||||
return $expectedNameFromMethodName->getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public function resolveForForeach(VariableAndCallForeach $variableAndCallForeach) : ?string
|
||||
{
|
||||
$expr = $variableAndCallForeach->getCall();
|
||||
if ($this->isDynamicNameCall($expr)) {
|
||||
$call = $variableAndCallForeach->getCall();
|
||||
if ($this->isDynamicNameCall($call)) {
|
||||
return null;
|
||||
}
|
||||
$name = $this->nodeNameResolver->getName($expr->name);
|
||||
$name = $this->nodeNameResolver->getName($call->name);
|
||||
if ($name === null) {
|
||||
return null;
|
||||
}
|
||||
$returnedType = $this->nodeTypeResolver->getType($expr);
|
||||
$returnedType = $this->nodeTypeResolver->getType($call);
|
||||
if ($returnedType->isIterable()->no()) {
|
||||
return null;
|
||||
}
|
||||
@ -168,7 +168,7 @@ final class ExpectedNameResolver
|
||||
}
|
||||
private function isReturnedTypeAnArrayAndExpectedNameFromTypeNotNull(Type $returnedType, ?ExpectedName $expectedName) : bool
|
||||
{
|
||||
return $returnedType instanceof ArrayType && $expectedName !== null;
|
||||
return $returnedType instanceof ArrayType && $expectedName instanceof ExpectedName;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\FuncCall $expr
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'bc69455d8a05c1325d64dac545931594ca1fe4aa';
|
||||
public const PACKAGE_VERSION = 'f7b9dd9035931da5a040f5c714c79c32c424b677';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-12-10 00:27:31';
|
||||
public const RELEASE_DATE = '2023-12-10 09:03:22';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user