@@ -32,10 +32,10 @@ |
||
32 | 32 | public function build(Class_ $class): ClassDefinition |
33 | 33 | { |
34 | 34 | return new ClassDefinition( |
35 | - new ClassDefinitionName((string) $class->name), |
|
35 | + new ClassDefinitionName((string)$class->name), |
|
36 | 36 | $this->membersBuilder->methods($class->getMethods()), |
37 | 37 | $this->membersBuilder->constants($class->stmts), |
38 | - $class->extends !== null ? new ClassDefinitionName((string) end($class->extends->parts)) : null, |
|
38 | + $class->extends !== null ? new ClassDefinitionName((string)end($class->extends->parts)) : null, |
|
39 | 39 | $this->membersBuilder->attributes($class->stmts, $class->getMethod('__construct')), |
40 | 40 | $this->buildInterfaces($class->implements), |
41 | 41 | $this->buildTraits($class->stmts) |
@@ -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 | if (count($useStatements) === 0) { |
25 | 25 | return []; |
@@ -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($name->getLast()), $implements); |
|
21 | + return array_map(static fn(Name $name): DefinitionName => new DefinitionName($name->getLast()), $implements); |
|
22 | 22 | } |
23 | 23 | } |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function build(array $parsedAttributes): array |
39 | 39 | { |
40 | - $attributes = array_filter($parsedAttributes, static fn ($attribute): bool => $attribute instanceof Property); |
|
40 | + $attributes = array_filter($parsedAttributes, static fn($attribute): bool => $attribute instanceof Property); |
|
41 | 41 | |
42 | - return array_map(function (Property $attribute): Attribute { |
|
42 | + return array_map(function(Property $attribute): Attribute { |
|
43 | 43 | $variable = new Variable( |
44 | 44 | "\${$attribute->props[0]->name}", |
45 | 45 | $this->typeBuilder->fromAttributeType($attribute->type, $attribute->getDocComment()) |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function fromPromotedProperties(array $constructorParameters): array |
58 | 58 | { |
59 | - $promotedProperties = array_filter($constructorParameters, fn (Node\Param $param) => $param->flags !== 0); |
|
59 | + $promotedProperties = array_filter($constructorParameters, fn(Node\Param $param) => $param->flags !== 0); |
|
60 | 60 | |
61 | - return array_map(function (Node\Param $param): Attribute { |
|
61 | + return array_map(function(Node\Param $param): Attribute { |
|
62 | 62 | /** @var Node\Expr\Variable $var */ |
63 | 63 | $var = $param->var; |
64 | 64 |
@@ -15,9 +15,9 @@ discard block |
||
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 | - return match (true) { |
|
20 | + return match(true) { |
|
21 | 21 | $member->isPublic() => Visibility::public(), |
22 | 22 | $member->isPrivate() => Visibility::private(), |
23 | 23 | default => Visibility::protected(), |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | |
27 | 27 | public function fromFlags(int $flags): Visibility |
28 | 28 | { |
29 | - return match (true) { |
|
30 | - (bool) ($flags & Class_::MODIFIER_PUBLIC) => Visibility::public(), |
|
31 | - (bool) ($flags & Class_::MODIFIER_PROTECTED) => Visibility::protected(), |
|
32 | - (bool) ($flags & Class_::MODIFIER_PRIVATE) => Visibility::private(), |
|
29 | + return match(true) { |
|
30 | + (bool)($flags & Class_::MODIFIER_PUBLIC) => Visibility::public(), |
|
31 | + (bool)($flags & Class_::MODIFIER_PROTECTED) => Visibility::protected(), |
|
32 | + (bool)($flags & Class_::MODIFIER_PRIVATE) => Visibility::private(), |
|
33 | 33 | default => throw UnknownVisibilityFlag::withValue($flags) |
34 | 34 | }; |
35 | 35 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public function leaveNode(Node $node) |
26 | 26 | { |
27 | - if (! $node instanceof Class_) { |
|
27 | + if (!$node instanceof Class_) { |
|
28 | 28 | return null; |
29 | 29 | } |
30 | 30 | if ($node->isAnonymous()) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | public function __construct(string $name) |
18 | 18 | { |
19 | - if (! \in_array($name, self::NAMES, true)) { |
|
19 | + if (!\in_array($name, self::NAMES, true)) { |
|
20 | 20 | throw UnknownImageProcessor::named($name, self::NAMES); |
21 | 21 | } |
22 | 22 | $this->name = $name; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | use Rector\Set\ValueObject\SetList; |
14 | 14 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
15 | 15 | |
16 | -return static function (ContainerConfigurator $containerConfigurator): void { |
|
16 | +return static function(ContainerConfigurator $containerConfigurator): void { |
|
17 | 17 | $parameters = $containerConfigurator->parameters(); |
18 | 18 | |
19 | 19 | $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $edges = []; |
60 | 60 | foreach ($variables as $parameter) { |
61 | - if (! $this->needAssociation($class, $parameter)) { |
|
61 | + if (!$this->needAssociation($class, $parameter)) { |
|
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | $edges[] = $this->addAssociations($class, $parameter, $codebase); |
@@ -72,14 +72,14 @@ discard block |
||
72 | 72 | $this->markAssociationResolvedFor($class, $attribute); |
73 | 73 | |
74 | 74 | return array_map( |
75 | - fn (Name $reference): Edge => Edge::association($codebase->get($reference), $class), |
|
75 | + fn(Name $reference): Edge => Edge::association($codebase->get($reference), $class), |
|
76 | 76 | $attribute->references() |
77 | 77 | ); |
78 | 78 | } |
79 | 79 | |
80 | 80 | private function needAssociation(ClassDefinition $class, HasType $attribute): bool |
81 | 81 | { |
82 | - return ! $this->isAssociationResolved($class, $attribute); |
|
82 | + return !$this->isAssociationResolved($class, $attribute); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | private function isAssociationResolved(ClassDefinition $class, HasType $attribute): bool |