Skip to content

Commit

Permalink
Updated Rector to commit 26b8b540ed08315062c007dafd572f9896b509eb
Browse files Browse the repository at this point in the history
rectorphp/rector-src@26b8b54 [Naming] Reduce instanceof ObjectType on ExpectedNameResolver (take 5) (#6423)
  • Loading branch information
TomasVotruba committed Nov 12, 2024
1 parent 7e09c8b commit 5ba0775
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions rules/Naming/Naming/ExpectedNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function resolveForCall($expr) : ?string
return null;
}
$returnedType = $this->nodeTypeResolver->getType($expr);
if (!$returnedType->isObject()->yes()) {
if (!$returnedType instanceof ObjectType) {
return null;
}
if ($this->isDateTimeType($returnedType)) {
Expand Down Expand Up @@ -197,14 +197,11 @@ private function resolveReturnTypeFromArrayType(ArrayType $arrayType) : ?Type
/**
* Skip date time, as custom naming
*/
private function isDateTimeType(Type $type) : bool
private function isDateTimeType(ObjectType $objectType) : bool
{
if (!$type instanceof ObjectType) {
return \false;
}
if ($type->isInstanceOf('DateTimeInterface')->yes()) {
if ($objectType->isInstanceOf('DateTimeInterface')->yes()) {
return \true;
}
return $type->isInstanceOf('DateTime')->yes();
return $objectType->isInstanceOf('DateTime')->yes();
}
}
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 = '84bb59697d2cf5d564b5a2ace9be4f3496d6f131';
public const PACKAGE_VERSION = '26b8b540ed08315062c007dafd572f9896b509eb';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-11-12 20:13:01';
public const RELEASE_DATE = '2024-11-12 21:17:49';
/**
* @var int
*/
Expand Down

0 comments on commit 5ba0775

Please sign in to comment.