File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 44error_reporting (E_ALL & ~E_DEPRECATED );
55ini_set ('display_errors ' , 'stderr ' );
66
7- $ opts = getopt ('' , ['mutator-class: ' ]);
8- if (! $ opts ) {
9- echo "Usage: php " . $ argv [0 ] ." -- mutator-class='Infection\Mutator\Removal\MethodCallRemoval' \n" ;
7+ $ opts = getopt ('' , ['source-directory:: ' , ' mutator-class: : ' ]);
8+ if ($ argc < 1 ) {
9+ echo "Usage: php " . $ argv [0 ] ." [--source-directory='another/path'] [-- mutator-class='Infection\Mutator\Removal\MethodCallRemoval] ' \n" ;
1010 exit (1 );
1111}
12+ $ addSourceDirectories = (array ) ($ opts ['source-directory ' ] ?? []);
13+ $ addMutatorClasses = (array ) ($ opts ['mutator-class ' ] ?? []);
1214
1315$ decoded = json_decode (file_get_contents (__DIR__ .'/../resources/infection.json5 ' ));
14- foreach ((array )$ opts ['mutator-class ' ] as $ mutatorclass ) {
16+ foreach ($ addSourceDirectories as $ path ) {
17+ $ decoded ->source ->directories [] = $ path ;
18+ }
19+ foreach ($ addMutatorClasses as $ mutatorclass ) {
1520 $ decoded ->mutators ->$ mutatorclass = true ;
1621}
1722
You can’t perform that action at this time.
0 commit comments