1 | <?php |
||
49 | class ScalarDefinition extends AbstractDefinition implements DefinitionInterface |
||
50 | { |
||
51 | /** |
||
52 | * The value |
||
53 | * @var mixed |
||
54 | */ |
||
55 | protected $value; |
||
56 | |||
57 | /** |
||
58 | * Constructor |
||
59 | * |
||
60 | * @param mixed $value The scalar value |
||
61 | * |
||
62 | * @return void |
||
|
|||
63 | */ |
||
64 | 39 | public function __construct($value) |
|
68 | |||
69 | /** |
||
70 | * Calls $this->callable and return its value |
||
71 | * |
||
72 | * @param Container $container The Di Container |
||
73 | * @param null|string $name Name of the definition (if any) |
||
74 | * |
||
75 | * @return array<mixed> |
||
76 | */ |
||
77 | 6 | public function invoke(Container $container, $name = null) |
|
81 | |||
82 | /** |
||
83 | * Returns the value |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | public function getValue() |
||
91 | |||
92 | /** |
||
93 | * Defines the array |
||
94 | * |
||
95 | * @param mixed $value The scalar-typed value |
||
96 | * |
||
97 | * @return void |
||
98 | */ |
||
99 | public function setValue($value) |
||
103 | |||
104 | /** |
||
105 | * Factory |
||
106 | * |
||
107 | * @param mixed $value The scalar-typed definition |
||
108 | * |
||
109 | * @return ScalarDefition |
||
110 | */ |
||
111 | 39 | public static function factory($value) |
|
115 | } |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.