Skip to content

Commit

Permalink
Merge pull request #1103 from malcomio/extensions
Browse files Browse the repository at this point in the history
add extensions argument - fixes #1098
  • Loading branch information
veewee authored Sep 5, 2023
2 parents 7f007bc + 5313baa commit affbb6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Task/PhpMd.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function run(ContextInterface $context): TaskResultInterface
$arguments->addOptionalArgument('--exclude', !empty($config['exclude']));
$arguments->addOptionalCommaSeparatedArgument('%s', $config['exclude']);

$arguments->addOptionalArgument('--suffixes', !empty($extensions));
$arguments->addOptionalCommaSeparatedArgument('%s', $extensions);

$process = $this->processBuilder->buildProcess($arguments);
$process->run();

Expand Down
8 changes: 8 additions & 0 deletions test/Unit/Task/PhpMdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public function provideExternalTaskRuns(): iterable
'hello.php,hello2.php',
'text',
'cleancode,codesize,naming',
'--suffixes',
'php',
]
];

Expand All @@ -129,6 +131,8 @@ public function provideExternalTaskRuns(): iterable
'cleancode,codesize,naming',
'--exclude',
'hello.php,hello2.php',
'--suffixes',
'php',
]
];

Expand All @@ -142,6 +146,8 @@ public function provideExternalTaskRuns(): iterable
'hello.php,hello2.php',
'text',
'cleancode',
'--suffixes',
'php',
]
];

Expand All @@ -155,6 +161,8 @@ public function provideExternalTaskRuns(): iterable
'hello.php,hello2.php',
'ansi',
'cleancode,codesize,naming',
'--suffixes',
'php',
]
];
}
Expand Down

0 comments on commit affbb6c

Please sign in to comment.