Skip to content

Commit fb7f7f3

Browse files
committed
Use paths from arguments to process
1 parent 1282d9c commit fb7f7f3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

bin/run-recipe

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ require_once __DIR__ . '/../vendor/autoload_runtime.php';
1414

1515
return static function (Command $command) {
1616
$command->addArgument('recipeName', InputArgument::REQUIRED);
17+
$command->addArgument('paths', InputArgument::REQUIRED | InputArgument::IS_ARRAY);
1718

1819
$command->setCode(function (InputInterface $input, OutputInterface $output) {
19-
$recipe = Recipe::tryFrom($input->getArgument('recipeName'));
20+
$recipeNameArgumentValue = $input->getArgument('recipeName');
21+
assert(is_string($recipeNameArgumentValue));
22+
$recipe = Recipe::tryFrom($recipeNameArgumentValue);
2023

2124
if ($recipe === null) {
2225
$output->writeln('<error>Invalid recipe name provided, allowed recipes are:</error>');
@@ -33,7 +36,10 @@ return static function (Command $command) {
3336

3437
$applicationDirectory = (string) getcwd();
3538

36-
$runRecipe->run($recipe->value, $applicationDirectory, ['src']);
39+
$pathsArgumentValue = $input->getArgument('paths');
40+
assert(is_array($pathsArgumentValue) && count($pathsArgumentValue) > 0);
41+
42+
$runRecipe->run($recipe->value, $applicationDirectory, $pathsArgumentValue);
3743
});
3844

3945
return $command;

phpstan.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ parameters:
66
level: max
77
paths:
88
- src
9-
- bin
109
- tests
10+
- bin/run-recipe
1111
checkUninitializedProperties: true
1212
excludePaths:
1313
- tests/ExampleApplication/

0 commit comments

Comments
 (0)