1 | <?php |
||
40 | class Config extends ContainerConfig |
||
41 | { |
||
42 | const GLOBALS = 'GLOBALS'; |
||
43 | |||
44 | const FACTORY = 'aura/cli:factory'; |
||
45 | const CONTEXT = 'aura/cli:context'; |
||
46 | const STDIO = 'aura/cli:stdio'; |
||
47 | |||
48 | /** |
||
49 | * Globals |
||
50 | * |
||
51 | * @var array |
||
52 | * |
||
53 | * @access protected |
||
54 | */ |
||
55 | protected $globals; |
||
56 | |||
57 | /** |
||
58 | * __construct |
||
59 | * |
||
60 | * @param array $globals GLOBALS array |
||
61 | * |
||
62 | * @access public |
||
63 | */ |
||
64 | 4 | public function __construct(array $globals = null) |
|
68 | |||
69 | /** |
||
70 | * Define Aura\Cli factories, services, and params |
||
71 | * |
||
72 | * @param Container $di DI Container |
||
73 | * |
||
74 | * @return void |
||
75 | * |
||
76 | * @access public |
||
77 | * |
||
78 | * @SuppressWarnings(PHPMD.ShortVariable) |
||
79 | */ |
||
80 | 4 | public function define(Container $di) |
|
105 | } |
||
106 |
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: