1 | <?php |
||
19 | class Request extends \yii\console\Request |
||
20 | { |
||
21 | /** |
||
22 | * @var name of script called, like $0 in sh/perl |
||
23 | */ |
||
24 | protected $_self; |
||
25 | |||
26 | protected $_args; |
||
27 | |||
28 | /** |
||
29 | * Returns the command line arguments. |
||
30 | * |
||
31 | * @return array the command line arguments. It does not include the entry script name |
||
32 | */ |
||
33 | 3 | public function getParams() |
|
54 | |||
55 | 3 | public function setParams($params) |
|
60 | } |
||
61 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: