Skip to content

Commit

Permalink
Fix type errors detected by Psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Oct 14, 2020
1 parent f9f20b6 commit 0644a74
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/workflowengine/lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ protected function getBuildInOperators(): array {
}

/**
* @return IEntity[]
* @return ICheck[]
*/
protected function getBuildInChecks(): array {
try {
Expand Down
1 change: 1 addition & 0 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ private static function registerAccountHooks() {
}

private static function registerAppRestrictionsHooks() {
/** @var \OC\Group\Manager $groupManager */
$groupManager = self::$server->query(\OCP\IGroupManager::class);
$groupManager->listen('\OC\Group', 'postDelete', function (\OCP\IGroup $group) {
$appManager = self::$server->getAppManager();
Expand Down
9 changes: 7 additions & 2 deletions lib/private/AppFramework/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

use OC\AppFramework\DependencyInjection\DIContainer;
use OC\AppFramework\Http\Dispatcher;
use OC\AppFramework\Http\Request;
use OC\HintException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\ICallbackResponse;
Expand Down Expand Up @@ -114,9 +115,13 @@ public static function getAppIdForClass(string $className, string $topNamespace
*/
public static function main(string $controllerName, string $methodName, DIContainer $container, array $urlParams = null) {
if (!is_null($urlParams)) {
$container->query(IRequest::class)->setUrlParameters($urlParams);
/** @var Request $request */
$request = $container->query(IRequest::class);
$request->setUrlParameters($urlParams);
} elseif (isset($container['urlParams']) && !is_null($container['urlParams'])) {
$container->query(IRequest::class)->setUrlParameters($container['urlParams']);
/** @var Request $request */
$request = $container->query(IRequest::class);
$request->setUrlParameters($container['urlParams']);
}
$appName = $container['AppName'];

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Collaboration/Collaborators/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function search($search, array $shareTypes, $lookup, $limit, $offset) {
// Get from lookup server, not a separate share type
if ($lookup) {
$searchPlugin = $this->c->resolve(LookupPlugin::class);
$hasMoreResults |= $searchPlugin->search($search, $limit, $offset, $searchResult);
$hasMoreResults = $searchPlugin->search($search, $limit, $offset, $searchResult) || $hasMoreResults;
}

// sanitizing, could go into the plugins as well
Expand Down

0 comments on commit 0644a74

Please sign in to comment.