1 | <?php |
||
20 | class Request extends \yii\console\Request |
||
21 | { |
||
22 | /** |
||
23 | * @var name of script called, like $0 in sh/perl |
||
24 | */ |
||
25 | protected $_self; |
||
26 | |||
27 | protected $_args; |
||
28 | |||
29 | /** |
||
30 | * Returns the command line arguments. |
||
31 | * |
||
32 | * @return array the command line arguments. It does not include the entry script name |
||
33 | */ |
||
34 | 3 | public function getParams() |
|
55 | |||
56 | 3 | public function setParams($params) |
|
61 | } |
||
62 |
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: