@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | protected function buildTraits(array $nodes): array |
21 | 21 | { |
22 | - $useStatements = array_filter($nodes, static function (Node $node): bool { |
|
22 | + $useStatements = array_filter($nodes, static function(Node $node): bool { |
|
23 | 23 | return $node instanceof TraitUse; |
24 | 24 | }); |
25 | 25 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | protected function buildInterfaces(array $implements): array |
20 | 20 | { |
21 | - return array_map(static function (Name $name): DefinitionName { |
|
21 | + return array_map(static function(Name $name): DefinitionName { |
|
22 | 22 | return DefinitionName::from($name->getLast()); |
23 | 23 | }, $implements); |
24 | 24 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function __construct(Twig $twig = null) |
23 | 23 | { |
24 | 24 | $this->twig = $twig ?? new Twig(new FilesystemLoader(__DIR__ . '/../resources/templates')); |
25 | - $this->twig->addFilter(new Filter('whitespace', static function (string $html): ?string { |
|
25 | + $this->twig->addFilter(new Filter('whitespace', static function(string $html): ?string { |
|
26 | 26 | return preg_replace('/\s\s+/', '', $html); |
27 | 27 | })); |
28 | 28 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | try { |
34 | 34 | return $this->twig->render($template, $values); |
35 | - } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
35 | + } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
36 | 36 | throw new TemplateFailure($e); |
37 | 37 | } |
38 | 38 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function countMethodsByVisibility(Visibility $modifier): int |
39 | 39 | { |
40 | - return \count(array_filter($this->methods, static function (Method $method) use ($modifier): bool { |
|
40 | + return \count(array_filter($this->methods, static function(Method $method) use ($modifier): bool { |
|
41 | 41 | return $method->hasVisibility($modifier); |
42 | 42 | })); |
43 | 43 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function constructorParameters(): array |
65 | 65 | { |
66 | - $constructors = array_filter($this->methods, static function (Method $method): bool { |
|
66 | + $constructors = array_filter($this->methods, static function(Method $method): bool { |
|
67 | 67 | return $method->isConstructor(); |
68 | 68 | }); |
69 | 69 | $constructor = reset($constructors); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function countAttributesByVisibility(Visibility $modifier): int |
80 | 80 | { |
81 | - return \count(array_filter($this->attributes, static function (Attribute $attribute) use ($modifier): bool { |
|
81 | + return \count(array_filter($this->attributes, static function(Attribute $attribute) use ($modifier): bool { |
|
82 | 82 | return $attribute->hasVisibility($modifier); |
83 | 83 | })); |
84 | 84 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function countTypedAttributesByVisibility(Visibility $modifier): int |
92 | 92 | { |
93 | - return \count(array_filter($this->attributes, static function (Attribute $attribute) use ($modifier): bool { |
|
93 | + return \count(array_filter($this->attributes, static function(Attribute $attribute) use ($modifier): bool { |
|
94 | 94 | return $attribute->hasTypeDeclaration() && $attribute->hasVisibility($modifier); |
95 | 95 | })); |
96 | 96 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function isAbstract(): bool |
150 | 150 | { |
151 | - return \count(array_filter($this->methods(), static function (Method $method): bool { |
|
151 | + return \count(array_filter($this->methods(), static function(Method $method): bool { |
|
152 | 152 | return $method->isAbstract(); |
153 | 153 | })) > 0; |
154 | 154 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | use Rector\Set\ValueObject\SetList; |
12 | 12 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
13 | 13 | |
14 | -return static function (ContainerConfigurator $containerConfigurator): void { |
|
14 | +return static function(ContainerConfigurator $containerConfigurator): void { |
|
15 | 15 | // get parameters |
16 | 16 | $parameters = $containerConfigurator->parameters(); |
17 | 17 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | $edges = []; |
59 | 59 | foreach ($variables as $parameter) { |
60 | - if (! $this->needAssociation($class, $parameter)) { |
|
60 | + if (!$this->needAssociation($class, $parameter)) { |
|
61 | 61 | continue; |
62 | 62 | } |
63 | 63 | $edges[] = $this->addAssociation($class, $parameter, $codebase); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | private function needAssociation(ClassDefinition $class, HasType $attribute): bool |
76 | 76 | { |
77 | - return $attribute->isAReference() && ! $this->isAssociationResolved($class, $attribute); |
|
77 | + return $attribute->isAReference() && !$this->isAssociationResolved($class, $attribute); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | private function isAssociationResolved(ClassDefinition $class, HasType $attribute): bool |
@@ -36,6 +36,6 @@ |
||
36 | 36 | |
37 | 37 | public function id(): string |
38 | 38 | { |
39 | - return sha1((string) mt_rand()); |
|
39 | + return sha1((string)mt_rand()); |
|
40 | 40 | } |
41 | 41 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | private function __construct(string $name) |
29 | 29 | { |
30 | - if (! \in_array($name, self::$validNames, true)) { |
|
30 | + if (!\in_array($name, self::$validNames, true)) { |
|
31 | 31 | throw UnknownTheme::named($name, self::$validNames); |
32 | 32 | } |
33 | 33 | $this->name = $name; |