@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function fromAttributes(ClassDefinition $class, Codebase $codebase): array |
35 | 35 | { |
36 | - return array_map(function (Variable $attribute) use ($class, $codebase) { |
|
36 | + return array_map(function(Variable $attribute) use ($class, $codebase) { |
|
37 | 37 | return $this->addAssociation($class, $attribute, $codebase); |
38 | 38 | }, array_filter($class->attributes(), [$this, 'needAssociation'])); |
39 | 39 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function fromConstructor(ClassDefinition $class, Codebase $codebase): array |
50 | 50 | { |
51 | - return array_map(function (Variable $attribute) use ($class, $codebase) { |
|
51 | + return array_map(function(Variable $attribute) use ($class, $codebase) { |
|
52 | 52 | return $this->addAssociation($class, $attribute, $codebase); |
53 | 53 | }, array_filter($class->constructorParameters(), [$this, 'needAssociation'])); |
54 | 54 | } |
@@ -72,6 +72,6 @@ discard block |
||
72 | 72 | |
73 | 73 | private function markAssociationResolvedFor(ClassDefinition $class, Variable $attribute): void |
74 | 74 | { |
75 | - $this->associations[strtolower($class->name() . '.' .$attribute->type())] = true; |
|
75 | + $this->associations[strtolower($class->name() . '.' . $attribute->type())] = true; |
|
76 | 76 | } |
77 | 77 | } |
@@ -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', function (string $html) { |
|
25 | + $this->twig->addFilter(new Filter('whitespace', function(string $html) { |
|
26 | 26 | return preg_replace('/\s\s+/', '', $html); |
27 | 27 | })); |
28 | 28 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | try { |
33 | 33 | return $this->twig->render($template, $values); |
34 | - } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
34 | + } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
35 | 35 | throw new TemplateFailure($e); |
36 | 36 | } |
37 | 37 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return []; |
50 | 50 | } |
51 | 51 | |
52 | - $constructors = array_filter($this->methods, function (Method $method) { |
|
52 | + $constructors = array_filter($this->methods, function(Method $method) { |
|
53 | 53 | return $method->isConstructor(); |
54 | 54 | }); |
55 | 55 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function countAttributesByVisibility(Visibility $modifier): int |
65 | 65 | { |
66 | - return \count(array_filter($this->attributes, function (Attribute $attribute) use ($modifier) { |
|
66 | + return \count(array_filter($this->attributes, function(Attribute $attribute) use ($modifier) { |
|
67 | 67 | return $attribute->hasVisibility($modifier); |
68 | 68 | })); |
69 | 69 | } |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function countTypedAttributesByVisibility(Visibility $modifier): int |
77 | 77 | { |
78 | - return \count(array_filter($this->attributes, function (Attribute $attribute) use ($modifier) { |
|
78 | + return \count(array_filter($this->attributes, function(Attribute $attribute) use ($modifier) { |
|
79 | 79 | return $attribute->hasTypeDeclaration() && $attribute->hasVisibility($modifier); |
80 | 80 | })); |
81 | 81 | } |
82 | 82 | |
83 | 83 | public function isAbstract(): bool |
84 | 84 | { |
85 | - return \count(array_filter($this->methods(), function (Method $method) { |
|
85 | + return \count(array_filter($this->methods(), function(Method $method) { |
|
86 | 86 | return $method->isAbstract(); |
87 | 87 | })) > 0; |
88 | 88 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | private function hasConstructor(): bool |
111 | 111 | { |
112 | - return \count(array_filter($this->methods, function (Method $function) { |
|
112 | + return \count(array_filter($this->methods, function(Method $function) { |
|
113 | 113 | return $function->isConstructor(); |
114 | 114 | })) === 1; |
115 | 115 | } |
@@ -92,7 +92,7 @@ |
||
92 | 92 | */ |
93 | 93 | public function countMethodsByVisibility(Visibility $modifier): int |
94 | 94 | { |
95 | - return \count(array_filter($this->methods, function (Method $method) use ($modifier) { |
|
95 | + return \count(array_filter($this->methods, function(Method $method) use ($modifier) { |
|
96 | 96 | return $method->hasVisibility($modifier); |
97 | 97 | })); |
98 | 98 | } |