diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index e93ad24b3ab50c096c960a95efecddef490c3e83..c949e7f36f7db688ad3d850ba1e8efa6ab361980 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -695,7 +695,7 @@ class Manager implements IManager { } /** - * @return IEntity[] + * @return ICheck[] */ protected function getBuildInChecks(): array { try { diff --git a/lib/base.php b/lib/base.php index bb9b8963419d24cb1fce5d126ddf1f616e40bc57..a27e8ffc920683af5d43000f88c2652ce7e165eb 100644 --- a/lib/base.php +++ b/lib/base.php @@ -859,6 +859,7 @@ class OC { } 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(); diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index d93849a6db6c1a4c92e6d727a13350baad84c851..d6bf7bc81c33234c4e05f3596ab1d6285c21c212 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -34,6 +34,7 @@ namespace OC\AppFramework; 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; @@ -114,9 +115,13 @@ class App { */ 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']; diff --git a/lib/private/Collaboration/Collaborators/Search.php b/lib/private/Collaboration/Collaborators/Search.php index e7773858e5c08c85f9fd02737bbab0c596d6fea9..1e0fd73979393852bf08664ffecf763520c8fcb6 100644 --- a/lib/private/Collaboration/Collaborators/Search.php +++ b/lib/private/Collaboration/Collaborators/Search.php @@ -68,14 +68,14 @@ class Search implements ISearch { foreach ($this->pluginList[$type] as $plugin) { /** @var ISearchPlugin $searchPlugin */ $searchPlugin = $this->c->resolve($plugin); - $hasMoreResults |= $searchPlugin->search($search, $limit, $offset, $searchResult); + $hasMoreResults = $searchPlugin->search($search, $limit, $offset, $searchResult) || $hasMoreResults; } } // 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 diff --git a/lib/public/IContainer.php b/lib/public/IContainer.php index 74fdf4aba5b527ba23547afb708620030e9dd299..cb29e522032b78b71b779c7ab7534a8313dd1e40 100644 --- a/lib/public/IContainer.php +++ b/lib/public/IContainer.php @@ -52,10 +52,14 @@ use Psr\Container\ContainerInterface; interface IContainer extends ContainerInterface { /** + * @template T + * * If a parameter is not registered in the container try to instantiate it * by using reflection to find out how to build the class * @param string $name the class name to resolve + * @psalm-param string|class-string<T> $name * @return \stdClass + * @psalm-return ($name is class-string ? T : mixed) * @since 8.2.0 * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get * @throws ContainerExceptionInterface if the class could not be found or instantiated @@ -66,9 +70,13 @@ interface IContainer extends ContainerInterface { /** * Look up a service for a given name in the container. * + * @template T + * * @param string $name + * @psalm-param string|class-string<T> $name * @param bool $autoload Should we try to autoload the service. If we are trying to resolve built in types this makes no sense for example * @return mixed + * @psalm-return ($name is class-string ? T : mixed) * @throws ContainerExceptionInterface if the query could not be resolved * @throws QueryException if the query could not be resolved * @since 6.0.0