Skip to content

Commit 7c52814

Browse files
author
Dogan Ucar
committed
isDir method
1 parent ce0bee6 commit 7c52814

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/FileSystem/DirHandler.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ public function __construct(string $path) {
4848
* @return bool
4949
*/
5050
public function isReadable(): bool {
51-
return \is_dir($this->path) && \is_readable($this->path);
51+
return $this->isDir() && \is_readable($this->path);
52+
}
53+
54+
/**
55+
* whether the dir is present
56+
*
57+
* @return bool
58+
*/
59+
public function isDir(): bool {
60+
return is_dir($this->path);
5261
}
5362

5463
/**
@@ -80,7 +89,7 @@ public function setPath(string $path) {
8089
* @return bool
8190
*/
8291
public function isWritable(): bool {
83-
return \is_dir($this->path) && \is_writable($this->path);
92+
return $this->isDir() && \is_writable($this->path);
8493
}
8594

8695
/**

0 commit comments

Comments
 (0)