Skip to content

Commit df23967

Browse files
committed
Validate tag attributes.
1 parent 4b15fc4 commit df23967

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/ExtenderManager.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,26 @@ public function addServicesFile($servicesFile)
7070
$servicesData = $this->parseData($servicesFile);
7171
if ($this->isValidServicesData($servicesData)) {
7272
foreach ($servicesData['services'] as $key => $definition) {
73-
7473
if (!array_key_exists('tags', $definition)) {
7574
continue;
7675
}
77-
7876
$bootstrap = 'install';
79-
8077
foreach ($definition['tags'] as $tags) {
8178
if (!array_key_exists('name', $tags)) {
79+
$bootstrap = null;
80+
continue;
81+
}
82+
if ($tags['name'] != 'drupal.command') {
83+
$bootstrap = null;
8284
continue;
8385
}
84-
8586
if (array_key_exists('bootstrap', $tags)) {
8687
$bootstrap = $tags['bootstrap'];
8788
}
8889
}
89-
90-
$this->servicesData[$bootstrap]['services'][$key] = $definition;
90+
if ($bootstrap) {
91+
$this->servicesData[$bootstrap]['services'][$key] = $definition;
92+
}
9193
}
9294
}
9395
}

0 commit comments

Comments
 (0)