@@ -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 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $this->twig = $twig ?? new Twig(new FilesystemLoader(__DIR__ . '/../resources/templates')); |
| 25 | 25 | $this->twig->addFilter(new Filter( |
| 26 | 26 | 'whitespace', |
| 27 | - static fn (string $html): ?string => preg_replace('/\s\s+/', '', $html) |
|
| 27 | + static fn(string $html): ?string => preg_replace('/\s\s+/', '', $html) |
|
| 28 | 28 | )); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | try { |
| 35 | 35 | return $this->twig->render($template, $values); |
| 36 | - } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
| 36 | + } catch (LoaderError | RuntimeError | SyntaxError $e) { |
|
| 37 | 37 | throw new TemplateFailure($e); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(?string $name) |
| 18 | 18 | { |
| 19 | - if (! \in_array($name, self::$names, true)) { |
|
| 19 | + if (!\in_array($name, self::$names, true)) { |
|
| 20 | 20 | throw UnknownImageProcessor::named($name, self::$names); |
| 21 | 21 | } |
| 22 | 22 | $this->name = $name; |