1 | <?php |
||
5 | class FileCache extends MemoryCache implements CacheInterface |
||
6 | { |
||
7 | |||
8 | protected $file; |
||
9 | |||
10 | |||
11 | 4 | public function __construct($file) |
|
19 | |||
20 | |||
21 | /** |
||
22 | * Retrieve the nodes under the given key. |
||
23 | * |
||
24 | * @param string $key |
||
25 | * |
||
26 | * @return string[] |
||
27 | */ |
||
28 | 2 | public function get($key) |
|
33 | |||
34 | |||
35 | /** |
||
36 | * Cache the given Nodes. |
||
37 | * |
||
38 | * @param string $key |
||
39 | * @param string[] $nodes |
||
40 | * @param int $ttl TTL in seconds |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | 3 | public function set($key, array $nodes, $ttl) |
|
51 | |||
52 | |||
53 | /** |
||
54 | * Read cache from disk. |
||
55 | */ |
||
56 | 3 | private function read() |
|
65 | |||
66 | |||
67 | /** |
||
68 | * Close file handle. |
||
69 | */ |
||
70 | 3 | public function __destruct() |
|
76 | |||
77 | |||
78 | /** |
||
79 | * Write cache to disk. |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | 3 | private function write() |
|
94 | |||
95 | } |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.