From 4d6260a07998a18c296585047ad99b53ae247b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 4 Mar 2022 18:47:19 +0100 Subject: [PATCH] Add proper types to CommandCache --- files/lib/data/command/CommandCache.class.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/files/lib/data/command/CommandCache.class.php b/files/lib/data/command/CommandCache.class.php index 7990c11..5c31820 100644 --- a/files/lib/data/command/CommandCache.class.php +++ b/files/lib/data/command/CommandCache.class.php @@ -56,11 +56,8 @@ class CommandCache extends SingletonFactory /** * Returns a specific command. - * - * @param integer $commandID - * @return Command */ - public function getCommand($commandID) + public function getCommand(int $commandID): ?Command { if (isset($this->commands[$commandID])) { return $this->commands[$commandID]; @@ -71,11 +68,8 @@ class CommandCache extends SingletonFactory /** * Returns a specific command defined by a trigger. - * - * @param string $trigger - * @return Command */ - public function getCommandByTrigger($trigger) + public function getCommandByTrigger(string $trigger): ?Command { if (isset($this->triggers[$trigger])) { return $this->commands[$this->triggers[$trigger]]; @@ -86,11 +80,8 @@ class CommandCache extends SingletonFactory /** * Returns the command defined by the given package and identifier. - * - * @param string $identifier - * @return Command */ - public function getCommandByPackageAndIdentifier(Package $package, $identifier) + public function getCommandByPackageAndIdentifier(Package $package, string $identifier): ?Command { if (isset($this->packages[$package->packageID][$identifier])) { return $this->packages[$package->packageID][$identifier];