1 | <?php |
||
10 | class Application |
||
11 | { |
||
12 | /** @var Registry $registry */ |
||
13 | private $registry; |
||
14 | |||
15 | /** @var Container $registry */ |
||
16 | private $treasureChest; |
||
17 | |||
18 | /** @var string $configFolder */ |
||
19 | private $configFolder = 'config'; |
||
20 | |||
21 | /** @var string $environment */ |
||
22 | private $environment = 'production'; |
||
23 | |||
24 | /** |
||
25 | * There be nay feckin wi' constructors on board this ship |
||
26 | * There be nay copyin' o' th'ship either |
||
27 | * This ship is a singleton! |
||
28 | */ |
||
29 | public function __construct(){} |
||
31 | |||
32 | |||
33 | /** |
||
34 | * Ahoy! There nay be boardin without yer configuration |
||
35 | * |
||
36 | * @param array $config |
||
37 | * @return Application |
||
38 | */ |
||
39 | 2 | public static function ahoy(array $config = []) |
|
51 | |||
52 | /** |
||
53 | * @param string $environment |
||
54 | */ |
||
55 | public function setApplicationEnv(string $environment) |
||
59 | |||
60 | /** |
||
61 | * @param array $config |
||
62 | */ |
||
63 | 1 | private function setConfig(array $config) |
|
71 | |||
72 | /** |
||
73 | * T' the high seas! Garrr! |
||
74 | * |
||
75 | * @throws \Exception |
||
76 | */ |
||
77 | 1 | public function setSail() |
|
89 | |||
90 | /** |
||
91 | * @return Container |
||
92 | */ |
||
93 | public function getContainer(): Container |
||
97 | |||
98 | /** |
||
99 | * @param string $configFolder |
||
100 | */ |
||
101 | public function setConfigFolder(string $configFolder) |
||
105 | |||
106 | /** |
||
107 | * @param string $environment |
||
108 | */ |
||
109 | public function setEnvironment(string $environment) |
||
113 | } |