class PackageManagerBypassServiceProvider

Defines services to bypass Package Manager's core functionality.

@internal

Hierarchy

Expanded class hierarchy of PackageManagerBypassServiceProvider

File

core/modules/package_manager/tests/modules/package_manager_bypass/src/PackageManagerBypassServiceProvider.php, line 20

Namespace

Drupal\package_manager_bypass
View source
final class PackageManagerBypassServiceProvider extends ServiceProviderBase {
    
    /**
     * {@inheritdoc}
     */
    public function alter(ContainerBuilder $container) : void {
        parent::alter($container);
        // By default, \Drupal\package_manager_bypass\NoOpStager is applied, except
        // when a test opts out by setting this setting to FALSE.
        // @see \Drupal\package_manager_bypass\NoOpStager::setLockFileShouldChange()
        if (Settings::get('package_manager_bypass_composer_stager', TRUE)) {
            $container->register(NoOpStager::class)
                ->setClass(NoOpStager::class)
                ->setPublic(FALSE)
                ->setAutowired(TRUE)
                ->setDecoratedService(StagerInterface::class);
        }
        $container->getDefinition(PathLocator::class)
            ->setClass(MockPathLocator::class)
            ->setAutowired(FALSE)
            ->setArguments([
            new Reference('state'),
            new Parameter('app.root'),
            new Reference('config.factory'),
            new Reference('file_system'),
        ]);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
PackageManagerBypassServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.