mailpoet
/
vendor-prefixed
/
symfony
/
dependency-injection
/
Argument
/
ReferenceSetArgumentTrait.php
AbstractArgument.php
4 years ago
ArgumentInterface.php
4 years ago
BoundArgument.php
2 years ago
IteratorArgument.php
4 years ago
ReferenceSetArgumentTrait.php
4 years ago
RewindableGenerator.php
4 years ago
ServiceClosureArgument.php
4 years ago
ServiceLocator.php
2 years ago
ServiceLocatorArgument.php
4 years ago
TaggedIteratorArgument.php
2 years ago
index.php
3 years ago
ReferenceSetArgumentTrait.php
27 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\DependencyInjection\Argument; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; |
| 5 | use MailPoetVendor\Symfony\Component\DependencyInjection\Reference; |
| 6 | trait ReferenceSetArgumentTrait |
| 7 | { |
| 8 | private $values; |
| 9 | public function __construct(array $values) |
| 10 | { |
| 11 | $this->setValues($values); |
| 12 | } |
| 13 | public function getValues() |
| 14 | { |
| 15 | return $this->values; |
| 16 | } |
| 17 | public function setValues(array $values) |
| 18 | { |
| 19 | foreach ($values as $k => $v) { |
| 20 | if (null !== $v && !$v instanceof Reference) { |
| 21 | throw new InvalidArgumentException(\sprintf('A "%s" must hold only Reference instances, "%s" given.', __CLASS__, \get_debug_type($v))); |
| 22 | } |
| 23 | } |
| 24 | $this->values = $values; |
| 25 | } |
| 26 | } |
| 27 |