Issue #3437409 ForbidCoreChangesValidator.php
Files
3- Comment on lines +100 to +107
I don't understand why we need this.
drupal/core
ordrupal/core-recommended
will be in here somewhere, right?IMHO this should be moved to a new method of
InstalledPackagesList
, calledhasDrupalCore()
. It would return TRUE if eitherdrupal/core
ordrupal/core-recommended
were there.public function hasDrupalCore(): bool { return isset($this['drupal/core']) || isset($this['drupal/core-recommended']); }
Or, we could add a new bool param to
getCorePackages()
which doesn't removedrupal/core
ifdrupal/core-recommended
is there. (TBH I kind of like this idea better.)Edited by Adam G-H I would rather not make any changes to the main module in this issue. It is currently needed because
\Drupal\package_manager\ComposerInspector::getInstalledPackagesList()
becausedrupal/core
could removed from the packages list.I think this validator should just throw an error any packages that we consider "core", \Drupal\package_manager\InstalledPackagesList::getCorePackageList are changed.
This is logic we have in several places. I think we might want to create an
InstalledPackagesComparer
(in another issue) which can do these kinds of computations.sure, I am not sure of all the places. I am not too worried a little duplication between the main module and this module. The sub-module will never exist by itself in core.