@@ -48,7 +48,7 @@ |
||
48 | 48 | public function build(array $methods): array |
49 | 49 | { |
50 | 50 | return array_map( |
51 | - fn (ClassMethod $method): Method => $this->buildMethod($method), |
|
51 | + fn(ClassMethod $method): Method => $this->buildMethod($method), |
|
52 | 52 | $this->visibilityFilters->apply($methods) |
53 | 53 | ); |
54 | 54 | } |
@@ -68,11 +68,11 @@ |
||
68 | 68 | { |
69 | 69 | switch (true) { |
70 | 70 | case $type instanceof NullableType: |
71 | - return TypeDeclaration::fromNullable((string) $type->type); |
|
71 | + return TypeDeclaration::fromNullable((string)$type->type); |
|
72 | 72 | case $type instanceof Name: |
73 | 73 | return TypeDeclaration::from($type->getLast()); |
74 | 74 | case $type instanceof Identifier: |
75 | - return TypeDeclaration::from((string) $type); |
|
75 | + return TypeDeclaration::from((string)$type); |
|
76 | 76 | default: |
77 | 77 | throw UnsupportedType::declaredAs($type); |
78 | 78 | } |
@@ -42,10 +42,10 @@ |
||
42 | 42 | */ |
43 | 43 | public function build(array $classAttributes): array |
44 | 44 | { |
45 | - $constants = array_filter($classAttributes, static fn ($attribute): bool => $attribute instanceof ClassConst); |
|
45 | + $constants = array_filter($classAttributes, static fn($attribute): bool => $attribute instanceof ClassConst); |
|
46 | 46 | |
47 | - return array_map(fn (ClassConst $constant): Constant => new Constant( |
|
48 | - (string) $constant->consts[0]->name, |
|
47 | + return array_map(fn(ClassConst $constant): Constant => new Constant( |
|
48 | + (string)$constant->consts[0]->name, |
|
49 | 49 | TypeDeclaration::from($this->determineType($constant->consts[0])), |
50 | 50 | $this->visibilityBuilder->build($constant) |
51 | 51 | ), $this->visibilityFilters->apply($constants)); |
@@ -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) |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | |
40 | 40 | private function resolveExternalAttributes(ClassDefinition $definition, Codebase $codebase): void |
41 | 41 | { |
42 | - array_map(function (Attribute $attribute) use ($codebase): void { |
|
43 | - if ($attribute->isAReference() && ! $codebase->has($attribute->referenceName())) { |
|
42 | + array_map(function(Attribute $attribute) use ($codebase): void { |
|
43 | + if ($attribute->isAReference() && !$codebase->has($attribute->referenceName())) { |
|
44 | 44 | $codebase->add(new ClassDefinition($attribute->referenceName())); |
45 | 45 | } |
46 | 46 | }, $definition->attributes()); |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | private function resolveExternalConstructorParameters(ClassDefinition $definition, Codebase $codebase): void |
50 | 50 | { |
51 | - array_map(function (Parameter $parameter) use ($codebase): void { |
|
52 | - if ($parameter->isAReference() && ! $codebase->has($parameter->referenceName())) { |
|
51 | + array_map(function(Parameter $parameter) use ($codebase): void { |
|
52 | + if ($parameter->isAReference() && !$codebase->has($parameter->referenceName())) { |
|
53 | 53 | $codebase->add(new ClassDefinition($parameter->referenceName())); |
54 | 54 | } |
55 | 55 | }, $definition->constructorParameters()); |
@@ -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 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $codebase = $this->parser->parse($finder); |
47 | 47 | |
48 | - array_map(static fn (RelationshipsResolver $resolver) => $resolver->resolve($codebase), $this->resolvers); |
|
48 | + array_map(static fn(RelationshipsResolver $resolver) => $resolver->resolve($codebase), $this->resolvers); |
|
49 | 49 | |
50 | 50 | return $codebase; |
51 | 51 | } |