@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function returnType(): TypeDeclaration |
33 | 33 | { |
34 | 34 | $type = null; |
35 | - if (preg_match(self::$returnExpression, (string) $this->comment, $matches) === 1) { |
|
35 | + if (preg_match(self::$returnExpression, (string)$this->comment, $matches) === 1) { |
|
36 | 36 | $type = trim($matches[1]); |
37 | 37 | } |
38 | 38 | return TypeDeclaration::from($type); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | private function setParameters(): void |
53 | 53 | { |
54 | - if (preg_match_all(self::$parameterExpression, (string) $this->comment, $matches) < 1) { |
|
54 | + if (preg_match_all(self::$parameterExpression, (string)$this->comment, $matches) < 1) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | foreach ($matches[0] as $typeHint) { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** @see HasType::isAReference() for more details */ |
16 | 16 | public function isAReference(): bool |
17 | 17 | { |
18 | - return $this->hasTypeDeclaration() && ! $this->type->isBuiltIn(); |
|
18 | + return $this->hasTypeDeclaration() && !$this->type->isBuiltIn(); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** @see HasType::hasTypeDeclaration() for more details */ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function isBuiltIn(): bool |
60 | 60 | { |
61 | - $type = (string) $this->name; |
|
61 | + $type = (string)$this->name; |
|
62 | 62 | if ($this->isArray()) { |
63 | 63 | $type = $this->removeArraySuffix(); |
64 | 64 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function isArray(): bool |
69 | 69 | { |
70 | - return strpos((string) $this->name, '[]') === \strlen((string) $this->name) - 2; |
|
70 | + return strpos((string)$this->name, '[]') === \strlen((string)$this->name) - 2; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | public function isNullable(): bool |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function removeArraySuffix(): string |
79 | 79 | { |
80 | - return substr((string) $this->name, 0, -2); |
|
80 | + return substr((string)$this->name, 0, -2); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | public function __toString() |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function absolutePath(): string |
23 | 23 | { |
24 | - return (string) $this->directory->getRealPath(); |
|
24 | + return (string)$this->directory->getRealPath(); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | private function __construct(string $path) |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | private function setDirectory(SplFileInfo $path): void |
33 | 33 | { |
34 | - if (! $path->isDir()) { |
|
34 | + if (!$path->isDir()) { |
|
35 | 35 | throw InvalidDirectory::notFoundAt($path); |
36 | 36 | } |
37 | 37 | $this->directory = $path; |
@@ -18,6 +18,6 @@ |
||
18 | 18 | /** @param ClassMethod|Property $member */ |
19 | 19 | public function accept($member): bool |
20 | 20 | { |
21 | - return ! $member->isPrivate(); |
|
21 | + return !$member->isPrivate(); |
|
22 | 22 | } |
23 | 23 | } |
@@ -15,6 +15,6 @@ |
||
15 | 15 | /** @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Property $member */ |
16 | 16 | public function accept($member): bool |
17 | 17 | { |
18 | - return ! $member->isProtected(); |
|
18 | + return !$member->isProtected(); |
|
19 | 19 | } |
20 | 20 | } |
@@ -43,11 +43,11 @@ |
||
43 | 43 | */ |
44 | 44 | public function build(array $parsedAttributes): array |
45 | 45 | { |
46 | - $attributes = array_filter($parsedAttributes, static function ($attribute): bool { |
|
46 | + $attributes = array_filter($parsedAttributes, static function($attribute): bool { |
|
47 | 47 | return $attribute instanceof Property; |
48 | 48 | }); |
49 | 49 | |
50 | - return array_map(function (Property $attribute): Attribute { |
|
50 | + return array_map(function(Property $attribute): Attribute { |
|
51 | 51 | $name = "\${$attribute->props[0]->name}"; |
52 | 52 | $visibility = $this->visibilityBuilder->build($attribute); |
53 | 53 | $comment = $attribute->getDocComment() === null ? null : $attribute->getDocComment()->getText(); |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function build(array $methods): array |
54 | 54 | { |
55 | - return array_map(function (ClassMethod $method): Method { |
|
55 | + return array_map(function(ClassMethod $method): Method { |
|
56 | 56 | return $this->buildMethod($method); |
57 | 57 | }, $this->visibilityFilters->apply($methods)); |
58 | 58 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function build(array $parameters, MethodDocBlock $methodDocBlock): array |
30 | 30 | { |
31 | - return array_map(function (Param $parameter) use ($methodDocBlock): Parameter { |
|
31 | + return array_map(function(Param $parameter) use ($methodDocBlock): Parameter { |
|
32 | 32 | /** @var \PhpParser\Node\Expr\Variable $parsedParameter Since the parser throws error by default */ |
33 | 33 | $parsedParameter = $parameter->var; |
34 | 34 |