| @@ 34-48 (lines=15) @@ | ||
| 31 | 'subject_resolver' => $resolverIds, |
|
| 32 | ] as $key => $serviceIds) { |
|
| 33 | $humanKey = str_replace('_', ' ', $key); |
|
| 34 | foreach ($serviceIds as $serviceId => $attributes) { |
|
| 35 | $attributes = $attributes[0]; |
|
| 36 | ||
| 37 | if (!isset($attributes['alias'])) { |
|
| 38 | throw new \InvalidArgumentException(sprintf( |
|
| 39 | 'Description %s "%s" has no "alias" attribute in its tag', |
|
| 40 | $humanKey, |
|
| 41 | $serviceId |
|
| 42 | )); |
|
| 43 | } |
|
| 44 | ||
| 45 | $alias = $attributes['alias']; |
|
| 46 | ||
| 47 | $refs[$key][$alias] = new Reference($serviceId); |
|
| 48 | } |
|
| 49 | ||
| 50 | $enabled = $container->getParameter(sprintf('psi_description.%ss', $key)); |
|
| 51 | $diff = array_diff($enabled, array_keys($refs[$key])); |
|
| @@ 21-34 (lines=14) @@ | ||
| 18 | $extensionIds = $container->findTaggedServiceIds('psi_description.schema_extension'); |
|
| 19 | ||
| 20 | $extensionRefs = []; |
|
| 21 | foreach ($extensionIds as $extensionId => $attributes) { |
|
| 22 | $attributes = $attributes[0]; |
|
| 23 | ||
| 24 | if (!isset($attributes['alias'])) { |
|
| 25 | throw new \InvalidArgumentException(sprintf( |
|
| 26 | 'Description schema extension "%s" has no "alias" attribute in its tag', |
|
| 27 | $extensionId |
|
| 28 | )); |
|
| 29 | } |
|
| 30 | ||
| 31 | $alias = $attributes['alias']; |
|
| 32 | ||
| 33 | $extensionRefs[$alias] = new Reference($extensionId); |
|
| 34 | } |
|
| 35 | ||
| 36 | $enabledEnhancers = $container->getParameter('psi_description.schema.extensions'); |
|
| 37 | $diff = array_diff($enabledEnhancers, array_keys($extensionRefs)); |
|