mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 02:14:06 +02:00
more type hints
This commit is contained in:
parent
b3fbc1be3c
commit
807c8c9a26
7 changed files with 23 additions and 21 deletions
|
|
@ -10,11 +10,11 @@ class DemoStore {
|
|||
/** @var string */
|
||||
private $root;
|
||||
/** @var string */
|
||||
private $webroot;
|
||||
private $webRoot;
|
||||
|
||||
public function __construct(string $root, string $webroot) {
|
||||
public function __construct(string $root, string $webRoot) {
|
||||
$this->root = $root;
|
||||
$this->webroot = $webroot;
|
||||
$this->webRoot = $webRoot;
|
||||
}
|
||||
|
||||
public function store(string $sourcePath, string $name): StoredDemo {
|
||||
|
|
@ -32,11 +32,11 @@ class DemoStore {
|
|||
return $this->root . $this->getPrefix($name) . $name;
|
||||
}
|
||||
|
||||
private function getPrefix(string $name) {
|
||||
private function getPrefix(string $name): string {
|
||||
return '/' . substr($name, 0, 2) . '/' . substr($name, 2, 2) . '/';
|
||||
}
|
||||
|
||||
private function getUrl(string $name): string {
|
||||
return 'https://' . $this->webroot . $this->getPrefix($name) . $name;
|
||||
return 'https://' . $this->webRoot . $this->getPrefix($name) . $name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class Parser {
|
|||
*
|
||||
* @return string The converted 64bit numeric SteamID
|
||||
*/
|
||||
public function convertSteamIdToCommunityId($steamId) {
|
||||
public function convertSteamIdToCommunityId(string $steamId): string {
|
||||
if ($steamId === 'STEAM_ID_LAN' || $steamId === 'BOT') {
|
||||
throw new \InvalidArgumentException("Cannot convert SteamID \"$steamId\" to a community ID.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue