diff options
Diffstat (limited to 'lib/private/App/Platform.php')
-rw-r--r-- | lib/private/App/Platform.php | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 12097abbc78..15966d85c34 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -35,40 +35,26 @@ use OCP\IConfig; * @package OC\App */ class Platform { + private IConfig $config; - /** - * @param IConfig $config - */ public function __construct(IConfig $config) { $this->config = $config; } - /** - * @return string - */ - public function getPhpVersion() { + public function getPhpVersion(): string { return phpversion(); } - /** - * @return int - */ - public function getIntSize() { + public function getIntSize(): int { return PHP_INT_SIZE; } - /** - * @return string - */ - public function getOcVersion() { + public function getOcVersion(): string { $v = \OCP\Util::getVersion(); return implode('.', $v); } - /** - * @return string - */ - public function getDatabase() { + public function getDatabase(): string { $dbType = $this->config->getSystemValue('dbtype', 'sqlite'); if ($dbType === 'sqlite3') { $dbType = 'sqlite'; @@ -77,23 +63,19 @@ class Platform { return $dbType; } - /** - * @return string - */ - public function getOS() { + public function getOS(): string { return php_uname('s'); } /** * @param $command - * @return bool */ - public function isCommandKnown($command) { + public function isCommandKnown($command): bool { $path = \OC_Helper::findBinaryPath($command); return ($path !== null); } - public function getLibraryVersion($name) { + public function getLibraryVersion(string $name): ?string { $repo = new PlatformRepository(); return $repo->findLibrary($name); } |