@@ -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; |
@@ -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'; |
@@ -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 | } |
@@ -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 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** @return Name[] */ |
80 | 80 | public function references(): array |
81 | 81 | { |
82 | - if (! $this->isPresent()) { |
|
82 | + if (!$this->isPresent()) { |
|
83 | 83 | return []; |
84 | 84 | } |
85 | 85 | if ($this->isBuiltIn()) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | $typesFromUnion = array_map(static fn (Name $name) => TypeDeclaration::from($name->fullName()), $this->names); |
93 | - $references = array_filter($typesFromUnion, static fn (TypeDeclaration $type) => ! $type->isBuiltIn()); |
|
93 | + $references = array_filter($typesFromUnion, static fn (TypeDeclaration $type) => !$type->isBuiltIn()); |
|
94 | 94 | |
95 | 95 | return array_map( |
96 | 96 | static fn (TypeDeclaration $reference) => $reference->isArray() |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function isBuiltIn(): bool |
108 | 108 | { |
109 | - if (! $this->isRegularType()) { |
|
109 | + if (!$this->isRegularType()) { |
|
110 | 110 | return false; |
111 | 111 | } |
112 | 112 | $type = (string) $this->names[0]; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | final class VisibilityBuilder |
15 | 15 | { |
16 | - public function build(Property|ClassMethod|ClassConst $member): Visibility |
|
16 | + public function build(Property | ClassMethod | ClassConst $member): Visibility |
|
17 | 17 | { |
18 | 18 | return match (true) { |
19 | 19 | $member->isPublic() => Visibility::PUBLIC, |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | /** @return null|int|Node|Node[] */ |
24 | - public function leaveNode(Node $node): null|int|Node|array |
|
24 | + public function leaveNode(Node $node): null | int | Node | array |
|
25 | 25 | { |
26 | 26 | if ($node instanceof Enum_) { |
27 | 27 | $this->codebase->add($this->builder->build($node)); |
@@ -21,9 +21,9 @@ |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | /** @return null|int|Node|Node[] */ |
24 | - public function leaveNode(Node $node): null|int|Node|array |
|
24 | + public function leaveNode(Node $node): null | int | Node | array |
|
25 | 25 | { |
26 | - if (! $node instanceof Class_) { |
|
26 | + if (!$node instanceof Class_) { |
|
27 | 27 | return null; |
28 | 28 | } |
29 | 29 | if ($node->isAnonymous()) { |