Skip to content

Commit 6192522

Browse files
authored
Merge pull request #761 from koekaverna/master
Update src/Generator/TypeBuilder.php
2 parents 393e8ff + 83a9da0 commit 6192522

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Generator/TypeBuilder.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ public function build(array $config, string $type): PhpFile
102102

103103
$class = $this->file->createClass($config['class_name'])
104104
->setFinal()
105-
->setExtends(self::EXTENDS[$type])
105+
->setExtends(static::EXTENDS[$type])
106106
->addImplements(GeneratedTypeInterface::class)
107107
->addConst('NAME', $config['name'])
108-
->setDocBlock(self::DOCBLOCK_TEXT);
108+
->setDocBlock(static::DOCBLOCK_TEXT);
109109

110110
$class->emptyLine();
111111

@@ -154,7 +154,7 @@ protected function wrapTypeRecursive($typeNode)
154154
$this->file->addUse(Type::class);
155155
break;
156156
default:
157-
if (in_array($typeNode->name->value, self::BUILT_IN_TYPES)) {
157+
if (in_array($typeNode->name->value, static::BUILT_IN_TYPES)) {
158158
$name = strtolower($typeNode->name->value);
159159
$type = Literal::new("Type::$name()");
160160
$this->file->addUse(Type::class);
@@ -431,8 +431,8 @@ protected function buildConstraints(array $constraints = []): Collection
431431
$this->file->addUse($fqcn);
432432
} else {
433433
// Symfony constraint
434-
$this->file->addUseGroup(self::CONSTRAINTS_NAMESPACE, $name);
435-
$fqcn = self::CONSTRAINTS_NAMESPACE."\\$name";
434+
$this->file->addUseGroup(static::CONSTRAINTS_NAMESPACE, $name);
435+
$fqcn = static::CONSTRAINTS_NAMESPACE."\\$name";
436436
}
437437

438438
if (!class_exists($fqcn)) {
@@ -482,7 +482,7 @@ protected function buildCascade(array $cascade): Collection
482482
if (isset($referenceType)) {
483483
$type = trim($referenceType, '[]!');
484484

485-
if (in_array($type, self::BUILT_IN_TYPES)) {
485+
if (in_array($type, static::BUILT_IN_TYPES)) {
486486
throw new GeneratorException('Cascade validation cannot be applied to built-in types.');
487487
}
488488

0 commit comments

Comments
 (0)