PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.0-beta1
Elementor Website Builder – more than just a page builder v3.30.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / vendor_prefixed / dependency-injection / php-di / php-di / src / Definition / ArrayDefinitionExtension.php

ArrayDefinitionExtension.php in Elementor Website Builder – more than just a page builder 3.30.0-beta1, at vendor_prefixed/dependency-injection/php-di/php-di/src/Definition/ArrayDefinitionExtension.php

34 lines 1007 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace ElementorDeps\DI\Definition;
5
6 use ElementorDeps\DI\Definition\Exception\InvalidDefinition;
7 /**
8 * Extends an array definition by adding new elements into it.
9 *
10 * @since 5.0
11 * @author Matthieu Napoli <[email protected]>
12 */
13 class ArrayDefinitionExtension extends ArrayDefinition implements ExtendsPreviousDefinition
14 {
15 /**
16 * @var ArrayDefinition
17 */
18 private $subDefinition;
19 public function getValues() : array
20 {
21 if (!$this->subDefinition) {
22 return parent::getValues();
23 }
24 return \array_merge($this->subDefinition->getValues(), parent::getValues());
25 }
26 public function setExtendedDefinition(Definition $definition)
27 {
28 if (!$definition instanceof ArrayDefinition) {
29 throw new InvalidDefinition(\sprintf('Definition %s tries to add array entries but the previous definition is not an array', $this->getName()));
30 }
31 $this->subDefinition = $definition;
32 }
33 }
34