| Total Complexity | 8 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class Instance implements DependencyInterface, AcceptInterface |
||
| 14 | { |
||
| 15 | /** @var mixed */ |
||
| 16 | public $value; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param mixed $value |
||
| 20 | */ |
||
| 21 | public function __construct($value) |
||
| 24 | } |
||
| 25 | |||
| 26 | public function __toString(): string |
||
| 27 | { |
||
| 28 | if (is_scalar($this->value)) { |
||
| 29 | return sprintf( |
||
| 30 | '(%s) %s', |
||
| 31 | gettype($this->value), |
||
| 32 | (string) $this->value |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | if (is_object($this->value)) { |
||
| 37 | return '(object) ' . get_class($this->value); |
||
| 38 | } |
||
| 39 | |||
| 40 | return '(' . gettype($this->value) . ')'; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | public function register(array &$container, Bind $bind): void |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function inject(Container $container) |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * {@inheritdoc} |
||
| 62 | * |
||
| 63 | * @codeCoverageIgnore |
||
| 64 | */ |
||
| 65 | public function setScope($scope): void |
||
| 67 | } |
||
| 68 | |||
| 69 | /** @inheritDoc */ |
||
| 70 | public function accept(VisitorInterface $visitor) |
||
| 75 |