fix phpstan lvl 9 bugs

This commit is contained in:
Dennis Eichhorn 2022-12-26 20:52:58 +01:00
parent 6e52397ab4
commit de6831cf36
2 changed files with 16 additions and 0 deletions

View File

@ -355,6 +355,10 @@ class Directory extends FileAbstract implements DirectoryInterface
*/
public function getOwner() : string
{
if ($this->con === null) {
return '';
}
$this->owner = self::parseRawList($this->con, self::parent($this->path))[$this->path]['user'];
return $this->owner;
@ -425,6 +429,10 @@ class Directory extends FileAbstract implements DirectoryInterface
*/
public function getPermission() : int
{
if ($this->con === null) {
return 0;
}
$this->permission = self::parseRawList($this->con, self::parent($this->path))[$this->path]['permission'];
return $this->permission;

View File

@ -302,6 +302,10 @@ class File extends FileAbstract implements FileInterface
*/
public function getOwner() : string
{
if ($this->con === null) {
return '';
}
$this->owner = Directory::parseRawList($this->con, self::dirpath($this->path))[$this->path]['user'];
return $this->owner;
@ -324,6 +328,10 @@ class File extends FileAbstract implements FileInterface
*/
public function getPermission() : int
{
if ($this->con === null) {
return 0;
}
$this->permission = Directory::parseRawList($this->con, self::dirpath($this->path))[$this->path]['permission'];
return $this->permission;