1 | <?php |
||
12 | class Manager implements Logger\LoggerInterface |
||
13 | { |
||
14 | use Logger\LoggerTrait; |
||
15 | use Config\RequiredTrait; |
||
16 | |||
17 | const DEFAULT_NAME = 'DEFAULT_NAME'; |
||
18 | private static $instance = null; |
||
19 | private $instances = array(); |
||
20 | |||
21 | 1 | private function __construct() |
|
24 | |||
25 | /** |
||
26 | * @codeCoverageIgnore |
||
27 | */ |
||
28 | private function __clone() |
||
31 | |||
32 | /** |
||
33 | * @param string $name |
||
34 | * @return Db |
||
35 | * @throws \InvalidArgumentException |
||
36 | * @throws \OutOfRangeException |
||
37 | */ |
||
38 | 5 | public function get($name = self::DEFAULT_NAME) |
|
64 | |||
65 | /** |
||
66 | * Close or change a connection by its name |
||
67 | * @param string $name |
||
68 | * @param Db|null $db |
||
69 | * @return $this |
||
70 | */ |
||
71 | 1 | public function set($name = self::DEFAULT_NAME, Db $db = null) |
|
76 | |||
77 | /** |
||
78 | * @return $this |
||
79 | */ |
||
80 | 3 | final public static function getInstance() |
|
88 | } |
||
89 |