Updated Rector to commit f7b9dd9035931da5a040f5c714c79c32c424b677

f7b9dd9035 Update rector.php of skip() to allow file name has word: "Expected" (#5347)
This commit is contained in:
Tomas Votruba 2023-12-10 02:05:30 +00:00
parent 34915563d5
commit 5c2f93e7b7
2 changed files with 9 additions and 9 deletions

View File

@ -119,7 +119,7 @@ final class ExpectedNameResolver
return null; return null;
} }
$expectedName = $this->propertyNaming->getExpectedNameFromType($returnedType); $expectedName = $this->propertyNaming->getExpectedNameFromType($returnedType);
if ($expectedName !== null) { if ($expectedName instanceof ExpectedName) {
return $expectedName->getName(); return $expectedName->getName();
} }
// call with args can return different value, so skip there if not sure about the type // 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; return null;
} }
$expectedNameFromMethodName = $this->propertyNaming->getExpectedNameFromMethodName($name); $expectedNameFromMethodName = $this->propertyNaming->getExpectedNameFromMethodName($name);
if ($expectedNameFromMethodName !== null) { if ($expectedNameFromMethodName instanceof ExpectedName) {
return $expectedNameFromMethodName->getName(); return $expectedNameFromMethodName->getName();
} }
return null; return null;
} }
public function resolveForForeach(VariableAndCallForeach $variableAndCallForeach) : ?string public function resolveForForeach(VariableAndCallForeach $variableAndCallForeach) : ?string
{ {
$expr = $variableAndCallForeach->getCall(); $call = $variableAndCallForeach->getCall();
if ($this->isDynamicNameCall($expr)) { if ($this->isDynamicNameCall($call)) {
return null; return null;
} }
$name = $this->nodeNameResolver->getName($expr->name); $name = $this->nodeNameResolver->getName($call->name);
if ($name === null) { if ($name === null) {
return null; return null;
} }
$returnedType = $this->nodeTypeResolver->getType($expr); $returnedType = $this->nodeTypeResolver->getType($call);
if ($returnedType->isIterable()->no()) { if ($returnedType->isIterable()->no()) {
return null; return null;
} }
@ -168,7 +168,7 @@ final class ExpectedNameResolver
} }
private function isReturnedTypeAnArrayAndExpectedNameFromTypeNotNull(Type $returnedType, ?ExpectedName $expectedName) : bool 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 * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\FuncCall $expr

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = 'bc69455d8a05c1325d64dac545931594ca1fe4aa'; public const PACKAGE_VERSION = 'f7b9dd9035931da5a040f5c714c79c32c424b677';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2023-12-10 00:27:31'; public const RELEASE_DATE = '2023-12-10 09:03:22';
/** /**
* @var int * @var int
*/ */