phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

\Drupal\Core\Config\ExtensionInstallStorage::__construct should be triggering deprecations.

Open mglaman opened this issue 6 years ago • 1 comments

Service definition:

config.storage.schema:
    class: Drupal\Core\Config\ExtensionInstallStorage
    arguments: ['@config.storage', 'config/schema', '', true, '%install_profile%']

__construct

  public function __construct(StorageInterface $config_storage, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE, $profile = NULL) {
    parent::__construct($directory, $collection);
    $this->configStorage = $config_storage;
    $this->includeProfile = $include_profile;
    if (is_null($profile)) {
      @trigger_error('Install profile will be a mandatory parameter in Drupal 9.0.', E_USER_DEPRECATED);
    }
    $this->installProfile = $profile ?: \Drupal::installProfile();
  }

Need to test if the parameter is empty. If so, why no trigger.

mglaman avatar Feb 04 '19 19:02 mglaman

This is impossible to check out of the box, and needs to have its own specific rule for "new constructor signature, calling with the old signature is deprecated.

mglaman avatar Jul 26 '22 19:07 mglaman