Make the file strict

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-03-05 18:00:46 +01:00
parent c5ab74348c
commit a788da6ac2
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,5 @@
<?php <?php
declare(strict_types=1);
/** /**
* @copyright Copyright (c) 2016, ownCloud, Inc. * @copyright Copyright (c) 2016, ownCloud, Inc.
* *
@ -57,7 +58,7 @@ class ServerContainer extends SimpleContainer {
* @param string $appName * @param string $appName
* @param string $appNamespace * @param string $appNamespace
*/ */
public function registerNamespace($appName, $appNamespace) { public function registerNamespace(string $appName, string $appNamespace): void {
// Cut of OCA\ and lowercase // Cut of OCA\ and lowercase
$appNamespace = strtolower(substr($appNamespace, strrpos($appNamespace, '\\') + 1)); $appNamespace = strtolower(substr($appNamespace, strrpos($appNamespace, '\\') + 1));
$this->namespaces[$appNamespace] = $appName; $this->namespaces[$appNamespace] = $appName;
@ -67,7 +68,7 @@ class ServerContainer extends SimpleContainer {
* @param string $appName * @param string $appName
* @param DIContainer $container * @param DIContainer $container
*/ */
public function registerAppContainer($appName, DIContainer $container) { public function registerAppContainer(string $appName, DIContainer $container): void {
$this->appContainers[strtolower(App::buildAppNamespace($appName, ''))] = $container; $this->appContainers[strtolower(App::buildAppNamespace($appName, ''))] = $container;
} }
@ -76,7 +77,7 @@ class ServerContainer extends SimpleContainer {
* @return DIContainer * @return DIContainer
* @throws QueryException * @throws QueryException
*/ */
public function getRegisteredAppContainer(string $appName) { public function getRegisteredAppContainer(string $appName): DIContainer {
if (isset($this->appContainers[strtolower(App::buildAppNamespace($appName, ''))])) { if (isset($this->appContainers[strtolower(App::buildAppNamespace($appName, ''))])) {
return $this->appContainers[strtolower(App::buildAppNamespace($appName, ''))]; return $this->appContainers[strtolower(App::buildAppNamespace($appName, ''))];
} }
@ -90,7 +91,7 @@ class ServerContainer extends SimpleContainer {
* @return DIContainer * @return DIContainer
* @throws QueryException * @throws QueryException
*/ */
protected function getAppContainer($namespace, $sensitiveNamespace) { protected function getAppContainer(string $namespace, string $sensitiveNamespace): DIContainer {
if (isset($this->appContainers[$namespace])) { if (isset($this->appContainers[$namespace])) {
return $this->appContainers[$namespace]; return $this->appContainers[$namespace];
} }