more on return type decls

This commit is contained in:
Anatol Belski
2017-05-20 14:04:34 +02:00
parent ad14edb0bf
commit a2debffacc
6 changed files with 25 additions and 25 deletions
@@ -27,7 +27,7 @@ class Fetcher
return $this->series;
}/*}}}*/
public function setSeries(Series $series)
public function setSeries(Series $series) : void
{/*{{{*/
$this->series = $series;
}/*}}}*/
@@ -35,7 +35,7 @@ class Manager
$this->series = $series;
}/*}}}*/
protected function getTmpSeriesPath()
protected function getTmpSeriesPath() : string
{/*{{{*/
return Config::getTmpDir() . DIRECTORY_SEPARATOR . $this->series->getname();
}/*}}}*/
@@ -47,7 +47,7 @@ class Manager
/* TODO and implement --force. */
/* FIXME implement rollback */
public function performUpdate(string &$msg = NULL, bool $force = false, bool $backup = true)
public function performUpdate(string &$msg = NULL, bool $force = false, bool $backup = true) : void
{/*{{{*/
if (!$force) {
if (!$this->updatesAvailable()) {
@@ -28,7 +28,7 @@ class Package
return "$base/{$branch_data['crt']}/$arch/{$this->name}";
}/*}}}*/
public function retrieve(string $path)
public function retrieve(string $path) : void
{/*{{{*/
$this->filepath = $path . DIRECTORY_SEPARATOR . $this->name;
@@ -39,7 +39,7 @@ class Package
fclose($fd);
}/*}}}*/
public function unpack(string $path)
public function unpack(string $path) : void
{/*{{{*/
if (!$this->filepath || !file_exists($this->filepath)) {
throw new Exception("Invalid filepath '{$this->filepath}'");
@@ -55,7 +55,7 @@ class Package
}
}/*}}}*/
public function cleanup()
public function cleanup() : void
{/*{{{*/
unlink($this->filepath);
}/*}}}*/
@@ -27,7 +27,7 @@ class Series
return $this->fetcher;
}/*}}}*/
public function setFetcher(Fetcher $fetcher)
public function setFetcher(Fetcher $fetcher) : void
{/*{{{*/
$this->fetcher = $fetcher;
}/*}}}*/
@@ -37,7 +37,7 @@ class Series
return $this->arch;
}/*}}}*/
public function setArch(string $arch)
public function setArch(string $arch) : void
{/*{{{*/
$this->arch = $arch;
}/*}}}*/
@@ -52,7 +52,7 @@ class Series
return $file;
}/*}}}*/
protected function getUri() : string
protected function getUri() : string
{/*{{{*/
$base = Config::getDepsBaseUri();
$file = $this->getName();
@@ -79,12 +79,12 @@ class Series
return $ret;
}/*}}}*/
public function getSavePath()
public function getSavePath() : string
{/*{{{*/
return Config::getCacheDir() . DIRECTORY_SEPARATOR . $this->getname();
}/*}}}*/
public function updatesAvailable()
public function updatesAvailable() : bool
{/*{{{*/
$series_data = $this->getData(true);
$series_file = $this->getSavePath();
@@ -92,7 +92,7 @@ class Series
return $this->cache->cachedContentDiffers($series_file, $series_data);
}/*}}}*/
public function cache(string $path = NULL)
public function cache(string $path = NULL) : void
{/*{{{*/
if (!$path) {
$path = $this->getSavePath();
+2 -2
View File
@@ -50,7 +50,7 @@ class Cache
return $old_sum != $new_sum;
}/*}}}*/
public function cacheContent(string $path, string $content, bool $relative = false)
public function cacheContent(string $path, string $content, bool $relative = false) : void
{/*{{{*/
$p = $this->getCacheablePath($path, $relative);
@@ -59,7 +59,7 @@ class Cache
}
}/*}}}*/
public function getCachedContent(string $path, bool $relative = false)
public function getCachedContent(string $path, bool $relative = false) : string
{/*{{{*/
$p = $this->getCacheablePath($path, $relative);
+11 -11
View File
@@ -39,32 +39,32 @@ class Config
return self::$depsBaseUri;
}/*}}}*/
public static function setCurrentArchName(string $arch)
public static function setCurrentArchName(string $arch) : void
{/*{{{*/
self::$currentArchName = $arch;
} /*}}}*/
public static function getCurrentArchName()
public static function getCurrentArchName() : ?string
{/*{{{*/
return self::$currentArchName;
} /*}}}*/
public static function setCurrentCrtName(string $crt)
public static function setCurrentCrtName(string $crt) : void
{/*{{{*/
self::$currentCrtName = $crt;
} /*}}}*/
public static function getCurrentCrtName()
public static function getCurrentCrtName() : ?string
{/*{{{*/
return self::$currentCrtName;
} /*}}}*/
public static function setCurrentStabilityName(string $stability)
public static function setCurrentStabilityName(string $stability) : void
{/*{{{*/
self::$currentStabilityName = $stability;
} /*}}}*/
public static function getCurrentStabilityName()
public static function getCurrentStabilityName() : ?string
{/*{{{*/
return self::$currentStabilityName;
} /*}}}*/
@@ -105,7 +105,7 @@ class Config
return self::$knownBranches;
}/*}}}*/
public static function setCurrentBranchName(string $name)
public static function setCurrentBranchName(string $name) : void
{/*{{{*/
if (!array_key_exists($name, self::getKnownBranches())) {
// throw new Exception("Unsupported branch '$name'");
@@ -114,7 +114,7 @@ class Config
self::$currentBranchName = $name;
}/*}}}*/
public static function getCurrentBranchName()
public static function getCurrentBranchName() : ?string
{/*{{{*/
return self::$currentBranchName;
}/*}}}*/
@@ -181,7 +181,7 @@ class Config
return self::$sdkNugetFeedUrl;
}/*}}}*/
public static function getSdkPath()
public static function getSdkPath() : string
{/*{{{*/
$path = getenv("PHP_SDK_ROOT_PATH");
@@ -208,12 +208,12 @@ class Config
return file_get_contents($path);
}/*}}}*/
public static function getDepsLocalPath()
public static function getDepsLocalPath() : string
{/*{{{*/
return self::$depsLocalPath;
}/*}}}*/
public static function setDepsLocalPath(string $path)
public static function setDepsLocalPath(string $path) : void
{/*{{{*/
self::$depsLocalPath = $path;
}/*}}}*/