1 | <?php |
||
46 | class ArrayDefinition extends AbstractDefinition implements Invokable |
||
47 | { |
||
48 | /** |
||
49 | * The array |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $array; |
||
53 | |||
54 | /** |
||
55 | * Constructor |
||
56 | * |
||
57 | * @param array<mixed> $array The PHP array |
||
58 | * @param array<mixed> $arguments List of arguments |
||
59 | * |
||
60 | * @return void |
||
|
|||
61 | */ |
||
62 | 6 | public function __construct($array, array $arguments = array()) |
|
67 | |||
68 | /** |
||
69 | * Calls $this->callable and return its value |
||
70 | * |
||
71 | * @param Container $container The Di Container |
||
72 | * @param null|string $name Name of the definition (if any) |
||
73 | * |
||
74 | * @return array<mixed> |
||
75 | */ |
||
76 | 2 | public function invoke(Container $container, $name = null) |
|
80 | |||
81 | /** |
||
82 | * Returns the array |
||
83 | * |
||
84 | * @return array<mixed> |
||
85 | */ |
||
86 | 1 | public function getArray() |
|
90 | |||
91 | /** |
||
92 | * Defines the array |
||
93 | * |
||
94 | * @param array<mixed> $array The callable function |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | 1 | public function setArray(array $array) |
|
102 | } |
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.