Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"bamarni/composer-bin-plugin": true
},
"platform": {
"php": "8.1"
"php": "8.2"
}
},
"autoload-dev": {
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor-bin/psalm/vendor/vimeo/psalm/config.xsd"
errorBaseline="tests/psalm-baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
phpVersion="8.1"
phpVersion="8.2"
>
<stubs>
<file name="tests/stubs/doctrine_dbal_schema_abstractasset.php" />
Expand All @@ -27,6 +27,7 @@
<file name="tests/stubs/oc_appframework_ocs_v1response.php" />
<file name="tests/stubs/oc_appframework_utility_simplecontainer.php" />
<file name="tests/stubs/oc_core_command_base.php" />
<file name="tests/stubs/oc_db_querybuilder_querybuilder.php" />
<file name="tests/stubs/oc_files_cache_cache.php" />
<file name="tests/stubs/oc_files_cache_cacheentry.php" />
<file name="tests/stubs/oc_files_cache_scanner.php" />
Expand Down Expand Up @@ -61,6 +62,7 @@
<file name="tests/stubs/oc_user_user.php" />
<file name="tests/stubs/oca_circles_circlesmanager.php" />
<file name="tests/stubs/oca_circles_circlesqueryhelper.php" />
<file name="tests/stubs/oca_circles_db_corequerybuilder.php" />
<file name="tests/stubs/oca_circles_events_circledestroyedevent.php" />
<file name="tests/stubs/oca_circles_events_circleresultgenericevent.php" />
<file name="tests/stubs/oca_circles_exceptions_circlenotfoundexception.php" />
Expand All @@ -77,6 +79,7 @@
<file name="tests/stubs/oca_circles_model_probes_basicprobe.php" />
<file name="tests/stubs/oca_circles_model_probes_circleprobe.php" />
<file name="tests/stubs/oca_circles_model_probes_memberprobe.php" />
<file name="tests/stubs/oca_circles_tools_db_extendedquerybuilder.php" />
<file name="tests/stubs/oca_circles_tools_db_iqueryrow.php" />
<file name="tests/stubs/oca_circles_tools_ideserializable.php" />
<file name="tests/stubs/oca_dav_connector_sabre_directory.php" />
Expand Down Expand Up @@ -110,7 +113,6 @@
<file name="tests/stubs/symfony_component_console_question_question.php" />
<file name="tests/stubs/test_testcase.php" />
<file name="tests/stubs/test_traits_usertrait.php" />
<file name="tests/stubs/ocp_files_storage_iconstructablestorage.php" />
</stubs>
<projectFiles>
<directory name="lib" />
Expand Down
9 changes: 8 additions & 1 deletion tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="6.1.0@827971f8bc7a28bb4f842f34bf8901521de1cea3"/>
<files psalm-version="6.5.0@38fc8444edf0cebc9205296ee6e30e906ade783b">
<file src="lib/ACL/ACLCacheWrapper.php">
<DeprecatedMethod>
<code><![CDATA[search]]></code>
<code><![CDATA[searchByMime]]></code>
</DeprecatedMethod>
</file>
</files>
5 changes: 2 additions & 3 deletions tests/stubs/icewind_streams_directory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
/**
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Licensed under the MIT license:
* http://opensource.org/licenses/MIT
* SPDX-FileCopyrightText: 2014 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: MIT
*/

namespace Icewind\Streams;
Expand Down
5 changes: 2 additions & 3 deletions tests/stubs/icewind_streams_iteratordirectory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
/**
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Licensed under the MIT license:
* http://opensource.org/licenses/MIT
* SPDX-FileCopyrightText: 2014 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: MIT
*/

namespace Icewind\Streams;
Expand Down
19 changes: 2 additions & 17 deletions tests/stubs/icewind_streams_wrapperhandler.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-FileCopyrightText: 2019 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace Icewind\Streams;
Expand Down
24 changes: 12 additions & 12 deletions tests/stubs/oc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@
* SPDX-FileCopyrightText: 2013-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
use OC\Encryption\HookManager;

use OC\Profiler\BuiltInProfiler;
use OC\Share20\GroupDeletedListener;
use OC\Share20\Hooks;
use OC\Share20\UserDeletedListener;
use OC\Share20\UserRemovedListener;
use OC\User\DisabledUserException;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Events\BeforeFileSystemSetupEvent;
use OCP\Group\Events\GroupDeletedEvent;
use OCP\Group\Events\UserRemovedEvent;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IRequest;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Security\Bruteforce\IThrottler;
use OCP\Server;
use OCP\Share;
use OCP\Template\ITemplateManager;
use OCP\User\Events\UserChangedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\Util;
use Psr\Log\LoggerInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use function OCP\Log\logger;
Expand All @@ -28,10 +38,6 @@
* OC_autoload!
*/
class OC {
/**
* Associative array for autoloading. classname => filename
*/
public static array $CLASSPATH = [];
/**
* The installation path for Nextcloud on the server (e.g. /srv/http/nextcloud)
*/
Expand All @@ -58,8 +64,6 @@ class OC {
*/
public static bool $CLI = false;

public static \OC\Autoloader $loader;

public static \Composer\Autoload\ClassLoader $composerAutoloader;

public static \OC\Server $server;
Expand Down Expand Up @@ -118,10 +122,6 @@ public static function registerCleanupHooks(\OC\SystemConfig $systemConfig): voi
*/
public static function registerShareHooks(\OC\SystemConfig $systemConfig): void
{
}

protected static function registerAutoloaderCache(\OC\SystemConfig $systemConfig): void
{
}

/**
Expand Down
13 changes: 11 additions & 2 deletions tests/stubs/oc_appframework_ocs_baseresponse.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -11,10 +12,10 @@

/**
* @psalm-import-type DataResponseType from DataResponse
* @template S of int
* @template S of Http::STATUS_*
* @template-covariant T of DataResponseType
* @template H of array<string, mixed>
* @template-extends Response<int, array<string, mixed>>
* @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
abstract class BaseResponse extends Response {
/** @var array */
Expand Down Expand Up @@ -51,6 +52,14 @@ public function __construct(DataResponse $dataResponse, $format = 'xml', $status
*/
protected function renderResult(array $meta): string
{
}

/**
* @psalm-taint-escape has_quotes
* @psalm-taint-escape html
*/
protected function toJson(array $array): string
{
}

protected function toXML(array $array, \XMLWriter $writer): void
Expand Down
7 changes: 4 additions & 3 deletions tests/stubs/oc_appframework_ocs_v1response.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -11,17 +12,17 @@

/**
* @psalm-import-type DataResponseType from DataResponse
* @template S of int
* @template S of Http::STATUS_*
* @template-covariant T of DataResponseType
* @template H of array<string, mixed>
* @template-extends BaseResponse<int, DataResponseType, array<string, mixed>>
* @template-extends BaseResponse<Http::STATUS_*, DataResponseType, array<string, mixed>>
*/
class V1Response extends BaseResponse {
/**
* The V1 endpoint has very limited http status codes basically everything
* is status 200 except 401
*
* @return int
* @return Http::STATUS_*
*/
public function getStatus()
{
Expand Down
12 changes: 10 additions & 2 deletions tests/stubs/oc_appframework_utility_simplecontainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
use OCP\AppFramework\QueryException;
use OCP\IContainer;
use Pimple\Container;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use ReflectionClass;
use ReflectionException;
use ReflectionNamedType;
Expand All @@ -23,6 +25,8 @@
* SimpleContainer is a simple implementation of a container on basis of Pimple
*/
class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
public static bool $useLazyObjects = false;

public function __construct()
{
}
Expand Down Expand Up @@ -79,11 +83,15 @@ public function registerService($name, Closure $closure, $shared = true)
* @param string $alias the alias that should be registered
* @param string $target the target that should be resolved instead
*/
public function registerAlias($alias, $target)
public function registerAlias($alias, $target): void
{
}

/*
protected function registerDeprecatedAlias(string $alias, string $target): void
{
}

/**
* @param string $name
* @return string
*/
Expand Down
14 changes: 14 additions & 0 deletions tests/stubs/oc_core_command_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
namespace OC\Core\Command;

use OC\Core\Command\User\ListCommand;
use OCP\Defaults;
use OCP\Server;
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -35,6 +37,18 @@ protected function writeTableInOutputFormat(InputInterface $input, OutputInterfa
{
}

protected function writeStreamingTableInOutputFormat(InputInterface $input, OutputInterface $output, \Iterator $items, int $tableGroupSize): void
{
}

protected function writeStreamingJsonArray(InputInterface $input, OutputInterface $output, \Iterator $items): void
{
}

public function chunkIterator(\Iterator $iterator, int $count): \Iterator
{
}


/**
* @param mixed $item
Expand Down
Loading
Loading