This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
12
{
13
/** @var self|null */
14
private static $instance = null;
15
16
/** @var ContainerInterface */
17
private static $Container;
18
19
/** @var Logger */
20
private static $Logger;
21
22
/**
23
* @param ContainerInterface $container
24
*/
25
private function __construct(ContainerInterface $container, Logger $Logger)
26
{
27
self::$Container = $container;
28
self::$Logger = $Logger;
29
}
30
31
/**
32
* @param ContainerInterface $container
33
*
34
* @return null|LoggerFacade
35
*/
36
public static function init(ContainerInterface $container, Logger $Logger)
37
{
38
if (null === self::$instance) {
39
self::$instance = new self($container, $Logger);
40
}
41
42
return self::$instance;
43
}
44
45
/**
46
* @return Logger
47
* @throws \Exception
48
*/
49
public static function create()
50
{
51
if (null === self::$instance) {
52
throw new \Exception("Facade is not instantiated");