Total Complexity | 5 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
16 | abstract class AbstractSingleton implements SingleInstancing |
||
17 | { |
||
18 | /** |
||
19 | * Locks the creation of new objects but allows static creation and extending. |
||
20 | */ |
||
21 | 6 | protected function __construct() |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * Lock the reinitialization and unserialization abilities of the class. |
||
29 | */ |
||
30 | 6 | public function __wakeup() |
|
31 | { |
||
32 | /* This must remain empty. */ |
||
33 | 6 | return null; |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * Lock the serialization abilities of the class. |
||
38 | */ |
||
39 | 6 | public function __sleep() |
|
40 | { |
||
41 | /* This must remain empty. */ |
||
42 | 6 | return null; |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * Lock the ability to clone properties and create a new dynamic instance of the class. |
||
47 | */ |
||
48 | 6 | private function __clone() |
|
49 | { |
||
50 | /* This must remain empty. */ |
||
51 | 6 | return null; |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * Return the name of the current defined class that extends the class. |
||
56 | * |
||
57 | * @return string Name of the class. |
||
58 | */ |
||
59 | 6 | public function __toString() |
|
62 | } |
||
63 | } |
||
64 |