3 declare(strict_types=1);
5 namespace CuyZ\Valinor\Definition\Repository\Cache\Compiler;
7 use CuyZ\Valinor\Definition\PropertyDefinition;
10 final class PropertyDefinitionCompiler
12 public function __construct(
13 private TypeCompiler $typeCompiler,
14 private AttributesCompiler $attributesCompiler
17 public function compile(PropertyDefinition $property): string
19 $type = $this->typeCompiler->compile($property->type());
20 $hasDefaultValue = var_export($property->hasDefaultValue(), true);
21 $defaultValue = var_export($property->defaultValue(), true);
22 $isPublic = var_export($property->isPublic(), true);
23 $attributes = $this->attributesCompiler->compile($property->attributes());
26 new \CuyZ\Valinor\Definition\PropertyDefinition(
27 '{$property->name()}',
28 '{$property->signature()}',