@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | private function elementsToDotLanguage(): string |
64 | 64 | { |
65 | - $dotFormat = array_map(function (HasDotRepresentation $element) { |
|
65 | + $dotFormat = array_map(function(HasDotRepresentation $element) { |
|
66 | 66 | return $element->toDotLanguage(); |
67 | 67 | }, $this->dotElements); |
68 | 68 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | protected function buildInterfaces(RawDefinitions $definitions, array $implements): array |
78 | 78 | { |
79 | - return array_map(function (string $interface) use ($definitions) { |
|
79 | + return array_map(function(string $interface) use ($definitions) { |
|
80 | 80 | return $this->resolveRelatedInterface($definitions, $interface); |
81 | 81 | }, $implements); |
82 | 82 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | try { |
29 | 29 | return $this->twig->render($template, $values); |
30 | - } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
30 | + } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
31 | 31 | throw new TemplateFailure($e); |
32 | 32 | } |
33 | 33 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | /** @return string[] */ |
56 | 56 | private function buildInterfaces(array $implements): array |
57 | 57 | { |
58 | - return array_map(function (Name $name) { |
|
58 | + return array_map(function(Name $name) { |
|
59 | 59 | return $name->getLast(); |
60 | 60 | }, $implements); |
61 | 61 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | public function countMethodsByVisibility(Visibility $modifier): int |
42 | 42 | { |
43 | - return \count(array_filter($this->methods, function (Method $method) use ($modifier) { |
|
43 | + return \count(array_filter($this->methods, function(Method $method) use ($modifier) { |
|
44 | 44 | return $method->hasVisibility($modifier); |
45 | 45 | })); |
46 | 46 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function fromAttributes(ClassDefinition $class, Structure $structure): array |
35 | 35 | { |
36 | - return array_map(function (Variable $attribute) use ($class, $structure) { |
|
36 | + return array_map(function(Variable $attribute) use ($class, $structure) { |
|
37 | 37 | return $this->addAssociation($class, $attribute, $structure); |
38 | 38 | }, array_filter($class->attributes(), [$this, 'needAssociation'])); |
39 | 39 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if (!$class->hasConstructor()) { |
52 | 52 | return []; |
53 | 53 | } |
54 | - return array_map(function (Variable $attribute) use ($class, $structure) { |
|
54 | + return array_map(function(Variable $attribute) use ($class, $structure) { |
|
55 | 55 | return $this->addAssociation($class, $attribute, $structure); |
56 | 56 | }, array_filter($class->constructorParameters(), [$this, 'needAssociation'])); |
57 | 57 | } |
@@ -34,11 +34,11 @@ |
||
34 | 34 | /** @param \PhpParser\Node[] $definitionAttributes */ |
35 | 35 | public function build(array $definitionAttributes): array |
36 | 36 | { |
37 | - $attributes = array_filter($definitionAttributes, function ($attribute) { |
|
37 | + $attributes = array_filter($definitionAttributes, function($attribute) { |
|
38 | 38 | return $attribute instanceof Property; |
39 | 39 | }); |
40 | 40 | |
41 | - return array_map(function (Property $attribute) { |
|
41 | + return array_map(function(Property $attribute) { |
|
42 | 42 | return [ |
43 | 43 | "\${$attribute->props[0]->name}", |
44 | 44 | $this->resolveVisibility($attribute), |
@@ -23,10 +23,10 @@ |
||
23 | 23 | /** @param \PhpParser\Node[] $classAttributes */ |
24 | 24 | public function build(array $classAttributes): array |
25 | 25 | { |
26 | - $constants = array_filter($classAttributes, function ($attribute) { |
|
26 | + $constants = array_filter($classAttributes, function($attribute) { |
|
27 | 27 | return $attribute instanceof ClassConst; |
28 | 28 | }); |
29 | - return array_map(function (ClassConst $constant) { |
|
29 | + return array_map(function(ClassConst $constant) { |
|
30 | 30 | return [ |
31 | 31 | "{$constant->consts[0]->name}", |
32 | 32 | $this->determineType($constant->consts[0]), |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function hasConstructor(): bool |
37 | 37 | { |
38 | - return \count(array_filter($this->methods, function (Method $function) { |
|
38 | + return \count(array_filter($this->methods, function(Method $function) { |
|
39 | 39 | return $function->isConstructor(); |
40 | 40 | })) === 1; |
41 | 41 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return []; |
48 | 48 | } |
49 | 49 | |
50 | - $constructors = array_filter($this->methods, function (Method $method) { |
|
50 | + $constructors = array_filter($this->methods, function(Method $method) { |
|
51 | 51 | return $method->isConstructor(); |
52 | 52 | }); |
53 | 53 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function isAbstract(): bool |
63 | 63 | { |
64 | - return \count(array_filter($this->methods(), function (Method $method) { |
|
64 | + return \count(array_filter($this->methods(), function(Method $method) { |
|
65 | 65 | return $method->isAbstract(); |
66 | 66 | })) > 0; |
67 | 67 | } |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | |
74 | 74 | public function countAttributesByVisibility(Visibility $modifier): int |
75 | 75 | { |
76 | - return \count(array_filter($this->attributes, function (Attribute $attribute) use ($modifier) { |
|
76 | + return \count(array_filter($this->attributes, function(Attribute $attribute) use ($modifier) { |
|
77 | 77 | return $attribute->hasVisibility($modifier); |
78 | 78 | })); |
79 | 79 | } |
80 | 80 | |
81 | 81 | public function countTypedAttributesByVisibility(Visibility $modifier): int |
82 | 82 | { |
83 | - return \count(array_filter($this->attributes, function (Attribute $attribute) use ($modifier) { |
|
83 | + return \count(array_filter($this->attributes, function(Attribute $attribute) use ($modifier) { |
|
84 | 84 | return $attribute->hasTypeDeclaration() && $attribute->hasVisibility($modifier); |
85 | 85 | })); |
86 | 86 | } |