@@ -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 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function build(array $parsedAttributes, UseStatements $useStatements): array |
39 | 39 | { |
40 | - return array_map(function (Property $attribute) use ($useStatements): Attribute { |
|
40 | + return array_map(function(Property $attribute) use ($useStatements): Attribute { |
|
41 | 41 | $variable = new Variable( |
42 | 42 | "\${$attribute->props[0]->name}", |
43 | 43 | $this->typeBuilder->fromAttributeType($attribute->type, $attribute->getDocComment(), $useStatements) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function fromPromotedProperties(array $promotedProperties, UseStatements $useStatements): array |
56 | 56 | { |
57 | - return array_map(function (Node\Param $param) use ($useStatements): Attribute { |
|
57 | + return array_map(function(Node\Param $param) use ($useStatements): Attribute { |
|
58 | 58 | /** @var Node\Expr\Variable $var */ |
59 | 59 | $var = $param->var; |
60 | 60 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function constants(array $members): array |
45 | 45 | { |
46 | 46 | /** @var ClassConst[] $constants */ |
47 | - $constants = array_filter($members, static fn ($attribute): bool => $attribute instanceof ClassConst); |
|
47 | + $constants = array_filter($members, static fn($attribute): bool => $attribute instanceof ClassConst); |
|
48 | 48 | |
49 | 49 | /** @var ClassConst[] $filteredConstants */ |
50 | 50 | $filteredConstants = $this->filters->apply($constants); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | /** @var Property[] $properties */ |
67 | - $properties = array_filter($members, static fn ($attribute): bool => $attribute instanceof Property); |
|
67 | + $properties = array_filter($members, static fn($attribute): bool => $attribute instanceof Property); |
|
68 | 68 | |
69 | 69 | /** @var Property[] $filteredAttributes */ |
70 | 70 | $filteredAttributes = $this->filters->apply($properties); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $promotedProperties = array_filter( |
91 | 91 | $constructor->getParams(), |
92 | - static fn (Node\Param $param) => $param->flags !== 0 |
|
92 | + static fn(Node\Param $param) => $param->flags !== 0 |
|
93 | 93 | ); |
94 | 94 | |
95 | 95 | /** @var Node\Param[] $filteredPromotedProperties */ |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function endsWith(Name $name): bool |
17 | 17 | { |
18 | - return str_ends_with(haystack: (string) $this->name, needle: $name->removeArraySuffix()); |
|
18 | + return str_ends_with(haystack : (string) $this->name, needle : $name->removeArraySuffix()); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function includes(Name $name): bool |
@@ -18,6 +18,6 @@ |
||
18 | 18 | */ |
19 | 19 | private function buildInterfaces(array $implements): array |
20 | 20 | { |
21 | - return array_map(static fn (Name $name): DefinitionName => new DefinitionName((string) $name), $implements); |
|
21 | + return array_map(static fn(Name $name): DefinitionName => new DefinitionName((string) $name), $implements); |
|
22 | 22 | } |
23 | 23 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | private function buildTraits(array $nodes): array |
21 | 21 | { |
22 | - $useStatements = array_filter($nodes, static fn (Node $node): bool => $node instanceof TraitUse); |
|
22 | + $useStatements = array_filter($nodes, static fn(Node $node): bool => $node instanceof TraitUse); |
|
23 | 23 | |
24 | 24 | $traits = []; |
25 | 25 | /** @var TraitUse $use */ |
@@ -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; |
@@ -20,18 +20,18 @@ |
||
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 | |
27 | 27 | $previous = $definition->getAttribute('previous'); |
28 | 28 | while ($previous instanceof Use_ || $previous instanceof GroupUse) { |
29 | 29 | if ($previous instanceof Use_) { |
30 | - $uses[] = array_map(fn (UseUse $use): UseStatement => $this->fromUseStatement($use), $previous->uses); |
|
30 | + $uses[] = array_map(fn(UseUse $use): UseStatement => $this->fromUseStatement($use), $previous->uses); |
|
31 | 31 | } else { |
32 | 32 | $prefix = (string) $previous->prefix; |
33 | 33 | $uses[] = array_map( |
34 | - fn (UseUse $use): UseStatement => $this->fromGroupedUse($use, $prefix), |
|
34 | + fn(UseUse $use): UseStatement => $this->fromGroupedUse($use, $prefix), |
|
35 | 35 | $previous->uses |
36 | 36 | ); |
37 | 37 | } |