Skip to content

Commit fd5664e

Browse files
committed
realpath and bug fix
1 parent b011d0b commit fd5664e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/FileSystem/DirHandler.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function list(): array {
132132
* @param string $path
133133
* @return array
134134
*/
135-
function _list(string $path): array {
135+
private function _list(string $path): array {
136136
$result = [];
137137
$scan = glob($path . '/*');
138138
foreach ($scan as $item) {
@@ -144,4 +144,13 @@ function _list(string $path): array {
144144
}
145145
return $result;
146146
}
147+
148+
/**
149+
* @return string|null
150+
*/
151+
public function toRealPath(): ?string {
152+
$realpath = \realpath($this->path);
153+
if (false === $realpath) return null;
154+
return $realpath;
155+
}
147156
}

0 commit comments

Comments
 (0)