syntro-opensource/silverstripe-phpstan

Remove silverstripe/cms as a requirement?

Opened this issue · 0 comments

Hi

When using this module with framework-only projects and modules that do not require silverstripe/cms, silverstripe/cms is installed (https://github.com/syntro-opensource/silverstripe-phpstan/blob/5/composer.json#L29).

For these occurrences, adding silvertstripe/cms can make analysis problematic. A good example is a module that has conditional support for the cms via an extension, where analysis and testing needs to be performed both with and without the cms module installed.

It would be good if the cms module requirement could be decoupled and allow the project/module to install if it is required.
The stub classes could be made conditional, similar to https://github.com/Cambis/silverstripe-rector/blob/main/stubs/Page.php

Is this possible? Maybe a silverstripe-cms-phpstan module would do the trick and move all the CMS handling there (except the stubs per #16 )?

Thanks
James