@@ -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 | } |
@@ -22,17 +22,17 @@ |
||
22 | 22 | |
23 | 23 | public function add(Definition $definition): void |
24 | 24 | { |
25 | - $this->definitions[(string) $definition->name()] = $definition; |
|
25 | + $this->definitions[(string)$definition->name()] = $definition; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function has(Name $name): bool |
29 | 29 | { |
30 | - return isset($this->definitions[(string) $name]); |
|
30 | + return isset($this->definitions[(string)$name]); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function get(Name $name): Definition |
34 | 34 | { |
35 | - return $this->definitions[(string) $name]; |
|
35 | + return $this->definitions[(string)$name]; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** @return Definition[] */ |
@@ -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 setDirectory(string $path): void |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | 'The directory with the code to be scanned cannot be empty' |
32 | 32 | ); |
33 | 33 | $directory = new SplFileInfo($path); |
34 | - if (! $directory->isDir()) { |
|
34 | + if (!$directory->isDir()) { |
|
35 | 35 | throw InvalidDirectory::notFoundAt($directory); |
36 | 36 | } |
37 | 37 | $this->directory = $directory; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | if ($member instanceof ClassConst |
23 | 23 | || $member instanceof ClassMethod |
24 | 24 | || $member instanceof Property) { |
25 | - return ! $member->isProtected(); |
|
25 | + return !$member->isProtected(); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | return false; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | if ($member instanceof ClassConst |
23 | 23 | || $member instanceof ClassMethod |
24 | 24 | || $member instanceof Property) { |
25 | - return ! $member->isPrivate(); |
|
25 | + return !$member->isPrivate(); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | return false; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $attributes = $classMembers; |
45 | 45 | foreach ($this->filters as $filter) { |
46 | - $attributes = array_filter($attributes, static fn (Stmt $member): bool => $filter->accept($member)); |
|
46 | + $attributes = array_filter($attributes, static fn(Stmt $member): bool => $filter->accept($member)); |
|
47 | 47 | } |
48 | 48 | return $attributes; |
49 | 49 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function build(array $parameters, ?Doc $methodDocBlock): array |
29 | 29 | { |
30 | - return array_map(function (Param $parameter) use ($methodDocBlock): Parameter { |
|
30 | + return array_map(function(Param $parameter) use ($methodDocBlock) : Parameter { |
|
31 | 31 | /** @var \PhpParser\Node\Expr\Variable $parsedParameter Since the parser throws error by default */ |
32 | 32 | $parsedParameter = $parameter->var; |
33 | 33 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function build(Interface_ $interface): InterfaceDefinition |
33 | 33 | { |
34 | 34 | return new InterfaceDefinition( |
35 | - new InterfaceDefinitionName((string) $interface->name), |
|
35 | + new InterfaceDefinitionName((string)$interface->name), |
|
36 | 36 | $this->membersBuilder->methods($interface->getMethods()), |
37 | 37 | $this->membersBuilder->constants($interface->stmts), |
38 | 38 | $this->buildInterfaces($interface->extends) |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | /** @param Name[] $interfaces */ |
48 | 48 | private function resolveExternalInterfaces(array $interfaces, Codebase $codebase): void |
49 | 49 | { |
50 | - array_map(function (Name $interface) use ($codebase): void { |
|
51 | - if (! $codebase->has($interface)) { |
|
50 | + array_map(function(Name $interface) use ($codebase): void { |
|
51 | + if (!$codebase->has($interface)) { |
|
52 | 52 | $codebase->add(new InterfaceDefinition($interface)); |
53 | 53 | } |
54 | 54 | }, $interfaces); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | /** @param Name[] $traits */ |
58 | 58 | private function resolveExternalTraits(array $traits, Codebase $codebase): void |
59 | 59 | { |
60 | - array_map(function (Name $trait) use ($codebase): void { |
|
61 | - if (! $codebase->has($trait)) { |
|
60 | + array_map(function(Name $trait) use ($codebase): void { |
|
61 | + if (!$codebase->has($trait)) { |
|
62 | 62 | $codebase->add(new TraitDefinition($trait)); |
63 | 63 | } |
64 | 64 | }, $traits); |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | |
67 | 67 | private function resolveExternalParentClass(ClassDefinition $definition, Codebase $codebase): void |
68 | 68 | { |
69 | - if (! $definition->hasParent()) { |
|
69 | + if (!$definition->hasParent()) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | $parent = $definition->parent(); |
73 | - if (! $codebase->has($parent)) { |
|
73 | + if (!$codebase->has($parent)) { |
|
74 | 74 | $codebase->add(new ClassDefinition($parent)); |
75 | 75 | } |
76 | 76 | } |