@@ -27,7 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | try { |
| 29 | 29 | return $this->twig->render($template, $values); |
| 30 | - } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
| 30 | + } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
| 31 | 31 | throw new TemplateFailure($e); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | final class VisibilityBuilder |
| 17 | 17 | { |
| 18 | - public function build(Property|ClassMethod|ClassConst $member): Visibility |
|
| 18 | + public function build(Property | ClassMethod | ClassConst $member): Visibility |
|
| 19 | 19 | { |
| 20 | 20 | return match (true) { |
| 21 | 21 | $member->isPublic() => Visibility::public(), |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | if (property_exists($constant->value, 'value')) { |
| 48 | 48 | return self::TYPES[\gettype($constant->value->value)]; |
| 49 | 49 | } |
| 50 | - if (! $constant->value instanceof ConstFetch) { |
|
| 50 | + if (!$constant->value instanceof ConstFetch) { |
|
| 51 | 51 | return null; |
| 52 | 52 | } |
| 53 | 53 | return 'bool'; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function fromMethodParameter( |
| 30 | - Identifier|Name|ComplexType|null $type, |
|
| 30 | + Identifier | Name | ComplexType | null $type, |
|
| 31 | 31 | ?Doc $docBlock, |
| 32 | 32 | string $name, |
| 33 | 33 | UseStatements $useStatements |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $typeDeclaration = $this->fromParsedType($type); |
| 41 | - if (! $typeDeclaration->isBuiltInArray()) { |
|
| 41 | + if (!$typeDeclaration->isBuiltInArray()) { |
|
| 42 | 42 | return $typeDeclaration; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function fromMethodReturnType( |
| 51 | - Identifier|Name|ComplexType|null $type, |
|
| 51 | + Identifier | Name | ComplexType | null $type, |
|
| 52 | 52 | ?Doc $docBlock, |
| 53 | 53 | UseStatements $useStatements |
| 54 | 54 | ): TypeDeclaration { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $typeDeclaration = $this->fromParsedType($type); |
| 61 | - if (! $typeDeclaration->isBuiltInArray()) { |
|
| 61 | + if (!$typeDeclaration->isBuiltInArray()) { |
|
| 62 | 62 | return $typeDeclaration; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function fromPropertyType( |
| 71 | - Identifier|Name|ComplexType|null $type, |
|
| 71 | + Identifier | Name | ComplexType | null $type, |
|
| 72 | 72 | ?Doc $docBlock, |
| 73 | 73 | UseStatements $useStatements |
| 74 | 74 | ): TypeDeclaration { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $typeDeclaration = $this->fromParsedType($type); |
| 81 | - if (! $typeDeclaration->isBuiltInArray()) { |
|
| 81 | + if (!$typeDeclaration->isBuiltInArray()) { |
|
| 82 | 82 | return $typeDeclaration; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return $typeFromDocBlock->isPresent() ? $typeFromDocBlock : $typeDeclaration; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - private function fromParsedType(Identifier|Name|ComplexType|null $type): TypeDeclaration |
|
| 90 | + private function fromParsedType(Identifier | Name | ComplexType | null $type): TypeDeclaration |
|
| 91 | 91 | { |
| 92 | 92 | return match (true) { |
| 93 | 93 | $type instanceof NullableType => TypeDeclaration::fromNullable((string) $type->type), |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** @return string[] */ |
| 109 | - private function fromCompositeType(UnionType|IntersectionType $type): array |
|
| 109 | + private function fromCompositeType(UnionType | IntersectionType $type): array |
|
| 110 | 110 | { |
| 111 | 111 | return array_map( |
| 112 | - static fn (Identifier|Name $name): string => (string) $name, |
|
| 112 | + static fn (Identifier | Name $name): string => (string) $name, |
|
| 113 | 113 | $type->types |
| 114 | 114 | ); |
| 115 | 115 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | { |
| 45 | 45 | $members = $definitionMembers; |
| 46 | 46 | foreach ($this->filters as $filter) { |
| 47 | - $members = array_filter($members, static fn (Stmt|Param $member): bool => $filter->accept($member)); |
|
| 47 | + $members = array_filter($members, static fn (Stmt | Param $member): bool => $filter->accept($member)); |
|
| 48 | 48 | } |
| 49 | 49 | return $members; |
| 50 | 50 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $params = array_values(array_filter( |
| 35 | 35 | $parameterTags, |
| 36 | 36 | static fn (TagWithType|InvalidTag $parameter): bool => |
| 37 | - $parameter instanceof Param && "\${$parameter->getVariableName()}" === $parameterName |
|
| 37 | + $parameter instanceof Param && "\${$parameter->getVariableName()}" === $parameterName |
|
| 38 | 38 | )); |
| 39 | 39 | |
| 40 | 40 | if (count($params) < 1) { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** @var Param[] $params */ |
| 34 | 34 | $params = array_values(array_filter( |
| 35 | 35 | $parameterTags, |
| 36 | - static fn (TagWithType|InvalidTag $parameter): bool => |
|
| 36 | + static fn (TagWithType | InvalidTag $parameter): bool => |
|
| 37 | 37 | $parameter instanceof Param && "\${$parameter->getVariableName()}" === $parameterName |
| 38 | 38 | )); |
| 39 | 39 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | private function fromType(Type $type): TagType |
| 99 | 99 | { |
| 100 | - if (! $type instanceof Object_) { |
|
| 100 | + if (!$type instanceof Object_) { |
|
| 101 | 101 | return TagType::named((string) $type); |
| 102 | 102 | } |
| 103 | 103 | if ($type->getFqsen() === null) { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | final class UseStatementsBuilder |
| 22 | 22 | { |
| 23 | - public function build(Class_|Interface_|Trait_ $definition): UseStatements |
|
| 23 | + public function build(Class_ | Interface_ | Trait_ $definition): UseStatements |
|
| 24 | 24 | { |
| 25 | 25 | $uses = []; |
| 26 | 26 | |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | private function resolveExternalAttributes(ClassDefinition $definition, Codebase $codebase): void |
| 42 | 42 | { |
| 43 | - array_map(function (Property $property) use ($codebase): void { |
|
| 43 | + array_map(function(Property $property) use ($codebase): void { |
|
| 44 | 44 | $this->resolveExternalAssociationsFromTypeNames($property->references(), $codebase); |
| 45 | 45 | }, $definition->properties()); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | private function resolveExternalConstructorParameters(ClassDefinition $definition, Codebase $codebase): void |
| 49 | 49 | { |
| 50 | - array_map(function (Parameter $parameter) use ($codebase): void { |
|
| 50 | + array_map(function(Parameter $parameter) use ($codebase): void { |
|
| 51 | 51 | $this->resolveExternalAssociationsFromTypeNames($parameter->references(), $codebase); |
| 52 | 52 | }, $definition->constructorParameters()); |
| 53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** @param Name[] $references */ |
| 56 | 56 | private function resolveExternalAssociationsFromTypeNames(array $references, Codebase $codebase): void |
| 57 | 57 | { |
| 58 | - array_map(static function (Name $reference) use ($codebase): void { |
|
| 58 | + array_map(static function(Name $reference) use ($codebase): void { |
|
| 59 | 59 | if ($codebase->has($reference)) { |
| 60 | 60 | return; |
| 61 | 61 | } |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | /** @param Name[] $interfaces */ |
| 47 | 47 | private function resolveInterfaces(array $interfaces, Codebase $codebase): void |
| 48 | 48 | { |
| 49 | - array_map(static function (Name $interface) use ($codebase): void { |
|
| 50 | - if (! $codebase->has($interface)) { |
|
| 49 | + array_map(static function(Name $interface) use ($codebase): void { |
|
| 50 | + if (!$codebase->has($interface)) { |
|
| 51 | 51 | $codebase->add(new InterfaceDefinition($interface)); |
| 52 | 52 | } |
| 53 | 53 | }, $interfaces); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | /** @param Name[] $traits */ |
| 57 | 57 | private function resolveTraits(array $traits, Codebase $codebase): void |
| 58 | 58 | { |
| 59 | - array_map(static function (Name $trait) use ($codebase): void { |
|
| 60 | - if (! $codebase->has($trait)) { |
|
| 59 | + array_map(static function(Name $trait) use ($codebase): void { |
|
| 60 | + if (!$codebase->has($trait)) { |
|
| 61 | 61 | $codebase->add(new TraitDefinition($trait)); |
| 62 | 62 | } |
| 63 | 63 | }, $traits); |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | private function resolveExternalParentClass(ClassDefinition $definition, Codebase $codebase): void |
| 67 | 67 | { |
| 68 | - if (! $definition->hasParent()) { |
|
| 68 | + if (!$definition->hasParent()) { |
|
| 69 | 69 | return; |
| 70 | 70 | } |
| 71 | 71 | $parent = $definition->parent(); |
| 72 | - if (! $codebase->has($parent)) { |
|
| 72 | + if (!$codebase->has($parent)) { |
|
| 73 | 73 | $codebase->add(new ClassDefinition($parent)); |
| 74 | 74 | } |
| 75 | 75 | } |