Skip to content

Commit

Permalink
Merge 5579844 into 64022a7
Browse files Browse the repository at this point in the history
  • Loading branch information
LionsAd committed Dec 14, 2015
2 parents 64022a7 + 5579844 commit 73e2d51
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 804 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ env:

# Drupal specific vars.
- DRUPAL_TI_MODULE_NAME="service_container"

# Define runners and environment vars to include before and after the
# main runners / environment vars.
- DRUPAL_TI_SCRIPT_DIR_BEFORE=".drupal_ti_before"

- DRUPAL_TI_DB="drupal_travis_db"
- DRUPAL_TI_DB_URL="mysql://root:@127.0.0.1/drupal_travis_db"
# Note: Do not add a trailing slash here.
Expand Down
3 changes: 3 additions & 0 deletions HACK.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## List of classes that we've altered ##
- DependencyInjection:
- Drupal\Component\DependencyInjection\Container
- Drupal\Component\DependencyInjection\PhpArrayContainer
- Database:
- Drupal\Core\Database\Connection
- Drupal\Core\Database\Database
Expand Down
2 changes: 1 addition & 1 deletion lib/Drupal/Component/DependencyInjection/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER)
* {@inheritdoc}
*/
public function has($id) {
return isset($this->services[$id]) || isset($this->serviceDefinitions[$id]);
return isset($this->aliases[$id]) || isset($this->services[$id]) || isset($this->serviceDefinitions[$id]) || array_key_exists($id, $this->services);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ protected function dumpMethodCalls(array $calls) {
$arguments = $this->dumpCollection($call[1]);
}

$code[$key] = [$method, $arguments];
$code[$key] = array($method, $arguments);
}

return $code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ protected function resolveServicesAndParameters($arguments) {
}

// Resolve parameters.
if ($argument[0] === '%') {
if (isset($argument[0]) && $argument[0] === '%') {
$name = substr($argument, 1, -1);
if (!isset($this->parameters[$name])) {
$arguments[$key] = $this->getParameter($name);
Expand All @@ -254,7 +254,7 @@ protected function resolveServicesAndParameters($arguments) {
}

// Resolve services.
if ($argument[0] === '@') {
if (isset($argument[0]) && $argument[0] === '@') {
$id = substr($argument, 1);
$invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
if ($id[0] === '?') {
Expand Down
Loading

0 comments on commit 73e2d51

Please sign in to comment.