Skip to content

Commit 975df18

Browse files
committed
refactor: improve Main->run()
1 parent c5555d6 commit 975df18

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Main.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public function run(): void
2525
{
2626
$finder = $this->createFinder();
2727
$entries = $this->findEntries($finder);
28-
29-
$relation = new Relation($entries, $this->options);
30-
$this->renderRelations($relation);
28+
$this->renderEntries($entries);
3129
}
3230

3331
private function createFinder(): Finder
@@ -67,8 +65,13 @@ private function findEntries(Finder $finder): array
6765
return $entries;
6866
}
6967

70-
private function renderRelations(Relation $relation): void
68+
/**
69+
* @param list<Entry> $entries
70+
*/
71+
private function renderEntries(array $entries): void
7172
{
73+
$relation = new Relation($entries, $this->options);
74+
7275
switch ($this->options->diagram()) {
7376
case Options::DIAGRAM_CLASS:
7477
echo implode("\r\n", $relation->dump()) . "\r\n";

0 commit comments

Comments
 (0)