@@ -19,16 +19,16 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | final class ProtectedVisibilityFilter implements VisibilityFilter |
| 21 | 21 | { |
| 22 | - public function accept(Stmt|Param $member): bool |
|
| 22 | + public function accept(Stmt | Param $member): bool |
|
| 23 | 23 | { |
| 24 | 24 | if ($member instanceof ClassConst |
| 25 | 25 | || $member instanceof ClassMethod |
| 26 | 26 | || $member instanceof Property) { |
| 27 | - return ! $member->isProtected(); |
|
| 27 | + return !$member->isProtected(); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | if ($member instanceof Param) { |
| 31 | - return ! (bool) ($member->flags & Class_::MODIFIER_PROTECTED); |
|
| 31 | + return !(bool) ($member->flags & Class_::MODIFIER_PROTECTED); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return false; |
@@ -19,16 +19,16 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | final class PrivateVisibilityFilter implements VisibilityFilter |
| 21 | 21 | { |
| 22 | - public function accept(Stmt|Param $member): bool |
|
| 22 | + public function accept(Stmt | Param $member): bool |
|
| 23 | 23 | { |
| 24 | 24 | if ($member instanceof ClassConst |
| 25 | 25 | || $member instanceof ClassMethod |
| 26 | 26 | || $member instanceof Property) { |
| 27 | - return ! $member->isPrivate(); |
|
| 27 | + return !$member->isPrivate(); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | if ($member instanceof Param) { |
| 31 | - return ! (bool) ($member->flags & Class_::MODIFIER_PRIVATE); |
|
| 31 | + return !(bool) ($member->flags & Class_::MODIFIER_PRIVATE); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return false; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | 'The directory with the code to be scanned cannot be empty' |
| 32 | 32 | ); |
| 33 | 33 | $directory = new SplFileInfo($path); |
| 34 | - if (! $directory->isDir()) { |
|
| 34 | + if (!$directory->isDir()) { |
|
| 35 | 35 | throw InvalidDirectory::notFoundAt($directory); |
| 36 | 36 | } |
| 37 | 37 | $this->directory = $directory; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function build(array $parsedProperties, UseStatements $useStatements): array |
| 32 | 32 | { |
| 33 | - return array_map(function (ParsedProperty $property) use ($useStatements): Property { |
|
| 33 | + return array_map(function(ParsedProperty $property) use ($useStatements): Property { |
|
| 34 | 34 | $variable = new Variable( |
| 35 | 35 | "\${$property->props[0]->name}", |
| 36 | 36 | $this->typeBuilder->fromPropertyType($property->type, $property->getDocComment(), $useStatements) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function fromPromotedProperties(array $promotedProperties, UseStatements $useStatements): array |
| 49 | 49 | { |
| 50 | - return array_map(function (Node\Param $param) use ($useStatements): Property { |
|
| 50 | + return array_map(function(Node\Param $param) use ($useStatements): Property { |
|
| 51 | 51 | /** @var Node\Expr\Variable $var */ |
| 52 | 52 | $var = $param->var; |
| 53 | 53 | |
@@ -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 | } |
@@ -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 | |