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
BoundArgument.php
39 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\DependencyInjection\Argument; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | final class BoundArgument implements ArgumentInterface |
| 5 | { |
| 6 | public const SERVICE_BINDING = 0; |
| 7 | public const DEFAULTS_BINDING = 1; |
| 8 | public const INSTANCEOF_BINDING = 2; |
| 9 | private static $sequence = 0; |
| 10 | private $value; |
| 11 | private $identifier; |
| 12 | private $used; |
| 13 | private $type; |
| 14 | private $file; |
| 15 | public function __construct($value, bool $trackUsage = \true, int $type = 0, ?string $file = null) |
| 16 | { |
| 17 | $this->value = $value; |
| 18 | if ($trackUsage) { |
| 19 | $this->identifier = ++self::$sequence; |
| 20 | } else { |
| 21 | $this->used = \true; |
| 22 | } |
| 23 | $this->type = $type; |
| 24 | $this->file = $file; |
| 25 | } |
| 26 | public function getValues() : array |
| 27 | { |
| 28 | return [$this->value, $this->identifier, $this->used, $this->type, $this->file]; |
| 29 | } |
| 30 | public function setValues(array $values) |
| 31 | { |
| 32 | if (5 === \count($values)) { |
| 33 | [$this->value, $this->identifier, $this->used, $this->type, $this->file] = $values; |
| 34 | } else { |
| 35 | [$this->value, $this->identifier, $this->used] = $values; |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 |