@@ -73,12 +73,11 @@ public function adapter()
7373 * if there are multiple matches and 'nothing' if no match found.
7474 *
7575 * @param string $pattern
76- * @param boolean $isAbsolute
7776 * @return string
7877 */
79- public function whatIs ($ pattern, $ isAbsolute = false )
78+ public function whatIs ($ pattern )
8079 {
81- if (! $ isAbsolute ) {
80+ if (! $ this -> adapter -> isAbsolute ( $ pattern ) ) {
8281 $ pattern = $ this ->rootPath . $ pattern ;
8382 }
8483
@@ -95,13 +94,12 @@ public function whatIs($pattern, $isAbsolute = false)
9594 * Checks if the given path is of the given type.
9695 *
9796 * @param string $path
98- * @param boolean $isAbsolute
9997 * @param string $type
10098 * @return boolean
10199 */
102- protected function is ($ path , $ isAbsolute , $ type )
100+ protected function is ($ path , $ type )
103101 {
104- if (! $ isAbsolute ) {
102+ if (! $ this -> adapter -> isAbsolute ( $ path ) ) {
105103 $ path = $ this ->rootPath . $ path ;
106104 }
107105 switch ($ type ) {
@@ -126,14 +124,13 @@ protected function is($path, $isAbsolute, $type)
126124 * Checks if the given paths are all of the given type.
127125 *
128126 * @param array $paths
129- * @param boolean $areAbsolute
130127 * @param string $type
131128 * @return boolean
132129 */
133- protected function are ($ paths , $ areAbsolute , $ type )
130+ protected function are ($ paths , $ type )
134131 {
135132 foreach ($ paths as $ path ) {
136- if (! $ this ->is ($ path , $ areAbsolute , $ type )) {
133+ if (! $ this ->is ($ path , $ type )) {
137134 return false ;
138135 }
139136 }
@@ -144,145 +141,133 @@ protected function are($paths, $areAbsolute, $type)
144141 * Checks if the given path is a file.
145142 *
146143 * @param string $path
147- * @param boolean $isAbsolute
148144 * @return boolean
149145 */
150- public function isFile ($ path, $ isAbsolute = false )
146+ public function isFile ($ path )
151147 {
152- return $ this ->is ($ path , $ isAbsolute , 'file ' );
148+ return $ this ->is ($ path , 'file ' );
153149 }
154150
155151 /**
156152 * Checks if all the given path are files.
157153 *
158154 * @param array $paths
159- * @param boolean $areAbsolute
160155 * @return boolean
161156 */
162- public function areFiles ($ paths, $ areAbsolute = false )
157+ public function areFiles ($ paths )
163158 {
164- return $ this ->are ($ paths , $ areAbsolute , 'file ' );
159+ return $ this ->are ($ paths , 'file ' );
165160 }
166161
167162 /**
168163 * Checks if the given path is a directory.
169164 *
170165 * @param string $path
171- * @param boolean $isAbsolute
172166 * @return boolean
173167 */
174- public function isDir ($ path, $ isAbsolute = false )
168+ public function isDir ($ path )
175169 {
176- return $ this ->is ($ path , $ isAbsolute , 'dir ' );
170+ return $ this ->is ($ path , 'dir ' );
177171 }
178172
179173 /**
180174 * Checks if all the given paths are directories.
181175 *
182176 * @param array $paths
183- * @param boolean $areAbsolute
184177 * @return boolean
185178 */
186- public function areDirs ($ paths, $ areAbsolute = false )
179+ public function areDirs ($ paths )
187180 {
188- return $ this ->are ($ paths , $ areAbsolute , 'dir ' );
181+ return $ this ->are ($ paths , 'dir ' );
189182 }
190183
191184 /**
192185 * Checks if the given path is a file or directory.
193186 *
194187 * @param string $path
195- * @param boolean $isAbsolute
196188 * @return boolean
197189 */
198- public function isAny ($ path, $ isAbsolute = false )
190+ public function isAny ($ path )
199191 {
200- return $ this ->is ($ path , $ isAbsolute , 'any ' );
192+ return $ this ->is ($ path , 'any ' );
201193 }
202194
203195 /**
204196 * Checks if all the given paths are files or directories.
205197 *
206198 * @param array $paths
207- * @param boolean $areAbsolute
208199 * @return boolean
209200 */
210- public function areAny ($ paths, $ areAbsolute = false )
201+ public function areAny ($ paths )
211202 {
212- return $ this ->are ($ paths , $ areAbsolute , 'any ' );
203+ return $ this ->are ($ paths , 'any ' );
213204 }
214205
215206 /**
216207 * Checks if the given path is readable.
217208 *
218209 * @param string $path
219- * @param boolean $isAbsolute
220210 * @return boolean
221211 */
222- public function isReadable ($ path, $ isAbsolute = false )
212+ public function isReadable ($ path )
223213 {
224- return $ this ->is ($ path , $ isAbsolute , 'readable ' );
214+ return $ this ->is ($ path , 'readable ' );
225215 }
226216
227217 /**
228218 * Checks if all the given paths are readable.
229219 *
230220 * @param string $paths
231- * @param boolean $areAbsolute
232221 * @return boolean
233222 */
234- public function areReadable ($ paths, $ areAbsolute = false )
223+ public function areReadable ($ paths )
235224 {
236- return $ this ->are ($ paths , $ areAbsolute , 'readable ' );
225+ return $ this ->are ($ paths , 'readable ' );
237226 }
238227
239228 /**
240229 * Checks if the given path is writable.
241230 *
242231 * @param string $path
243- * @param boolean $isAbsolute
244232 * @return boolean
245233 */
246- public function isWritable ($ path, $ isAbsolute = false )
234+ public function isWritable ($ path )
247235 {
248- return $ this ->is ($ path , $ isAbsolute , 'writable ' );
236+ return $ this ->is ($ path , 'writable ' );
249237 }
250238
251239 /**
252240 * Checks if all the given paths are writable.
253- return $this->are($paths, $areAbsolute, 'readable');
241+ return $this->are($paths, 'readable');
254242 *
255243 * @param string $paths
256- * @param boolean $areAbsolute
257244 * @return boolean
258245 */
259- public function areWritable ($ paths, $ areAbsolute = false )
246+ public function areWritable ($ paths )
260247 {
261- return $ this ->are ($ paths , $ areAbsolute , 'writable ' );
248+ return $ this ->are ($ paths , 'writable ' );
262249 }
263250
264251 /**
265252 * Checks if the given path is executable.
266253 *
267254 * @param string $path
268- * @param boolean $isAbsolute
269255 * @return boolean
270256 */
271- public function isExecutable ($ path, $ isAbsolute = false )
257+ public function isExecutable ($ path )
272258 {
273- return $ this ->is ($ path , $ isAbsolute , 'executable ' );
259+ return $ this ->is ($ path , 'executable ' );
274260 }
275261
276262 /**
277263 * Checks if all the given paths are executable.
278264 *
279265 * @param string $paths
280- * @param boolean $areAbsolute
281266 * @return boolean
282267 */
283- public function areExecutable ($ paths, $ areAbsolute = false )
268+ public function areExecutable ($ paths )
284269 {
285- return $ this ->are ($ paths , $ areAbsolute , 'executable ' );
270+ return $ this ->are ($ paths , 'executable ' );
286271 }
287272
288273 /**
@@ -291,14 +276,13 @@ public function areExecutable($paths, $areAbsolute = false)
291276 *
292277 * @param string $path
293278 * @param boolean $createMissing
294- * @param boolean $isAbsolute
295279 * @return Tarsana\IO\Filesystem\File
296280 *
297281 * @throws Tarsana\IO\Exceptions\FilesystemException
298282 */
299- public function file ($ path , $ createMissing = false , $ isAbsolute = false )
283+ public function file ($ path , $ createMissing = false )
300284 {
301- if (! $ isAbsolute ) {
285+ if (! $ this -> adapter -> isAbsolute ( $ path ) ) {
302286 $ path = $ this ->rootPath . $ path ;
303287 }
304288 if (! $ createMissing && ! $ this ->isFile ($ path , true )) {
@@ -337,14 +321,13 @@ public function files($paths = false, $createMissing = false)
337321 *
338322 * @param string $path
339323 * @param boolean $createMissing
340- * @param boolean $isAbsolute
341324 * @return Tarsana\IO\Filesystem\Directory
342325 *
343326 * @throws Tarsana\IO\Exceptions\FilesystemException
344327 */
345- public function dir ($ path , $ createMissing = false , $ isAbsolute = false )
328+ public function dir ($ path , $ createMissing = false )
346329 {
347- if (! $ isAbsolute ) {
330+ if (! $ this -> adapter -> isAbsolute ( $ path ) ) {
348331 $ path = $ this ->rootPath . $ path ;
349332 }
350333 if (! $ createMissing && ! $ this ->isDir ($ path , true )) {
@@ -381,12 +364,11 @@ public function dirs($paths = false, $createMissing = false)
381364 * and returns a collection containing them.
382365 *
383366 * @param string $pattern
384- * @param boolean $isAbsolute
385367 * @return Tarsana\IO\Filesystem\Collection
386368 */
387- public function find ($ pattern, $ isAbsolute = false )
369+ public function find ($ pattern )
388370 {
389- if (! $ isAbsolute ) {
371+ if (! $ this -> adapter -> isAbsolute ( $ pattern ) ) {
390372 $ pattern = $ this ->rootPath . $ pattern ;
391373 }
392374 $ list = new Collection ;
@@ -404,12 +386,11 @@ public function find($pattern, $isAbsolute = false)
404386 * Removes a file or directory recursively.
405387 *
406388 * @param string $path
407- * @param boolean $isAbsolute
408389 * @return Tarsana\IO\Filesystem
409390 */
410- public function remove ($ path, $ isAbsolute = false )
391+ public function remove ($ path )
411392 {
412- if (! $ isAbsolute ) {
393+ if (! $ this -> adapter -> isAbsolute ( $ path ) ) {
413394 $ path = $ this ->rootPath . $ path ;
414395 }
415396 if ($ this ->isFile ($ path , true )) {
@@ -430,13 +411,12 @@ public function remove($path, $isAbsolute = false)
430411 * Removes an array of files or directories.
431412 *
432413 * @param array $paths
433- * @param boolean $areAbsolute
434414 * @return Tarsana\IO\Filesystem
435415 */
436- public function removeAll ($ paths, $ areAbsolute = false )
416+ public function removeAll ($ paths )
437417 {
438418 foreach ($ paths as $ path ) {
439- $ this ->remove ($ path, $ areAbsolute );
419+ $ this ->remove ($ path );
440420 }
441421 return $ this ;
442422 }
0 commit comments