| 1 | <?php |
||
| 20 | trait StaticInstanceTrait |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var static[] static instances in format: `[className => object]` |
||
| 24 | */ |
||
| 25 | private static $_instances = []; |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * Returns static class instance, which can be used to obtain meta information. |
||
| 30 | * @param bool $refresh whether to re-create static instance even, if it is already cached. |
||
| 31 | * @return static class instance. |
||
| 32 | */ |
||
| 33 | 67 | public static function instance($refresh = false) |
|
| 41 | } |