1 | <?php |
||
7 | class SingleLocalFile implements Adapter |
||
8 | { |
||
9 | private |
||
10 | $filename, |
||
|
|||
11 | $adapter; |
||
12 | |||
13 | public function __construct($filename, Adapter $adapter) |
||
18 | |||
19 | public function read($key) |
||
28 | |||
29 | public function write($key, $content) |
||
33 | |||
34 | public function exists($key) |
||
38 | |||
39 | public function keys() |
||
43 | |||
44 | public function mtime($key) |
||
53 | |||
54 | public function delete($key) |
||
58 | |||
59 | public function rename($sourceKey, $targetKey) |
||
63 | |||
64 | public function isDirectory($key) |
||
68 | } |
||
69 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.