Updated Rector to commit 96fae07575c6c64ac7e2950388cbe07d18cbcfc5

96fae07575 Skip DateTime in ExpectedNameResolver (#5186)
This commit is contained in:
Tomas Votruba 2023-10-18 09:27:27 +00:00
parent 7949049389
commit d260adfd2b
3 changed files with 24 additions and 5 deletions

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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
*/