diff --git a/rules/Naming/Guard/BreakingVariableRenameGuard.php b/rules/Naming/Guard/BreakingVariableRenameGuard.php index f5be7d94235..b1f371fb190 100644 --- a/rules/Naming/Guard/BreakingVariableRenameGuard.php +++ b/rules/Naming/Guard/BreakingVariableRenameGuard.php @@ -187,6 +187,13 @@ final class BreakingVariableRenameGuard } private function isGenerator(Param $param) : bool { - return $this->nodeTypeResolver->isObjectType($param, new ObjectType('Symfony\\Component\\DependencyInjection\\Argument\\RewindableGenerator')); + if (!$param->type instanceof Node) { + return \false; + } + $paramType = $this->nodeTypeResolver->getType($param); + if (!$paramType instanceof ObjectType) { + return \false; + } + return $paramType->isInstanceOf('Symfony\\Component\\DependencyInjection\\Argument\\RewindableGenerator')->yes(); } } diff --git a/rules/Naming/Naming/ExpectedNameResolver.php b/rules/Naming/Naming/ExpectedNameResolver.php index 321530f6fb2..0fc0e9ae93d 100644 --- a/rules/Naming/Naming/ExpectedNameResolver.php +++ b/rules/Naming/Naming/ExpectedNameResolver.php @@ -119,8 +119,7 @@ final class ExpectedNameResolver if ($returnedType instanceof MixedType) { return null; } - if ($returnedType instanceof ObjectType && $returnedType->isInstanceOf('DateTimeInterface')->yes()) { - // skip date time, as custom naming + if ($this->isDateTimeType($returnedType)) { return null; } $expectedName = $this->propertyNaming->getExpectedNameFromType($returnedType); @@ -195,4 +194,17 @@ final class ExpectedNameResolver } return $arrayType->getItemType(); } + /** + * Skip date time, as custom naming + */ + private function isDateTimeType(Type $type) : bool + { + if (!$type instanceof ObjectType) { + return \false; + } + if ($type->isInstanceOf('DateTimeInterface')->yes()) { + return \true; + } + return $type->isInstanceOf('DateTime')->yes(); + } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 1f9d4ac4d95..5abe4236ff5 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'c9b0c27fa1df366ccf2213888d4351311bf82966'; + public const PACKAGE_VERSION = '96fae07575c6c64ac7e2950388cbe07d18cbcfc5'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-10-18 08:22:57'; + public const RELEASE_DATE = '2023-10-18 09:24:02'; /** * @var int */