fixed novice mistakes

This commit is contained in:
huangjx
2022-04-24 11:38:08 +08:00
parent faa1b355d4
commit 43a5907a13

View File

@@ -101,10 +101,10 @@ class Aria2
mkdir($this->confDir, 0755, true); mkdir($this->confDir, 0755, true);
} }
$dir = ""; $dir = "";
if ($dir = $this->getDownloadDir() && !is_dir($dir)) { if (($dir = $this->getDownloadDir()) && !is_dir($dir)) {
mkdir($dir, 0755, true); mkdir($dir, 0755, true);
} }
if ($dir = $this->getTorrentsDir() && !is_dir($dir)) { if (($dir = $this->getTorrentsDir()) && !is_dir($dir)) {
mkdir($dir, 0755, true); mkdir($dir, 0755, true);
} }
$this->followTorrent(true); $this->followTorrent(true);
@@ -129,7 +129,7 @@ class Aria2
$this->torrentsDir = $dir; $this->torrentsDir = $dir;
return $this; return $this;
} }
public function getTorrentsDir() public function getTorrentsDir(): string
{ {
return $this->torrentsDir; return $this->torrentsDir;
} }
@@ -139,7 +139,7 @@ class Aria2
$this->downloadDir = $dir; $this->downloadDir = $dir;
return $this; return $this;
} }
public function getDownloadDir() public function getDownloadDir(): string
{ {
return $this->downloadDir; return $this->downloadDir;
} }