Skip to content

Commit

Permalink
[TASK] Fix phpstan tests
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf committed Sep 16, 2024
1 parent 1adbd51 commit 65a7832
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

$finder = (new PhpCsFixer\Finder())
->exclude('vendor')
->exclude('.cache')
->in(__DIR__);

return (new PhpCsFixer\Config())
Expand Down
12 changes: 9 additions & 3 deletions src/ConsoleRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ private function renderViewHelperDocumentation(ViewHelperPackage $package, ViewH
'sourceEdit' => isset($sourceEdit->editPrefix) ? $sourceEdit->editPrefix . str_replace('\\', '/', $viewHelper->metadata->name) . '.php' : '',
'jsonFile' => str_repeat('../', substr_count($viewHelper->uri, '/')) . $package->name . '.json',
]);
$this->writeFile($this->getOutputDir() . $viewHelper->uri . '.rst', $view->render());
$content = $view->render();
assert(is_string($content));
$this->writeFile($this->getOutputDir() . $viewHelper->uri . '.rst', $content);
}

/**
Expand All @@ -219,7 +221,9 @@ private function renderGroupDocumentation(
'tocTree' => array_map(fn($viewHelper) => $pathToRoot . $viewHelper->uri, $viewHelpers),
'headline' => $headline,
]);
$this->writeFile($this->getOutputDir() . $uri . '.rst', $view->render());
$content = $view->render();
assert(is_string($content));
$this->writeFile($this->getOutputDir() . $uri . '.rst', $content);
}

/**
Expand All @@ -234,7 +238,9 @@ private function renderRootDocumentation(array $packages): void

$view = $this->createView($firstPackage->templates['root']);
$view->assign('tocTree', array_map(fn($package) => $package->uri, $packages));
$this->writeFile($this->getOutputDir() . 'Index.rst', $view->render());
$content = $view->render();
assert(is_string($content));
$this->writeFile($this->getOutputDir() . 'Index.rst', $content);
}

private function createView(string $templateFile): TemplateView
Expand Down

0 comments on commit 65a7832

Please sign in to comment.