Make NativeShare::getStat private to avoid confusion with NativeShare::stat

This commit is contained in:
Robin Appelman 2018-08-28 16:21:44 +02:00
commit 350e19c285
2 changed files with 20 additions and 13 deletions

View file

@ -93,7 +93,10 @@ class NativeShare extends AbstractShare {
while ($file = $this->getState()->readdir($dh)) {
$name = $file['name'];
if ($name !== '.' and $name !== '..') {
$files [] = new NativeFileInfo($this, $path . '/' . $name, $name);
$fullPath = $path . '/' . $name;
$files [] = new NativeFileInfo($this, $fullPath, $name, function() use ($fullPath) {
return $this->getStat($fullPath);
});
}
}
@ -109,13 +112,7 @@ class NativeShare extends AbstractShare {
return new NativeFileInfo($this, $path, basename($path), $this->getStat($path));
}
/**
* Get fstat
*
* @param string $path
* @return array
*/
public function getStat($path) {
private function getStat($path) {
return $this->getState()->stat($this->buildUrl($path));
}