1 | <?php |
||
7 | abstract class Handler |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $path; |
||
13 | |||
14 | /** |
||
15 | * @var FilesystemInterface |
||
16 | */ |
||
17 | protected $filesystem; |
||
18 | |||
19 | /** |
||
20 | * Constructor. |
||
21 | * |
||
22 | * @param FilesystemInterface $filesystem |
||
23 | * @param string $path |
||
24 | */ |
||
25 | 117 | public function __construct(FilesystemInterface $filesystem = null, $path = null) |
|
30 | |||
31 | /** |
||
32 | * Check whether the entree is a directory. |
||
33 | * |
||
34 | * @return bool |
||
35 | */ |
||
36 | 3 | public function isDir() |
|
40 | |||
41 | /** |
||
42 | * Check whether the entree is a file. |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | 3 | public function isFile() |
|
50 | |||
51 | /** |
||
52 | * Retrieve the entree type (file|dir). |
||
53 | * |
||
54 | * @return string file or dir |
||
55 | */ |
||
56 | 6 | public function getType() |
|
62 | |||
63 | /** |
||
64 | * Set the Filesystem object. |
||
65 | * |
||
66 | * @param FilesystemInterface $filesystem |
||
67 | * |
||
68 | * @return $this |
||
69 | */ |
||
70 | 114 | public function setFilesystem(FilesystemInterface $filesystem) |
|
76 | |||
77 | /** |
||
78 | * Retrieve the Filesystem object. |
||
79 | * |
||
80 | * @return FilesystemInterface |
||
81 | */ |
||
82 | 3 | public function getFilesystem() |
|
86 | |||
87 | /** |
||
88 | * Set the entree path. |
||
89 | * |
||
90 | * @param string $path |
||
91 | * |
||
92 | * @return $this |
||
93 | */ |
||
94 | 75 | public function setPath($path) |
|
100 | |||
101 | /** |
||
102 | * Retrieve the entree path. |
||
103 | * |
||
104 | * @return string path |
||
105 | */ |
||
106 | 27 | public function getPath() |
|
110 | |||
111 | /** |
||
112 | * Plugins pass-through. |
||
113 | * |
||
114 | * @param string $method |
||
115 | * @param array $arguments |
||
116 | * |
||
117 | * @return mixed |
||
118 | */ |
||
119 | 6 | public function __call($method, array $arguments) |
|
134 | } |
||
135 |