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
ServiceClosureArgument.php
25 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 | class ServiceClosureArgument implements ArgumentInterface |
| 7 | { |
| 8 | private $values; |
| 9 | public function __construct(Reference $reference) |
| 10 | { |
| 11 | $this->values = [$reference]; |
| 12 | } |
| 13 | public function getValues() |
| 14 | { |
| 15 | return $this->values; |
| 16 | } |
| 17 | public function setValues(array $values) |
| 18 | { |
| 19 | if ([0] !== \array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) { |
| 20 | throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.'); |
| 21 | } |
| 22 | $this->values = $values; |
| 23 | } |
| 24 | } |
| 25 |