1 | <?php |
||
33 | class Cache |
||
34 | { |
||
35 | /** |
||
36 | * All of the active cache storages. |
||
37 | * |
||
38 | * @var \Pimf\Cache\Storages\Storage[] |
||
39 | */ |
||
40 | public static $storages = array(); |
||
41 | |||
42 | /** |
||
43 | * Get a cache storage instance. |
||
44 | * |
||
45 | * @param string $storage |
||
46 | * |
||
47 | * @return CS\Apc|CS\Dba|CS\File|CS\Memcached|CS\Memory|CS\Pdo|CS\Redis|CS\WinCache |
||
48 | */ |
||
49 | public static function storage($storage = null) |
||
61 | |||
62 | /** |
||
63 | * Create a new cache storage instance. |
||
64 | * |
||
65 | * @param string $storage |
||
66 | * |
||
67 | * @return CS\Apc|CS\Dba|CS\File|CS\Memcached|CS\Memory|CS\Pdo|CS\Redis|CS\WinCache |
||
68 | * @throws \RuntimeException |
||
69 | */ |
||
70 | protected static function factory($storage) |
||
103 | |||
104 | /** |
||
105 | * Magic Method for calling the methods on the default cache storage. |
||
106 | * |
||
107 | * @param $method |
||
108 | * @param $parameters |
||
109 | * |
||
110 | * @return mixed |
||
111 | */ |
||
112 | public static function __callStatic($method, $parameters) |
||
118 | } |
||
119 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: