Skip to content

Commit

Permalink
Fix new reported psalm issues
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
  • Loading branch information
CarlSchwan committed Jan 14, 2022
1 parent 26fbd2e commit ac108c4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 2 additions & 5 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1639,8 +1639,7 @@
<InvalidArgument occurrences="1">
<code>$files_list</code>
</InvalidArgument>
<InvalidScalarArgument occurrences="3">
<code>$freeSpace</code>
<InvalidScalarArgument occurrences="1">
<code>$maxUploadFilesize</code>
<code>$maxUploadFilesize</code>
</InvalidScalarArgument>
Expand Down Expand Up @@ -1967,10 +1966,8 @@
</InvalidScalarArgument>
</file>
<file src="apps/sharebymail/lib/ShareByMailProvider.php">
<InvalidScalarArgument occurrences="4">
<InvalidScalarArgument occurrences="2">
<code>$share-&gt;getId()</code>
<code>$shareId</code>
<code>$shareId</code>
<code>(int)$data['id']</code>
</InvalidScalarArgument>
</file>
Expand Down
7 changes: 4 additions & 3 deletions lib/private/AppFramework/Utility/SimpleContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ public function __construct() {
}

/**
* @template T
* @param class-string<T> $id
* @return T
* @psalm-suppress MoreSpecificImplementedParamType
* @psalm-template T
* @psalm-param class-string<T>|'ThemingDefaults' $id
* @psalm-return T
*/
public function get(string $id) {
return $this->query($id);
Expand Down
9 changes: 6 additions & 3 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
use OC\Preview\GeneratorHelper;
use OC\Remote\Api\ApiFactory;
use OC\Remote\InstanceFactory;
use OC\RedisFactory;
use OC\RichObjectStrings\Validator;
use OC\Route\Router;
use OC\Security\Bruteforce\Throttler;
Expand Down Expand Up @@ -163,6 +164,7 @@
use OCP\Encryption\IFile;
use OCP\Encryption\Keys\IStorage;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\EventDispatcher\GenericEvent;
use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudIdManager;
Expand Down Expand Up @@ -248,7 +250,6 @@
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use OCA\Files_External\Service\UserStoragesService;
use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\GlobalStoragesService;
Expand Down Expand Up @@ -1645,6 +1646,7 @@ public function getUserSession() {
* @deprecated 20.0.0
*/
public function getSession() {
/** @psalm-suppress UndefinedInterfaceMethod */
return $this->get(IUserSession::class)->getSession();
}

Expand All @@ -1653,6 +1655,7 @@ public function getSession() {
*/
public function setSession(\OCP\ISession $session) {
$this->get(SessionStorage::class)->setSession($session);
/** @psalm-suppress UndefinedInterfaceMethod */
$this->get(IUserSession::class)->setSession($session);
$this->get(Store::class)->setSession($session);
}
Expand Down Expand Up @@ -1763,7 +1766,7 @@ public function getMemCacheFactory() {
* @deprecated 20.0.0
*/
public function getGetRedisFactory() {
return $this->get('RedisFactory');
return $this->get(RedisFactory::class);
}


Expand Down Expand Up @@ -2243,7 +2246,7 @@ public function getAutoCompleteManager() {
* @deprecated 20.0.0
*/
public function getLDAPProvider() {
return $this->get('LDAPProvider');
return $this->get(\OCA\User_LDAP\LDAPProvider::class);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Template/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function getCoreTemplateDirs($theme, $serverRoot) {
/**
* Assign variables
* @param string $key key
* @param array|bool|integer|string|Throwable $value value
* @param mixed $value value
* @return bool
*
* This function assigns a variable. It can be accessed via $_[$key] in
Expand Down

0 comments on commit ac108c4

Please sign in to comment.