Skip to content

Commit

Permalink
[TASK] Check if config files are valid files
Browse files Browse the repository at this point in the history
Resolves: #36
  • Loading branch information
s2b committed Jul 8, 2024
1 parent 4614f25 commit 3f3591b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ConsoleRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ public function getOutputDir(): string

private function createPackageFromConfigFile(string $filePath): ViewHelperPackage
{
if (!is_file($filePath)) {
throw new \InvalidArgumentException('Specified path is not a valid configuration file: ' . $filePath);
}

// Read file
$config = json_decode((string)file_get_contents($filePath), flags: JSON_THROW_ON_ERROR);

Expand Down

0 comments on commit 3f3591b

Please sign in to comment.