@@ -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 |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** @param string[] $types */ |
| 51 | 51 | public static function fromUnionType(array $types): TypeDeclaration |
| 52 | 52 | { |
| 53 | - return new TypeDeclaration(array_map(static fn (string $type) => new Name($type), $types)); |
|
| 53 | + return new TypeDeclaration(array_map(static fn(string $type) => new Name($type), $types)); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function isPresent(): bool |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** @return Name[] */ |
| 62 | 62 | public function references(): array |
| 63 | 63 | { |
| 64 | - if (! $this->isPresent()) { |
|
| 64 | + if (!$this->isPresent()) { |
|
| 65 | 65 | return []; |
| 66 | 66 | } |
| 67 | 67 | if ($this->isBuiltIn()) { |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | return [$this->isArray() ? new Name($this->removeArraySuffix()) : $this->names[0]]; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $typesFromUnion = array_map(static fn (Name $name) => TypeDeclaration::from((string) $name), $this->names); |
|
| 75 | - $references = array_filter($typesFromUnion, static fn (TypeDeclaration $type) => ! $type->isBuiltIn()); |
|
| 74 | + $typesFromUnion = array_map(static fn(Name $name) => TypeDeclaration::from((string) $name), $this->names); |
|
| 75 | + $references = array_filter($typesFromUnion, static fn(TypeDeclaration $type) => !$type->isBuiltIn()); |
|
| 76 | 76 | |
| 77 | 77 | return array_map( |
| 78 | - static fn (TypeDeclaration $reference) => $reference->isArray() |
|
| 78 | + static fn(TypeDeclaration $reference) => $reference->isArray() |
|
| 79 | 79 | ? new Name($reference->removeArraySuffix()) |
| 80 | 80 | : $reference->names[0], |
| 81 | 81 | $references |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function isBuiltIn(): bool |
| 90 | 90 | { |
| 91 | - if (! $this->isRegularType()) { |
|
| 91 | + if (!$this->isRegularType()) { |
|
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | $type = (string) $this->names[0]; |
@@ -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; |