1 | <?php |
||
11 | final class Instance implements DependencyInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var mixed |
||
15 | */ |
||
16 | public $value; |
||
17 | |||
18 | 81 | public function __construct($value) |
|
22 | |||
23 | 1 | public function __toString() |
|
24 | { |
||
25 | 1 | if (is_scalar($this->value)) { |
|
26 | 1 | return sprintf( |
|
27 | 1 | '(%s) %s', |
|
28 | 1 | gettype($this->value), |
|
29 | 1 | (string) $this->value |
|
30 | ); |
||
31 | } |
||
32 | |||
33 | 1 | if (is_object($this->value)) { |
|
34 | 1 | return '(object) ' . get_class($this->value); |
|
35 | } |
||
36 | |||
37 | 1 | return '(' . gettype($this->value) . ')'; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 81 | public function register(array &$container, Bind $bind) |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 30 | public function inject(Container $container) |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | * |
||
62 | * @codeCoverageIgnore |
||
63 | */ |
||
64 | public function setScope($scope) |
||
67 | } |
||
68 |