Roave/infection-static-analysis-plugin

--configuration support

WyriHaximus opened this issue · 7 comments

Can't seem to find it, but does this project support the --configuration flag from Infection? I'd like to move some files out of my projects root dir to declutter them. But for some reason I can't find the flag for it in this package.

In theory, all parameters from infection are also reflected here

In theory, but not in practice:

image

Hmm, seems really weird.

Consider that the two setups are almost exactly the same:

https://github.com/infection/infection/blob/2679bf3efd5d94d000cdda36e191c3cfecdf9e76/bin/infection#L83

vs

(new Application(Bootstrapper::bootstrap(
Container::create(),
new RunStaticAnalysisAgainstMutant($makeAnalyzer)
)))
->run();

Perhaps it's caused by this bit?

// @TODO we may want to make this one lazy, but for now this is OK
$replacedService = $container->getMutantExecutionResultFactory();
$factory = static function () use ($replacedService, $runStaticAnalysis): MutantExecutionResultFactory {
return new RunStaticAnalysisAgainstEscapedMutant(
$replacedService,
$runStaticAnalysis
);
};

I can imagine that infection may be loading the configuration too eagerly there.

Potentially feasible to make it properly lazy via some more reflection nightmares...

Potentially feasible to make it properly lazy via some more reflection nightmares...

To add to that nightmare, the next step would be to make it possible to also pass the psalm config location

Can you make a separate issue for that? :D

Done

I have a fix for this and #28, PR incoming :)

image