@@ -50,7 +50,7 @@ |
||
| 50 | 50 | ->pipe($this->parseCode) |
| 51 | 51 | ->pipe($this->createDigraph) |
| 52 | 52 | ->pipe($this->createClassDiagram) |
| 53 | - ->pipe(fn (OutputContent $content) => $this->saveFile->saveTo($content, $input->filePath())); |
|
| 53 | + ->pipe(fn(OutputContent $content) => $this->saveFile->saveTo($content, $input->filePath())); |
|
| 54 | 54 | |
| 55 | 55 | $pipeline->process($input->codebaseDirectory()); |
| 56 | 56 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | ->pipe($this->findCode) |
| 48 | 48 | ->pipe($this->parseCode) |
| 49 | 49 | ->pipe($this->calculateStatistics) |
| 50 | - ->pipe(fn (OutputContent $content) => $this->saveFile->saveTo($content, $input->filePath())); |
|
| 50 | + ->pipe(fn(OutputContent $content) => $this->saveFile->saveTo($content, $input->filePath())); |
|
| 51 | 51 | |
| 52 | 52 | $pipeline->process($input->codebaseDirectory()); |
| 53 | 53 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** @param mixed[] $options*/ |
| 31 | 31 | public function __construct(array $options, private ProgressDisplay $display) |
| 32 | 32 | { |
| 33 | - $recursive = (bool) ($options['recursive'] ?? false); |
|
| 33 | + $recursive = (bool)($options['recursive'] ?? false); |
|
| 34 | 34 | $this->codeFinder = $recursive ? SourceCodeFinder::recursive() : SourceCodeFinder::nonRecursive(); |
| 35 | 35 | $this->codeParser = CodeParser::fromConfiguration(new CodeParserConfiguration($options)); |
| 36 | 36 | $this->statisticsProcessor = new StatisticsProcessor(new TemplateEngine()); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(string $name) |
| 18 | 18 | { |
| 19 | - if (! \in_array($name, self::VALID_NAMES, true)) { |
|
| 19 | + if (!\in_array($name, self::VALID_NAMES, true)) { |
|
| 20 | 20 | throw UnknownTheme::named($name, self::VALID_NAMES); |
| 21 | 21 | } |
| 22 | 22 | $this->name = $name; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $edges = []; |
| 59 | 59 | foreach ($variables as $parameter) { |
| 60 | - if (! $this->needAssociation($class, $parameter)) { |
|
| 60 | + if (!$this->needAssociation($class, $parameter)) { |
|
| 61 | 61 | continue; |
| 62 | 62 | } |
| 63 | 63 | $edges[] = $this->addAssociation($class, $parameter, $codebase); |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | private function needAssociation(ClassDefinition $class, HasType $attribute): bool |
| 76 | 76 | { |
| 77 | - if (! $attribute->isAReference()) { |
|
| 77 | + if (!$attribute->isAReference()) { |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | - return ! $this->isAssociationResolved($class, $attribute); |
|
| 80 | + return !$this->isAssociationResolved($class, $attribute); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | private function isAssociationResolved(ClassDefinition $class, HasType $attribute): bool |
@@ -22,11 +22,11 @@ |
||
| 22 | 22 | /** @param mixed[] $options */ |
| 23 | 23 | public function __construct(array $options) |
| 24 | 24 | { |
| 25 | - $this->extractAssociations = (bool) ($options['associations'] ?? false); |
|
| 26 | - $this->hidePrivate = (bool) ($options['hide-private'] ?? false); |
|
| 27 | - $this->hideProtected = (bool) ($options['hide-protected'] ?? false); |
|
| 28 | - $this->hideAttributes = (bool) ($options['hide-attributes'] ?? false); |
|
| 29 | - $this->hideMethods = (bool) ($options['hide-methods'] ?? false); |
|
| 25 | + $this->extractAssociations = (bool)($options['associations'] ?? false); |
|
| 26 | + $this->hidePrivate = (bool)($options['hide-private'] ?? false); |
|
| 27 | + $this->hideProtected = (bool)($options['hide-protected'] ?? false); |
|
| 28 | + $this->hideAttributes = (bool)($options['hide-attributes'] ?? false); |
|
| 29 | + $this->hideMethods = (bool)($options['hide-methods'] ?? false); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function extractAssociations(): bool |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public function build(Trait_ $trait): TraitDefinition |
| 30 | 30 | { |
| 31 | 31 | return new TraitDefinition( |
| 32 | - new Name((string) $trait->name), |
|
| 32 | + new Name((string)$trait->name), |
|
| 33 | 33 | $this->membersBuilder->methods($trait->getMethods()), |
| 34 | 34 | $this->membersBuilder->attributes($trait->stmts, $trait->getMethod('__construct')), |
| 35 | 35 | $this->buildTraits($trait->stmts) |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | public function build(Class_ $class): ClassDefinition |
| 33 | 33 | { |
| 34 | 34 | return new ClassDefinition( |
| 35 | - new ClassDefinitionName((string) $class->name), |
|
| 35 | + new ClassDefinitionName((string)$class->name), |
|
| 36 | 36 | $this->membersBuilder->methods($class->getMethods()), |
| 37 | 37 | $this->membersBuilder->constants($class->stmts), |
| 38 | - $class->extends !== null ? new ClassDefinitionName((string) end($class->extends->parts)) : null, |
|
| 38 | + $class->extends !== null ? new ClassDefinitionName((string)end($class->extends->parts)) : null, |
|
| 39 | 39 | $this->membersBuilder->attributes($class->stmts, $class->getMethod('__construct')), |
| 40 | 40 | $this->buildInterfaces($class->implements), |
| 41 | 41 | $this->buildTraits($class->stmts) |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | private function buildTraits(array $nodes): array |
| 21 | 21 | { |
| 22 | - $useStatements = array_filter($nodes, static fn (Node $node): bool => $node instanceof TraitUse); |
|
| 22 | + $useStatements = array_filter($nodes, static fn(Node $node): bool => $node instanceof TraitUse); |
|
| 23 | 23 | |
| 24 | 24 | if (count($useStatements) === 0) { |
| 25 | 25 | return []; |