ContainerRebuildTestServiceProvider.php

Same filename in other branches
  1. 9 core/modules/system/tests/modules/container_rebuild_test/src/ContainerRebuildTestServiceProvider.php
  2. 10 core/modules/system/tests/modules/container_rebuild_test/src/ContainerRebuildTestServiceProvider.php

Namespace

Drupal\container_rebuild_test

File

core/modules/system/tests/modules/container_rebuild_test/src/ContainerRebuildTestServiceProvider.php

View source
<?php

declare (strict_types=1);
namespace Drupal\container_rebuild_test;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
class ContainerRebuildTestServiceProvider implements ServiceModifierInterface {
    
    /**
     * {@inheritdoc}
     */
    public function alter(ContainerBuilder $container) {
        $count = $container->get('state')
            ->get('container_rebuild_test.count', 0);
        $container->get('state')
            ->set('container_rebuild_test.count', ++$count);
    }

}

Classes

Title Deprecated Summary
ContainerRebuildTestServiceProvider

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