diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-06-21 16:03:45 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-06-21 16:17:52 +0200 |
commit | 1bd5222224bac9b8f1037c992367c9af85a9ec5a (patch) | |
tree | 2a36b991633734a0738a415c266bcdfeb290c58a /lib/private/App/Platform.php | |
parent | dbc2c2325ea194b4588515e5fad988b7ab9bcf3f (diff) | |
download | nextcloud-server-1bd5222224bac9b8f1037c992367c9af85a9ec5a.tar.gz nextcloud-server-1bd5222224bac9b8f1037c992367c9af85a9ec5a.zip |
Fix PHP 8.2 warnings about undeclared properties
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/App/Platform.php')
-rw-r--r-- | lib/private/App/Platform.php | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index 12097abbc78..8da16c038f1 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -36,39 +36,26 @@ use OCP\IConfig; */ class Platform { - /** - * @param IConfig $config - */ + private 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 +64,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); } |