diff --git a/core/lib/Drupal/Component/DependencyInjection/Container.php b/core/lib/Drupal/Component/DependencyInjection/Container.php index 06d1a70..3e4e407 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Container.php +++ b/core/lib/Drupal/Component/DependencyInjection/Container.php @@ -354,7 +354,7 @@ protected function createService(array $definition, $id) { /** * {@inheritdoc} */ - public function set($id, $service, $scope = self::SCOPE_CONTAINER) { + public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) { $this->services[$id] = $service; } @@ -410,9 +410,9 @@ public function initialized($id) { } /** - * Resolves arguments from \stdClass objects to the real values. + * Resolves arguments from an object or array of objects to the real values. * - * @param array|\stdClass $arguments + * @param \stdClass[]|\stdClass $arguments * The arguments to resolve. * * @return array diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php index 6aed08f..acaf796 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -7,7 +7,6 @@ namespace Drupal\Component\DependencyInjection\Dumper; -use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Parameter; @@ -70,7 +69,7 @@ public function getArray() { $definition['parameters'] = $this->getParameters(); $definition['services'] = $this->getServiceDefinitions(); $definition['frozen'] = $this->container->isFrozen(); - $definition['machine_format'] = $this->getMachineFormat(); + $definition['machine_format'] = $this->supportsMachineFormat(); return $definition; } @@ -516,7 +515,7 @@ protected function getExpressionCall($expression) { * @return bool * TRUE if this supports machine-optimized format, FALSE otherwise. */ - protected function getMachineFormat() { + protected function supportsMachineFormat() { return TRUE; } diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php index 2f2f517..4932dd7 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/PhpArrayDumper.php @@ -70,7 +70,7 @@ protected function getParameterCall($name) { /** * {@inheritdoc} */ - protected function getMachineFormat() { + protected function supportsMachineFormat() { return FALSE; } diff --git a/core/lib/Drupal/Component/DependencyInjection/composer.json b/core/lib/Drupal/Component/DependencyInjection/composer.json new file mode 100644 index 0000000..7e5e666 --- /dev/null +++ b/core/lib/Drupal/Component/DependencyInjection/composer.json @@ -0,0 +1,18 @@ +{ + "name": "drupal/core-dependency-injection", + "description": "Dependency Injection container optimized for Drupal's needs.", + "keywords": ["drupal", "dependency injection"], + "type": "library", + "homepage": "https://www.drupal.org/project/drupal", + "license": "GPL-2.0+", + "support": { + "issues": "https://www.drupal.org/project/issues/drupal", + "irc": "irc://irc.freenode.net/drupal-contribute", + "source": "https://www.drupal.org/project/drupal/git-instructions" + }, + "autoload": { + "psr-4": { + "Drupal\\Component\\DependencyInjection\\": "" + } + } +} diff --git a/core/modules/update/src/Tests/UpdateTestBase.php b/core/modules/update/src/Tests/UpdateTestBase.php index faec496..33ee105 100644 --- a/core/modules/update/src/Tests/UpdateTestBase.php +++ b/core/modules/update/src/Tests/UpdateTestBase.php @@ -35,7 +35,7 @@ protected function setUp() { // Change the root path which Update Manager uses to install and update // projects to be inside the testing site directory. See - // \Drupal\update\UpdateRootFactory::get() for equivalent changes to the + // \Drupal\updateUpdateRootFactory::get() for equivalent changes to the // test child site. $request = \Drupal::request(); $update_root = $this->container->get('update.root') . '/' . DrupalKernel::findSitePath($request); diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php index 3802e84..fff8364 100644 --- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php +++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php @@ -882,6 +882,9 @@ protected function getMockContainerDefinition() { $services['synthetic'] = array( 'synthetic' => TRUE, ); + // The file could have been named as a .php file. The reason it is a .data + // file is that SimpleTest tries to load it. SimpleTest does not like such + // fixtures and hence we use a neutral name like .data. $services['container_test_file_service_test'] = array( 'class' => '\stdClass', 'file' => __DIR__ . '/Fixture/container_test_file_service_test_service_function.data', diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php index 72af63e..b315403 100644 --- a/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php +++ b/core/tests/Drupal/Tests/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumperTest.php @@ -63,7 +63,7 @@ public function setUp() { * * @covers ::dump * @covers ::getArray - * @covers ::getMachineFormat + * @covers ::supportsMachineFormat */ public function testDumpForEmptyContainer() { $serialized_definition = $this->dumper->dump();