diff --git a/src/GeneratedHydrator/CodeGenerator/Visitor/HydratorMethodsVisitor.php b/src/GeneratedHydrator/CodeGenerator/Visitor/HydratorMethodsVisitor.php index cb325625..28874302 100644 --- a/src/GeneratedHydrator/CodeGenerator/Visitor/HydratorMethodsVisitor.php +++ b/src/GeneratedHydrator/CodeGenerator/Visitor/HydratorMethodsVisitor.php @@ -121,16 +121,15 @@ private function generatePropertyHydrateCall(ObjectProperty $property, string $i /** * @return string[] - * * @psalm-return list */ private function generatePropertyExtractCall(ObjectProperty $property): array { $propertyName = $property->name; $assignmentStatement = sprintf(' $values[\'%s\'] = $object->%1$s;', $propertyName); - $requiresGuard = $property->hasType && !($property->hasDefault || $property->allowsNull); + $requiresGuard = $property->hasType && ! ($property->hasDefault || $property->allowsNull); - if (!$requiresGuard) { + if (! $requiresGuard) { return [$assignmentStatement]; } diff --git a/src/GeneratedHydrator/CodeGenerator/Visitor/ObjectProperty.php b/src/GeneratedHydrator/CodeGenerator/Visitor/ObjectProperty.php index 849a04ac..b60b66d9 100644 --- a/src/GeneratedHydrator/CodeGenerator/Visitor/ObjectProperty.php +++ b/src/GeneratedHydrator/CodeGenerator/Visitor/ObjectProperty.php @@ -15,13 +15,9 @@ */ final class ObjectProperty { - /** @psalm-var non-empty-string */ - public string $name; - /** @psalm-param non-empty-string $name */ - private function __construct(string $name, public bool $hasType, public bool $allowsNull, public bool $hasDefault) + private function __construct(public string $name, public bool $hasType, public bool $allowsNull, public bool $hasDefault) { - $this->name = $name; } public static function fromReflection(ReflectionProperty $property): self