1 | <?php |
||
22 | class Flash |
||
23 | { |
||
24 | /** |
||
25 | * Base instance of Flash engine. |
||
26 | * |
||
27 | * @var Engine |
||
28 | */ |
||
29 | private static $engine; |
||
30 | |||
31 | // Don't allow instantiation |
||
32 | private final function __clone() { } |
||
33 | |||
34 | 3 | public final function __sleep() |
|
38 | |||
39 | /** |
||
40 | * Creates flash container from session. |
||
41 | * |
||
42 | * @param TemplateInterface|null $template |
||
43 | */ |
||
44 | 84 | public function __construct(TemplateInterface $template = null) |
|
54 | |||
55 | /** |
||
56 | * Invoke Engine methods. |
||
57 | * |
||
58 | * @param string $method - method to invoke |
||
59 | * @param array $arguments - arguments for method |
||
60 | * |
||
61 | * @return mixed |
||
62 | */ |
||
63 | 78 | protected static function invoke($method, array $arguments) |
|
72 | |||
73 | /** |
||
74 | * Magic methods for static calls. |
||
75 | * |
||
76 | * @param string $method - method to invoke |
||
77 | * @param array $arguments - arguments for method |
||
78 | * |
||
79 | * @return mixed |
||
80 | */ |
||
81 | 6 | public static function __callStatic($method, array $arguments) |
|
87 | |||
88 | /** |
||
89 | * Magic methods for instances calls. |
||
90 | * |
||
91 | * @param string $method - method to invoke |
||
92 | * @param array $arguments - arguments for method |
||
93 | * |
||
94 | * @return mixed |
||
95 | */ |
||
96 | 72 | public function __call($method, array $arguments) |
|
100 | |||
101 | /** |
||
102 | * Mimic object __toString method. |
||
103 | * |
||
104 | * @return string - HTML with flash messages |
||
105 | */ |
||
106 | 6 | public function __toString() |
|
110 | } |
||
111 |