Skip to content

Commit

Permalink
Validate tag attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Feb 14, 2017
1 parent 4b15fc4 commit df23967
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ExtenderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,26 @@ public function addServicesFile($servicesFile)
$servicesData = $this->parseData($servicesFile);
if ($this->isValidServicesData($servicesData)) {
foreach ($servicesData['services'] as $key => $definition) {

if (!array_key_exists('tags', $definition)) {
continue;
}

$bootstrap = 'install';

foreach ($definition['tags'] as $tags) {
if (!array_key_exists('name', $tags)) {
$bootstrap = null;
continue;
}
if ($tags['name'] != 'drupal.command') {
$bootstrap = null;
continue;
}

if (array_key_exists('bootstrap', $tags)) {
$bootstrap = $tags['bootstrap'];
}
}

$this->servicesData[$bootstrap]['services'][$key] = $definition;
if ($bootstrap) {
$this->servicesData[$bootstrap]['services'][$key] = $definition;
}
}
}
}
Expand Down

0 comments on commit df23967

Please sign in to comment.