ServiceProviderBase::alter shouldn't call parent::register

Created on 18 June 2024, 10 days ago
Updated 19 June 2024, 8 days ago

Problem/Motivation

While discussing another issue with @larowlan he noticed this call to parent::register().

class ProjectBrowserServiceProvider extends ServiceProviderBase {
  public function alter(ContainerBuilder $container) {
    if (array_key_exists('package_manager', $container->getParameter('container.modules'))) {
      parent::register($container);
     ....

It was Lee's view that this didn't seem right calling ::register from an alter (which is running after all the services have initially been registered). Note that all tests pass if you remove this line.

Steps to reproduce

Proposed resolution

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia sime Canberra

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024