mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #30826 from nextcloud/backport/stable22/psalm-fix
This commit is contained in:
commit
c0b29720e1
68 changed files with 5432 additions and 3628 deletions
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once './lib/composer/autoload.php';
|
||||
require_once './vendor-bin/cs-fixer/vendor/autoload.php';
|
||||
|
||||
use Nextcloud\CodingStandard\Config;
|
||||
|
||||
$config = new Config();
|
||||
$config
|
||||
->getFinder()
|
||||
->ignoreVCSIgnored(true)
|
||||
->exclude('config')
|
||||
->exclude('data')
|
||||
->notPath('3rdparty')
|
||||
|
|
@ -1753,7 +1753,7 @@ class Access extends LDAPUtility {
|
|||
}
|
||||
|
||||
$attribute = $this->connection->getFromCache($uuidAttr);
|
||||
if (!$attribute === null) {
|
||||
if ($attribute !== null) {
|
||||
$this->connection->$uuidAttr = $attribute;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ use OCP\UserStatus\IUserStatus;
|
|||
*
|
||||
* @package OCA\UserStatus\Db
|
||||
*
|
||||
* @psalm-suppress MoreSpecificImplementedParamType
|
||||
*
|
||||
* @method UserStatus insert(UserStatus $entity)
|
||||
* @method UserStatus update(UserStatus $entity)
|
||||
* @method UserStatus insertOrUpdate(UserStatus $entity)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ $expectedFiles = [
|
|||
'.jshintrc',
|
||||
'.mailmap',
|
||||
'.npmignore',
|
||||
'.php_cs.dist',
|
||||
'.php-cs-fixer.dist.php',
|
||||
'.scrutinizer.yml',
|
||||
'.tag',
|
||||
'.tx',
|
||||
|
|
@ -85,6 +85,7 @@ $expectedFiles = [
|
|||
'tests',
|
||||
'themes',
|
||||
'version.php',
|
||||
'vendor-bin',
|
||||
'webpack.common.js',
|
||||
'webpack.dev.js',
|
||||
'webpack.prod.js',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<files psalm-version="4.8.1@f73f2299dbc59a3e6c4d66cff4605176e728ee69">
|
||||
<files psalm-version="4.18.1@dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb">
|
||||
<file src="3rdparty/sabre/dav/lib/CalDAV/Calendar.php">
|
||||
<MoreSpecificImplementedParamType occurrences="1">
|
||||
<code>$calendarData</code>
|
||||
|
|
@ -36,6 +36,11 @@
|
|||
<code>array</code>
|
||||
</LessSpecificImplementedReturnType>
|
||||
</file>
|
||||
<file src="apps/admin_audit/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/cloud_federation_api/lib/Controller/RequestHandlerController.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$e->getCode()</code>
|
||||
|
|
@ -44,6 +49,12 @@
|
|||
<code>!is_array($notification)</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="apps/comments/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/comments/lib/Search/Result.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>(int) $comment->getId()</code>
|
||||
|
|
@ -54,6 +65,11 @@
|
|||
<code>\Sabre\Uri\split($this->principalUri)</code>
|
||||
</UndefinedFunction>
|
||||
</file>
|
||||
<file src="apps/contactsinteraction/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/dav/appinfo/v1/caldav.php">
|
||||
<TooManyArguments occurrences="1">
|
||||
<code>new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud')</code>
|
||||
|
|
@ -112,6 +128,36 @@
|
|||
</MissingFile>
|
||||
</file>
|
||||
<file src="apps/dav/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="28">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>getAppDataDir</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
|
|
@ -312,6 +358,11 @@
|
|||
<code>@var VEvent $vevent</code>
|
||||
</PossiblyInvalidDocblockTag>
|
||||
</file>
|
||||
<file src="apps/dav/lib/CalDAV/Reminder/NotificationProviderManager.php">
|
||||
<UndefinedConstant occurrences="1">
|
||||
<code>$provider::NOTIFICATION_TYPE</code>
|
||||
</UndefinedConstant>
|
||||
</file>
|
||||
<file src="apps/dav/lib/CalDAV/Reminder/Notifier.php">
|
||||
<FalsableReturnStatement occurrences="4">
|
||||
<code>$this->l10n->l('date', $dt, ['width' => 'medium'])</code>
|
||||
|
|
@ -638,9 +689,6 @@
|
|||
<UndefinedFunction occurrences="1">
|
||||
<code>\Sabre\Uri\split($this->path)</code>
|
||||
</UndefinedFunction>
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>writeStream</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/dav/lib/Connector/Sabre/FilesPlugin.php">
|
||||
<UndefinedFunction occurrences="3">
|
||||
|
|
@ -1014,6 +1062,9 @@
|
|||
<NullArgument occurrences="1">
|
||||
<code>null</code>
|
||||
</NullArgument>
|
||||
<RedundantFunctionCall occurrences="1">
|
||||
<code>array_values</code>
|
||||
</RedundantFunctionCall>
|
||||
</file>
|
||||
<file src="apps/dav/lib/Upload/UploadHome.php">
|
||||
<UndefinedFunction occurrences="1">
|
||||
|
|
@ -1026,7 +1077,12 @@
|
|||
</InvalidOperand>
|
||||
</file>
|
||||
<file src="apps/encryption/lib/Crypto/Crypt.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>false</code>
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$userSession</code>
|
||||
<code>$userSession</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="2">
|
||||
|
|
@ -1062,17 +1118,24 @@
|
|||
<InvalidThrow occurrences="1">
|
||||
<code>throw $exception;</code>
|
||||
</InvalidThrow>
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$userSession</code>
|
||||
<code>$userSession</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="apps/encryption/lib/Migration/SetMasterKeyStatus.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/encryption/lib/Recovery.php">
|
||||
<InvalidScalarArgument occurrences="3">
|
||||
<code>0</code>
|
||||
<code>0</code>
|
||||
<code>1</code>
|
||||
</InvalidScalarArgument>
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$userSession</code>
|
||||
<code>$userSession</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
|
|
@ -1082,10 +1145,16 @@
|
|||
</TooManyArguments>
|
||||
</file>
|
||||
<file src="apps/encryption/lib/Util.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$userSession</code>
|
||||
<code>$userSession</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="apps/federatedfilesharing/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/federatedfilesharing/lib/Controller/RequestHandlerController.php">
|
||||
<InvalidScalarArgument occurrences="7">
|
||||
<code>$id</code>
|
||||
|
|
@ -1140,6 +1209,11 @@
|
|||
<code>null</code>
|
||||
</NullableReturnStatement>
|
||||
</file>
|
||||
<file src="apps/federation/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/federation/lib/TrustedServers.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>'OCP\Federation\TrustedServerEvent::remove'</code>
|
||||
|
|
@ -1156,11 +1230,6 @@
|
|||
<code>$files_list</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files/ajax/list.php">
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>!$dirInfo->getType() === 'dir'</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="apps/files/appinfo/routes.php">
|
||||
<InvalidScope occurrences="2">
|
||||
<code>$this</code>
|
||||
|
|
@ -1189,7 +1258,16 @@
|
|||
<code>10 * 1024 * 1024</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="apps/files/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files/lib/Command/Scan.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$inputPath</code>
|
||||
</InvalidScalarArgument>
|
||||
<NullArgument occurrences="1">
|
||||
<code>null</code>
|
||||
</NullArgument>
|
||||
|
|
@ -1278,6 +1356,12 @@
|
|||
<code>$this</code>
|
||||
</InvalidScope>
|
||||
</file>
|
||||
<file src="apps/files_external/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files_external/lib/Command/Applicable.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>$mountId</code>
|
||||
|
|
@ -1340,6 +1424,12 @@
|
|||
<code>getUniqueStorages</code>
|
||||
</UndefinedMethod>
|
||||
</file>
|
||||
<file src="apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files_external/lib/Lib/Backend/Backend.php">
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>self</code>
|
||||
|
|
@ -1534,6 +1624,16 @@
|
|||
<code>$_</code>
|
||||
</UndefinedVariable>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="6">
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/Cache.php">
|
||||
<FalsableReturnStatement occurrences="1">
|
||||
<code>false</code>
|
||||
|
|
@ -1553,11 +1653,17 @@
|
|||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/Controller/ShareAPIController.php">
|
||||
<InvalidOperand occurrences="1">
|
||||
<code>$permissions</code>
|
||||
</InvalidOperand>
|
||||
<InvalidScalarArgument occurrences="3">
|
||||
<code>$code</code>
|
||||
<code>$code</code>
|
||||
<code>Constants::PERMISSION_ALL</code>
|
||||
</InvalidScalarArgument>
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>$permissions & Constants::PERMISSION_READ</code>
|
||||
</RedundantCondition>
|
||||
<UndefinedClass occurrences="2">
|
||||
<code>\OCA\Circles\Api\v1\Circles</code>
|
||||
<code>\OCA\Circles\Api\v1\Circles</code>
|
||||
|
|
@ -1603,9 +1709,6 @@
|
|||
</InvalidDocblock>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/External/Scanner.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$recursive</code>
|
||||
</InvalidScalarArgument>
|
||||
<MoreSpecificImplementedParamType occurrences="1">
|
||||
<code>$cacheData</code>
|
||||
</MoreSpecificImplementedParamType>
|
||||
|
|
@ -1628,6 +1731,11 @@
|
|||
<code>$exception->getMessage()</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/MountProvider.php">
|
||||
<RedundantFunctionCall occurrences="1">
|
||||
<code>array_values</code>
|
||||
</RedundantFunctionCall>
|
||||
</file>
|
||||
<file src="apps/files_sharing/lib/ShareBackend/File.php">
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$itemSource</code>
|
||||
|
|
@ -1681,6 +1789,11 @@
|
|||
<code>dispatch</code>
|
||||
</TooManyArguments>
|
||||
</file>
|
||||
<file src="apps/files_trashbin/lib/Command/Size.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$user</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="apps/files_trashbin/lib/Hooks.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$user</code>
|
||||
|
|
@ -1740,12 +1853,13 @@
|
|||
</TooManyArguments>
|
||||
</file>
|
||||
<file src="apps/files_trashbin/lib/Trash/LegacyTrashBackend.php">
|
||||
<ParadoxicalCondition occurrences="1">
|
||||
<code>null</code>
|
||||
</ParadoxicalCondition>
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$trashFiles</code>
|
||||
<code>$trashFiles</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>null</code>
|
||||
</TypeDoesNotContainType>
|
||||
<UndefinedInterfaceMethod occurrences="2">
|
||||
<code>$file</code>
|
||||
<code>getById</code>
|
||||
|
|
@ -1769,6 +1883,12 @@
|
|||
<code>$this</code>
|
||||
</InvalidScope>
|
||||
</file>
|
||||
<file src="apps/files_versions/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/files_versions/lib/Expiration.php">
|
||||
<FalsableReturnStatement occurrences="1">
|
||||
<code>$maxAge</code>
|
||||
|
|
@ -1824,6 +1944,11 @@
|
|||
<file src="apps/oauth2/lib/Db/ClientMapper.php">
|
||||
<InvalidCatch occurrences="2"/>
|
||||
</file>
|
||||
<file src="apps/provisioning_api/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/provisioning_api/lib/Controller/UsersController.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$quota</code>
|
||||
|
|
@ -1834,6 +1959,10 @@
|
|||
</TypeDoesNotContainNull>
|
||||
</file>
|
||||
<file src="apps/settings/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>\OC_User::getUser()</code>
|
||||
</InvalidScalarArgument>
|
||||
|
|
@ -1865,6 +1994,11 @@
|
|||
<code>dispatch</code>
|
||||
</TooManyArguments>
|
||||
</file>
|
||||
<file src="apps/settings/lib/Controller/CommonSettingsTrait.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>$isSubAdmin</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="apps/settings/lib/Hooks.php">
|
||||
<InvalidArrayOffset occurrences="1">
|
||||
<code>[$user->getEMailAddress() => $user->getDisplayName()]</code>
|
||||
|
|
@ -1875,6 +2009,11 @@
|
|||
<code>isReady</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/settings/lib/Settings/Admin/Server.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/settings/lib/Settings/Admin/Sharing.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>Constants::PERMISSION_ALL</code>
|
||||
|
|
@ -1891,11 +2030,14 @@
|
|||
<code>getLanguages</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/settings/lib/SetupChecks/CheckUserCertificates.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/sharebymail/lib/ShareByMailProvider.php">
|
||||
<InvalidScalarArgument occurrences="4">
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$share->getId()</code>
|
||||
<code>$shareId</code>
|
||||
<code>$shareId</code>
|
||||
<code>(int)$data['id']</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
|
|
@ -1914,6 +2056,11 @@
|
|||
<code>$type</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="apps/theming/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/theming/lib/Controller/IconController.php">
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>$response</code>
|
||||
|
|
@ -1960,6 +2107,14 @@
|
|||
<code>$folder !== null</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="apps/twofactor_backupcodes/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="4">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>bool</code>
|
||||
|
|
@ -1977,6 +2132,9 @@
|
|||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="apps/updatenotification/lib/Notification/BackgroundJob.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
<InvalidPropertyAssignmentValue occurrences="1">
|
||||
<code>$this->users</code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
|
|
@ -2021,9 +2179,6 @@
|
|||
<InvalidArgument occurrences="1">
|
||||
<code>$record</code>
|
||||
</InvalidArgument>
|
||||
<InvalidArrayOffset occurrences="1">
|
||||
<code>[$attr => $result['values']]</code>
|
||||
</InvalidArrayOffset>
|
||||
<InvalidReturnStatement occurrences="2">
|
||||
<code>$uuid</code>
|
||||
<code>$values</code>
|
||||
|
|
@ -2039,14 +2194,12 @@
|
|||
<NullArgument occurrences="1">
|
||||
<code>$cookie</code>
|
||||
</NullArgument>
|
||||
<RedundantCondition occurrences="4">
|
||||
<RedundantCondition occurrences="3">
|
||||
<code>!is_null($limit)</code>
|
||||
<code>!isset($ldapName[0]) && empty($ldapName[0])</code>
|
||||
<code>$limit === 0</code>
|
||||
<code>is_array($result)</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainNull occurrences="2">
|
||||
<code>!$attribute === null</code>
|
||||
<TypeDoesNotContainNull occurrences="1">
|
||||
<code>is_null($findings)</code>
|
||||
</TypeDoesNotContainNull>
|
||||
<TypeDoesNotContainType occurrences="2">
|
||||
|
|
@ -2304,17 +2457,19 @@
|
|||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="apps/user_status/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="3">
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>registerProvider</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/user_status/lib/Db/UserStatusMapper.php">
|
||||
<MoreSpecificImplementedParamType occurrences="1"/>
|
||||
</file>
|
||||
<file src="apps/user_status/lib/Service/StatusService.php">
|
||||
<MismatchingDocblockParamType occurrences="1">
|
||||
<code>string|null</code>
|
||||
</MismatchingDocblockParamType>
|
||||
<file src="apps/workflowengine/lib/AppInfo/Application.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>registerEventListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="apps/workflowengine/lib/Check/AbstractStringCheck.php">
|
||||
<NullArgument occurrences="1">
|
||||
|
|
@ -2410,6 +2565,19 @@
|
|||
<code>isUserScopeEnabled</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="core/Application.php">
|
||||
<InvalidArgument occurrences="9">
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="core/BackgroundJobs/BackgroundCleanupUpdaterBackupsJob.php">
|
||||
<ParamNameMismatch occurrences="1">
|
||||
<code>$arguments</code>
|
||||
|
|
@ -2429,9 +2597,6 @@
|
|||
<ImplementedReturnTypeMismatch occurrences="1">
|
||||
<code>null|int</code>
|
||||
</ImplementedReturnTypeMismatch>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</InvalidReturnType>
|
||||
<MismatchingDocblockReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</MismatchingDocblockReturnType>
|
||||
|
|
@ -2450,9 +2615,6 @@
|
|||
<ImplementedReturnTypeMismatch occurrences="1">
|
||||
<code>null|int</code>
|
||||
</ImplementedReturnTypeMismatch>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</InvalidReturnType>
|
||||
<MismatchingDocblockReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</MismatchingDocblockReturnType>
|
||||
|
|
@ -2475,9 +2637,6 @@
|
|||
<ImplementedReturnTypeMismatch occurrences="1">
|
||||
<code>null|int</code>
|
||||
</ImplementedReturnTypeMismatch>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</InvalidReturnType>
|
||||
<MismatchingDocblockReturnType occurrences="1">
|
||||
<code>null|int</code>
|
||||
</MismatchingDocblockReturnType>
|
||||
|
|
@ -2526,8 +2685,10 @@
|
|||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="core/Command/Log/Manage.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<InvalidScalarArgument occurrences="3">
|
||||
<code>$backend</code>
|
||||
<code>$levelNum</code>
|
||||
<code>$timezone</code>
|
||||
</InvalidScalarArgument>
|
||||
</file>
|
||||
<file src="core/Command/Maintenance/DataFingerprint.php">
|
||||
|
|
@ -2642,13 +2803,19 @@
|
|||
<code>$this</code>
|
||||
</InvalidScope>
|
||||
</file>
|
||||
<file src="core/templates/layout.guest.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="core/templates/layout.public.php">
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>getIcon</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="lib/autoloader.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$this->memoryCache</code>
|
||||
<code>$this->memoryCache</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
|
|
@ -2657,8 +2824,10 @@
|
|||
<code>getAppsNeedingUpgrade</code>
|
||||
<code>getIncompatibleApps</code>
|
||||
</InternalMethod>
|
||||
<InvalidArgument occurrences="1">
|
||||
<InvalidArgument occurrences="3">
|
||||
<code>$restrictions</code>
|
||||
<code>addServiceListener</code>
|
||||
<code>addServiceListener</code>
|
||||
</InvalidArgument>
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>((array)$request->getParam('appid')) !== ''</code>
|
||||
|
|
@ -3082,14 +3251,6 @@
|
|||
<code>bool|mixed</code>
|
||||
</LessSpecificImplementedReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Collaboration/Resources/Manager.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>$user instanceof IUser</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>''</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/Command/CallableJob.php">
|
||||
<ParamNameMismatch occurrences="1">
|
||||
<code>$serializedCallable</code>
|
||||
|
|
@ -3514,7 +3675,8 @@
|
|||
<NullableReturnStatement occurrences="1">
|
||||
<code>null</code>
|
||||
</NullableReturnStatement>
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$userObject</code>
|
||||
<code>$userObject</code>
|
||||
</RedundantCondition>
|
||||
<TooManyArguments occurrences="1">
|
||||
|
|
@ -3703,6 +3865,9 @@
|
|||
</MoreSpecificImplementedParamType>
|
||||
</file>
|
||||
<file src="lib/private/Files/ObjectStore/ObjectStoreStorage.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<code>$source</code>
|
||||
</InvalidScalarArgument>
|
||||
<ParamNameMismatch occurrences="2">
|
||||
<code>$source</code>
|
||||
<code>$target</code>
|
||||
|
|
@ -3925,6 +4090,11 @@
|
|||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Files/Storage/Wrapper/Encoding.php">
|
||||
<InvalidScalarArgument occurrences="3">
|
||||
<code>\Normalizer::FORM_C</code>
|
||||
<code>\Normalizer::FORM_C</code>
|
||||
<code>\Normalizer::FORM_D</code>
|
||||
</InvalidScalarArgument>
|
||||
<UndefinedInterfaceMethod occurrences="13">
|
||||
<code>$this->namesCache</code>
|
||||
<code>$this->namesCache</code>
|
||||
|
|
@ -3945,10 +4115,6 @@
|
|||
<FalsableReturnStatement occurrences="1">
|
||||
<code>false</code>
|
||||
</FalsableReturnStatement>
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>$source</code>
|
||||
<code>$target</code>
|
||||
</InvalidArgument>
|
||||
<InvalidOperand occurrences="3">
|
||||
<code>$result</code>
|
||||
<code>$result</code>
|
||||
|
|
@ -4019,6 +4185,11 @@
|
|||
<code>stream_flush</code>
|
||||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Files/Template/TemplateManager.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>!$isDefaultTemplates</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="lib/private/Files/Type/Detection.php">
|
||||
<ParamNameMismatch occurrences="1">
|
||||
<code>$mimetype</code>
|
||||
|
|
@ -4068,9 +4239,13 @@
|
|||
<code>null</code>
|
||||
<code>null</code>
|
||||
</NullableReturnStatement>
|
||||
<RedundantCondition occurrences="3">
|
||||
<RedundantCondition occurrences="7">
|
||||
<code>$data</code>
|
||||
<code>$data</code>
|
||||
<code>$result</code>
|
||||
<code>$result && in_array('delete', $hooks) and $result</code>
|
||||
<code>Constants::PERMISSION_READ</code>
|
||||
<code>Constants::PERMISSION_READ</code>
|
||||
<code>is_resource($source)</code>
|
||||
</RedundantCondition>
|
||||
<UndefinedDocblockClass occurrences="2">
|
||||
|
|
@ -4109,7 +4284,10 @@
|
|||
<MoreSpecificImplementedParamType occurrences="1">
|
||||
<code>$user</code>
|
||||
</MoreSpecificImplementedParamType>
|
||||
<RedundantCondition occurrences="3">
|
||||
<RedundantCondition occurrences="6">
|
||||
<code>$this->emitter</code>
|
||||
<code>$this->emitter</code>
|
||||
<code>$this->emitter</code>
|
||||
<code>$this->emitter</code>
|
||||
<code>$this->emitter</code>
|
||||
<code>$this->emitter</code>
|
||||
|
|
@ -4152,6 +4330,10 @@
|
|||
<FalsableReturnStatement occurrences="1">
|
||||
<code>false</code>
|
||||
</FalsableReturnStatement>
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>false</code>
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
<InvalidArrayOffset occurrences="2">
|
||||
<code>$app['path']</code>
|
||||
<code>$app['path']</code>
|
||||
|
|
@ -4159,7 +4341,8 @@
|
|||
<NullArgument occurrences="1">
|
||||
<code>null</code>
|
||||
</NullArgument>
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$archive</code>
|
||||
<code>$archive</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
|
|
@ -4234,7 +4417,8 @@
|
|||
</InvalidPropertyAssignmentValue>
|
||||
</file>
|
||||
<file src="lib/private/Log.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>$request</code>
|
||||
<code>$request</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
|
|
@ -4285,15 +4469,10 @@
|
|||
<code>mixed</code>
|
||||
</LessSpecificImplementedReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Memcache/Factory.php">
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>$lockingCacheClass && class_exists($distributedCacheClass)</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/Memcache/Memcached.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>method_exists(self::$cache, 'deleteMulti')</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>\Memcached::HAVE_IGBINARY</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/Memcache/Redis.php">
|
||||
<InvalidMethodCall occurrences="2">
|
||||
|
|
@ -4311,22 +4490,11 @@
|
|||
<code>$id</code>
|
||||
</ParamNameMismatch>
|
||||
</file>
|
||||
<file src="lib/private/Notification/Manager.php">
|
||||
<TypeDoesNotContainType occurrences="2">
|
||||
<code>!($notification instanceof INotification)</code>
|
||||
<code>!($notification instanceof INotification)</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/Preview/BackgroundCleanupJob.php">
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>[]</code>
|
||||
</InvalidReturnStatement>
|
||||
</file>
|
||||
<file src="lib/private/Preview/Bitmap.php">
|
||||
<ImplicitToStringCast occurrences="1">
|
||||
<code>$bp</code>
|
||||
</ImplicitToStringCast>
|
||||
</file>
|
||||
<file src="lib/private/Preview/Generator.php">
|
||||
<InvalidArgument occurrences="2">
|
||||
<code>$maxPreviewImage</code>
|
||||
|
|
@ -4366,11 +4534,6 @@
|
|||
<code>$provider->getThumbnail($file, $maxWidth, $maxHeight)</code>
|
||||
</NullableReturnStatement>
|
||||
</file>
|
||||
<file src="lib/private/Preview/HEIC.php">
|
||||
<ImplicitToStringCast occurrences="1">
|
||||
<code>$bp</code>
|
||||
</ImplicitToStringCast>
|
||||
</file>
|
||||
<file src="lib/private/Preview/Movie.php">
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$second</code>
|
||||
|
|
@ -4403,11 +4566,6 @@
|
|||
<code>string</code>
|
||||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="lib/private/Preview/SVG.php">
|
||||
<ImplicitToStringCast occurrences="1">
|
||||
<code>$svg</code>
|
||||
</ImplicitToStringCast>
|
||||
</file>
|
||||
<file src="lib/private/PreviewManager.php">
|
||||
<ForbiddenCode occurrences="2">
|
||||
<code>shell_exec('command -v libreoffice')</code>
|
||||
|
|
@ -4446,6 +4604,11 @@
|
|||
<code>dispatch</code>
|
||||
</TooManyArguments>
|
||||
</file>
|
||||
<file src="lib/private/Repair/Owncloud/CleanPreviews.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
</file>
|
||||
<file src="lib/private/Repair/Owncloud/CleanPreviewsBackgroundJob.php">
|
||||
<ParamNameMismatch occurrences="1">
|
||||
<code>$arguments</code>
|
||||
|
|
@ -4455,6 +4618,9 @@
|
|||
<ParamNameMismatch occurrences="1">
|
||||
<code>$arguments</code>
|
||||
</ParamNameMismatch>
|
||||
<TypeDoesNotContainType occurrences="1">
|
||||
<code>$counter % 100 === 0</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/Repair/RemoveLinkShares.php">
|
||||
<ImplicitToStringCast occurrences="2">
|
||||
|
|
@ -4490,9 +4656,6 @@
|
|||
<NullableReturnStatement occurrences="1">
|
||||
<code>$this->collectionName</code>
|
||||
</NullableReturnStatement>
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>$file !== false</code>
|
||||
</RedundantCondition>
|
||||
</file>
|
||||
<file src="lib/private/Search.php">
|
||||
<RedundantCondition occurrences="1">
|
||||
|
|
@ -4797,6 +4960,9 @@
|
|||
</NullArgument>
|
||||
</file>
|
||||
<file src="lib/private/Template/JSResourceLocator.php">
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>false</code>
|
||||
</InvalidArgument>
|
||||
<InvalidOperand occurrences="6">
|
||||
<code>$this->appendIfExist($this->serverroot, $script.'.js')</code>
|
||||
<code>$this->appendIfExist($this->serverroot, $theme_dir.$script.'.js')</code>
|
||||
|
|
@ -4867,6 +5033,9 @@
|
|||
<ImplementedReturnTypeMismatch occurrences="1">
|
||||
<code>array|int</code>
|
||||
</ImplementedReturnTypeMismatch>
|
||||
<InvalidArgument occurrences="1">
|
||||
<code>$callback</code>
|
||||
</InvalidArgument>
|
||||
<InvalidNullableReturnType occurrences="1">
|
||||
<code>bool|IUser</code>
|
||||
</InvalidNullableReturnType>
|
||||
|
|
@ -5039,16 +5208,8 @@
|
|||
<RedundantCondition occurrences="1">
|
||||
<code>count($obd_values) > 0</code>
|
||||
</RedundantCondition>
|
||||
<UndefinedInterfaceMethod occurrences="1">
|
||||
<code>getSourceStorage</code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="lib/private/legacy/OC_Image.php">
|
||||
<FalsableReturnStatement occurrences="3">
|
||||
<code>$this->resource</code>
|
||||
<code>$this->valid() ? imagesx($this->resource) : -1</code>
|
||||
<code>$this->valid() ? imagesy($this->resource) : -1</code>
|
||||
</FalsableReturnStatement>
|
||||
<ImplementedReturnTypeMismatch occurrences="1">
|
||||
<code>null|string</code>
|
||||
</ImplementedReturnTypeMismatch>
|
||||
|
|
@ -5056,9 +5217,6 @@
|
|||
<code>$data[floor($p)]</code>
|
||||
<code>$data[floor($p)]</code>
|
||||
</InvalidArrayOffset>
|
||||
<InvalidPropertyAssignmentValue occurrences="1">
|
||||
<code>$resource</code>
|
||||
</InvalidPropertyAssignmentValue>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>bool</code>
|
||||
</InvalidReturnType>
|
||||
|
|
@ -5074,10 +5232,6 @@
|
|||
<RedundantCondition occurrences="1">
|
||||
<code>$isWritable</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="2">
|
||||
<code>get_class($resource) === 'GdImage'</code>
|
||||
<code>get_class($this->resource) === 'GdImage'</code>
|
||||
</TypeDoesNotContainType>
|
||||
</file>
|
||||
<file src="lib/private/legacy/OC_JSON.php">
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
|
|
@ -5094,9 +5248,6 @@
|
|||
<code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($prevLogging)</code>
|
||||
<code>\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false)</code>
|
||||
</InternalMethod>
|
||||
<InvalidLiteralArgument occurrences="1">
|
||||
<code>\OCP\Constants::FILENAME_INVALID_CHARS</code>
|
||||
</InvalidLiteralArgument>
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>OC_Helper::computerFileSize($userQuota)</code>
|
||||
</InvalidReturnStatement>
|
||||
|
|
@ -5107,8 +5258,7 @@
|
|||
<code>$user</code>
|
||||
<code>OC_User::getUser()</code>
|
||||
</InvalidScalarArgument>
|
||||
<RedundantCondition occurrences="2">
|
||||
<code>'off'</code>
|
||||
<RedundantCondition occurrences="1">
|
||||
<code>is_string($expected)</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainType occurrences="3">
|
||||
|
|
|
|||
74
build/stubs/ftp.php
Normal file
74
build/stubs/ftp.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
/** @generate-class-entries */
|
||||
|
||||
namespace FTP {
|
||||
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class Connection
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|resource|false {}
|
||||
|
||||
#ifdef HAVE_FTP_SSL
|
||||
function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|resource|false {}
|
||||
#endif
|
||||
|
||||
function ftp_login(FTP\Connection|resource $ftp, string $username, string $password): bool {}
|
||||
function ftp_pwd(FTP\Connection|resource $ftp): string|false {}
|
||||
function ftp_cdup(FTP\Connection|resource $ftp): bool {}
|
||||
function ftp_chdir(FTP\Connection|resource $ftp, string $directory): bool {}
|
||||
function ftp_exec(FTP\Connection|resource $ftp, string $command): bool {}
|
||||
function ftp_raw(FTP\Connection|resource $ftp, string $command): ?array {}
|
||||
function ftp_mkdir(FTP\Connection|resource $ftp, string $directory): string|false {}
|
||||
function ftp_rmdir(FTP\Connection|resource $ftp, string $directory): bool {}
|
||||
function ftp_chmod(FTP\Connection|resource $ftp, int $permissions, string $filename): int|false {}
|
||||
|
||||
/** @param string $response */
|
||||
function ftp_alloc(FTP\Connection|resource $ftp, int $size, &$response = null): bool {}
|
||||
function ftp_nlist(FTP\Connection|resource $ftp, string $directory): array|false {}
|
||||
function ftp_rawlist(FTP\Connection|resource $ftp, string $directory, bool $recursive = false): array|false {}
|
||||
function ftp_mlsd(FTP\Connection|resource $ftp, string $directory): array|false {}
|
||||
function ftp_systype(FTP\Connection|resource $ftp): string|false {}
|
||||
|
||||
/** @param resource $stream */
|
||||
function ftp_fget(FTP\Connection|resource $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
|
||||
|
||||
/** @param resource $stream */
|
||||
function ftp_nb_fget(FTP\Connection|resource $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
|
||||
function ftp_pasv(FTP\Connection|resource $ftp, bool $enable): bool {}
|
||||
function ftp_get(FTP\Connection|resource $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
|
||||
function ftp_nb_get(FTP\Connection|resource $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
|
||||
function ftp_nb_continue(FTP\Connection|resource $ftp): int {}
|
||||
|
||||
/** @param resource $stream */
|
||||
function ftp_fput(FTP\Connection|resource $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): bool {}
|
||||
|
||||
/** @param resource $stream */
|
||||
function ftp_nb_fput(FTP\Connection|resource $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): int {}
|
||||
function ftp_put(FTP\Connection|resource $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
|
||||
function ftp_append(FTP\Connection|resource $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): bool {}
|
||||
function ftp_nb_put(FTP\Connection|resource $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
|
||||
function ftp_size(FTP\Connection|resource $ftp, string $filename): int {}
|
||||
function ftp_mdtm(FTP\Connection|resource $ftp, string $filename): int {}
|
||||
function ftp_rename(FTP\Connection|resource $ftp, string $from, string $to): bool {}
|
||||
function ftp_delete(FTP\Connection|resource $ftp, string $filename): bool {}
|
||||
function ftp_site(FTP\Connection|resource $ftp, string $command): bool {}
|
||||
function ftp_close(FTP\Connection|resource $ftp): bool {}
|
||||
|
||||
/** @alias ftp_close */
|
||||
function ftp_quit(FTP\Connection|resource $ftp): bool {}
|
||||
|
||||
/** @param int|bool $value */
|
||||
function ftp_set_option(FTP\Connection|resource $ftp, int $option, $value): bool {}
|
||||
function ftp_get_option(FTP\Connection|resource $ftp, int $option): int|bool {}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @strict-properties
|
||||
* @not-serializable
|
||||
*/
|
||||
final class GdImage {}
|
||||
|
||||
/**
|
||||
* Retrieve information about the currently installed GD library
|
||||
* @link https://php.net/manual/en/function.gd-info.php
|
||||
|
|
|
|||
50
build/stubs/pcntl.php
Normal file
50
build/stubs/pcntl.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
// Licensed under Apache-2.0
|
||||
// Copied from https://github.com/JetBrains/phpstorm-stubs/blob/master/pcntl/pcntl.php
|
||||
|
||||
define('WNOHANG', 1);
|
||||
define('WUNTRACED', 2);
|
||||
define('WCONTINUED', 8);
|
||||
define('SIG_IGN', 1);
|
||||
define('SIG_DFL', 0);
|
||||
define('SIG_ERR', -1);
|
||||
define('SIGHUP', 1);
|
||||
define('SIGINT', 2);
|
||||
define('SIGQUIT', 3);
|
||||
define('SIGILL', 4);
|
||||
define('SIGTRAP', 5);
|
||||
define('SIGABRT', 6);
|
||||
define('SIGIOT', 6);
|
||||
define('SIGBUS', 7);
|
||||
define('SIGFPE', 8);
|
||||
define('SIGKILL', 9);
|
||||
define('SIGUSR1', 10);
|
||||
define('SIGSEGV', 11);
|
||||
define('SIGUSR2', 12);
|
||||
define('SIGPIPE', 13);
|
||||
define('SIGALRM', 14);
|
||||
define('SIGTERM', 15);
|
||||
define('SIGSTKFLT', 16);
|
||||
define('SIGCLD', 17);
|
||||
define('SIGCHLD', 17);
|
||||
define('SIGCONT', 18);
|
||||
define('SIGSTOP', 19);
|
||||
define('SIGTSTP', 20);
|
||||
define('SIGTTIN', 21);
|
||||
define('SIGTTOU', 22);
|
||||
define('SIGURG', 23);
|
||||
define('SIGXCPU', 24);
|
||||
define('SIGXFSZ', 25);
|
||||
define('SIGVTALRM', 26);
|
||||
define('SIGPROF', 27);
|
||||
define('SIGWINCH', 28);
|
||||
define('SIGPOLL', 29);
|
||||
define('SIGIO', 29);
|
||||
define('SIGPWR', 30);
|
||||
define('SIGSYS', 31);
|
||||
define('SIGBABY', 31);
|
||||
define('PRIO_PGRP', 1);
|
||||
define('PRIO_USER', 2);
|
||||
define('PRIO_PROCESS', 0);
|
||||
|
||||
|
|
@ -1,33 +1,49 @@
|
|||
{
|
||||
"config" : {
|
||||
"vendor-dir": "lib/composer",
|
||||
"optimize-autoloader": true
|
||||
},
|
||||
"autoload" : {
|
||||
"config" : {
|
||||
"vendor-dir": "lib/composer",
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true,
|
||||
"platform": {
|
||||
"php": "7.3"
|
||||
},
|
||||
"allow-plugins": {
|
||||
"bamarni/composer-bin-plugin": true,
|
||||
"composer/package-versions-deprecated": true
|
||||
}
|
||||
},
|
||||
"autoload" : {
|
||||
"psr-4": {
|
||||
"": "lib/private/legacy",
|
||||
"OC\\": "lib/private",
|
||||
"OC\\Core\\": "core/",
|
||||
"OCP\\": "lib/public"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"ext-zip": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"nextcloud/coding-standard": "^0.5.0",
|
||||
"vimeo/psalm": "^4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"cs:fix": "php-cs-fixer fix",
|
||||
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l",
|
||||
"psalm": "psalm"
|
||||
}
|
||||
"OC\\": "lib/private",
|
||||
"OC\\Core\\": "core/",
|
||||
"OCP\\": "lib/public"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"ext-zip": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer bin all install",
|
||||
"composer dump-autoload"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || composer bin all update --ansi",
|
||||
"composer dump-autoload"
|
||||
],
|
||||
"cs:fix": "php-cs-fixer fix",
|
||||
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l",
|
||||
"psalm": "psalm --threads=1",
|
||||
"psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=build/psalm-baseline.xml"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3019
composer.lock
generated
3019
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -79,7 +79,7 @@ class ExecuteCommand extends Command implements CompletionAwareInterface {
|
|||
$olderVersions = $ms->getMigratedVersions();
|
||||
$olderVersions[] = '0';
|
||||
$olderVersions[] = 'prev';
|
||||
if (in_array($version, $olderVersions, true)) {
|
||||
if (in_array($version, $olderVersions, true)) {
|
||||
$output->writeln('<error>Can not go back to previous migration without debug enabled</error>');
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class {{classname}} extends SimpleMigrationStep {
|
|||
$appName = $input->getArgument('app');
|
||||
$version = $input->getArgument('version');
|
||||
|
||||
if (!preg_match('/^\d{1,16}$/',$version)) {
|
||||
if (!preg_match('/^\d{1,16}$/', $version)) {
|
||||
$output->writeln('<error>The given version is invalid. Only 0-9 are allowed (max. 16 digits)</error>');
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,8 +247,7 @@ class Upgrade extends Command {
|
|||
$output->write('<comment>Maybe an upgrade is already in process. Please check the '
|
||||
. 'logfile (data/nextcloud.log). If you want to re-run the '
|
||||
. 'upgrade procedure, remove the "maintenance mode" from '
|
||||
. 'config.php and call this script again.</comment>'
|
||||
, true);
|
||||
. 'config.php and call this script again.</comment>', true);
|
||||
return self::ERROR_MAINTENANCE_MODE;
|
||||
} else {
|
||||
$output->writeln('<info>Nextcloud is already latest version</info>');
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class Add extends Command {
|
|||
|
||||
$question = new Question('Confirm password: ');
|
||||
$question->setHidden(true);
|
||||
$confirm = $helper->ask($input, $output,$question);
|
||||
$confirm = $helper->ask($input, $output, $question);
|
||||
|
||||
if ($password !== $confirm) {
|
||||
$output->writeln("<error>Passwords did not match!</error>");
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class Setting extends Base {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if ($app === 'settings' && in_array($key , ['email', 'display_name'])) {
|
||||
if ($app === 'settings' && in_array($key, ['email', 'display_name'])) {
|
||||
$user = $this->userManager->get($uid);
|
||||
if ($user instanceof IUser) {
|
||||
if ($key === 'email') {
|
||||
|
|
@ -208,7 +208,7 @@ class Setting extends Base {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if ($app === 'settings' && in_array($key , ['email', 'display_name'])) {
|
||||
if ($app === 'settings' && in_array($key, ['email', 'display_name'])) {
|
||||
$user = $this->userManager->get($uid);
|
||||
if ($user instanceof IUser) {
|
||||
if ($key === 'email') {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Version15000Date20180926101451 extends SimpleMigrationStep {
|
|||
$schema = $schemaClosure();
|
||||
|
||||
$table = $schema->getTable('authtoken');
|
||||
$table->addColumn('password_invalid','boolean', [
|
||||
$table->addColumn('password_invalid', 'boolean', [
|
||||
'default' => 0,
|
||||
'notnull' => false,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ try {
|
|||
* not return a webpage, so we only print the error page when html is accepted,
|
||||
* otherwise we reply with a JSON array like the SecurityMiddleware would do.
|
||||
*/
|
||||
if (stripos($request->getHeader('Accept'),'html') === false) {
|
||||
if (stripos($request->getHeader('Accept'), 'html') === false) {
|
||||
http_response_code(401);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['message' => $ex->getMessage()]);
|
||||
|
|
|
|||
|
|
@ -42,30 +42,75 @@ namespace Composer\Autoload;
|
|||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var ?string */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var self[]
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param ?string $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
|
|
@ -75,28 +120,47 @@ class ClassLoader
|
|||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
|
|
@ -111,9 +175,11 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
|
|
@ -156,11 +222,13 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
|
|
@ -204,8 +272,10 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
|
|
@ -220,10 +290,12 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
|
|
@ -243,6 +315,8 @@ class ClassLoader
|
|||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
|
|
@ -265,6 +339,8 @@ class ClassLoader
|
|||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
|
|
@ -285,6 +361,8 @@ class ClassLoader
|
|||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
|
|
@ -305,6 +383,8 @@ class ClassLoader
|
|||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
|
|
@ -324,6 +404,8 @@ class ClassLoader
|
|||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
|
|
@ -403,6 +485,11 @@ class ClassLoader
|
|||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
|
|
@ -474,6 +561,10 @@ class ClassLoader
|
|||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
* @private
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,299 +1,350 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
private static $installed = array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '619b35b480a2d348436156a2a6144895b00b1e07',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '619b35b480a2d348436156a2a6144895b00b1e07',
|
||||
),
|
||||
),
|
||||
);
|
||||
private static $canGetVendors;
|
||||
private static $installedByVendor = array();
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function isInstalled($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = require __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,32 @@
|
|||
<?php return array (
|
||||
'root' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../../',
|
||||
'aliases' => array(),
|
||||
'reference' => '50c7a5e4cddd055db6ab1e7e30cb94b43001543f',
|
||||
'name' => '__root__',
|
||||
'dev' => true,
|
||||
),
|
||||
'reference' => '619b35b480a2d348436156a2a6144895b00b1e07',
|
||||
'name' => '__root__',
|
||||
),
|
||||
'versions' =>
|
||||
array (
|
||||
'__root__' =>
|
||||
array (
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'aliases' =>
|
||||
array (
|
||||
),
|
||||
'reference' => '619b35b480a2d348436156a2a6144895b00b1e07',
|
||||
'versions' => array(
|
||||
'__root__' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../../',
|
||||
'aliases' => array(),
|
||||
'reference' => '50c7a5e4cddd055db6ab1e7e30cb94b43001543f',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'bamarni/composer-bin-plugin' => array(
|
||||
'pretty_version' => '1.4.1',
|
||||
'version' => '1.4.1.0',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/../bamarni/composer-bin-plugin',
|
||||
'aliases' => array(),
|
||||
'reference' => '9329fb0fbe29e0e1b2db8f4639a193e4f5406225',
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class Dispatcher {
|
|||
$numExecuted = $databaseStatsAfter['executed'] - $databaseStatsBefore['executed'];
|
||||
|
||||
if ($numBuilt > 50) {
|
||||
$this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.' , [
|
||||
$this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.', [
|
||||
'class' => get_class($controller),
|
||||
'method' => $methodName,
|
||||
'count' => $numBuilt,
|
||||
|
|
@ -139,7 +139,7 @@ class Dispatcher {
|
|||
}
|
||||
|
||||
if ($numExecuted > 100) {
|
||||
$this->logger->warning('Controller {class}::{method} executed {count} queries.' , [
|
||||
$this->logger->warning('Controller {class}::{method} executed {count} queries.', [
|
||||
'class' => get_class($controller),
|
||||
'method' => $methodName,
|
||||
'count' => $numExecuted,
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return string
|
||||
*/
|
||||
public function getHeader(string $name): string {
|
||||
$name = strtoupper(str_replace('-', '_',$name));
|
||||
$name = strtoupper(str_replace('-', '_', $name));
|
||||
if (isset($this->server['HTTP_' . $name])) {
|
||||
return $this->server['HTTP_' . $name];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class RateLimitingMiddleware extends Middleware {
|
|||
*/
|
||||
public function afterException($controller, $methodName, \Exception $exception) {
|
||||
if ($exception instanceof RateLimitExceededException) {
|
||||
if (stripos($this->request->getHeader('Accept'),'html') === false) {
|
||||
if (stripos($this->request->getHeader('Accept'), 'html') === false) {
|
||||
$response = new DataResponse([], $exception->getCode());
|
||||
} else {
|
||||
$response = new TemplateResponse(
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class SecurityMiddleware extends Middleware {
|
|||
if ($exception instanceof StrictCookieMissingException) {
|
||||
return new RedirectResponse(\OC::$WEBROOT . '/');
|
||||
}
|
||||
if (stripos($this->request->getHeader('Accept'),'html') === false) {
|
||||
if (stripos($this->request->getHeader('Accept'), 'html') === false) {
|
||||
$response = new JSONResponse(
|
||||
['message' => $exception->getMessage()],
|
||||
$exception->getCode()
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class Manager implements IManager {
|
|||
*/
|
||||
public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array {
|
||||
$query = $this->connection->getQueryBuilder();
|
||||
$userId = $user instanceof IUser ? $user->getUID() : '';
|
||||
$userId = $user->getUID();
|
||||
|
||||
$query->select('c.*', 'a.access')
|
||||
->from(self::TABLE_COLLECTIONS, 'c')
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class Adapter {
|
|||
/**
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function insertIgnoreConflict(string $table,array $values) : int {
|
||||
public function insertIgnoreConflict(string $table, array $values) : int {
|
||||
try {
|
||||
$builder = $this->conn->getQueryBuilder();
|
||||
$builder->insert($table);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class AdapterPgSql extends Adapter {
|
|||
return $statement;
|
||||
}
|
||||
|
||||
public function insertIgnoreConflict(string $table,array $values) : int {
|
||||
public function insertIgnoreConflict(string $table, array $values) : int {
|
||||
if ($this->isPre9_5CompatMode() === true) {
|
||||
return parent::insertIgnoreConflict($table, $values);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1182,7 +1182,7 @@ class View {
|
|||
if ($result && in_array('delete', $hooks) and $result) {
|
||||
$this->removeUpdate($storage, $internalPath);
|
||||
}
|
||||
if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
|
||||
if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
|
||||
$this->writeUpdate($storage, $internalPath);
|
||||
}
|
||||
if ($result && in_array('touch', $hooks)) {
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ class Mailer implements IMailer {
|
|||
}
|
||||
|
||||
[$name, $domain] = explode('@', $email, 2);
|
||||
$domain = idn_to_ascii($domain, 0,INTL_IDNA_VARIANT_UTS46);
|
||||
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
||||
return $name.'@'.$domain;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class Memcached extends Cache implements IMemcache {
|
|||
//\Memcached::OPT_BINARY_PROTOCOL => true,
|
||||
];
|
||||
// by default enable igbinary serializer if available
|
||||
/** @psalm-suppress RedundantCondition */
|
||||
if (\Memcached::HAVE_IGBINARY) {
|
||||
$defaultOptions[\Memcached::OPT_SERIALIZER] =
|
||||
\Memcached::SERIALIZER_IGBINARY;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class BackgroundRepair extends TimedJob {
|
|||
try {
|
||||
$repair->addStep($step);
|
||||
} catch (\Exception $ex) {
|
||||
$this->logger->logException($ex,[
|
||||
$this->logger->logException($ex, [
|
||||
'app' => 'migration'
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -338,12 +338,12 @@ class Manager implements IManager {
|
|||
throw new \InvalidArgumentException('The given notification has been processed');
|
||||
}
|
||||
|
||||
if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
|
||||
if (!$notification->isValidParsed()) {
|
||||
throw new \InvalidArgumentException('The given notification has not been handled');
|
||||
}
|
||||
}
|
||||
|
||||
if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
|
||||
if (!$notification->isValidParsed()) {
|
||||
throw new \InvalidArgumentException('The given notification has not been handled');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class MarkDown extends TXT {
|
|||
return null;
|
||||
}
|
||||
|
||||
$content = stream_get_contents($content,3000);
|
||||
$content = stream_get_contents($content, 3000);
|
||||
|
||||
//don't create previews of empty text files
|
||||
if (trim($content) === '') {
|
||||
|
|
@ -119,7 +119,7 @@ class MarkDown extends TXT {
|
|||
// Get rid of markdown symbols that we still needed for the font size
|
||||
$line = preg_replace('/^#*\s/', '', $line);
|
||||
|
||||
$wrappedText = wordwrap($line, $wordWrap,"\n");
|
||||
$wrappedText = wordwrap($line, $wordWrap, "\n");
|
||||
$linesWrapped = count(explode("\n", $wrappedText));
|
||||
imagettftext($image, $actualFontSize, 0, $x, $y, $textColor, $actualFontSize === $fontSize ? $fontFile : $fontFileBold, $wrappedText);
|
||||
$nextLineStart = (int)($linesWrapped * ceil($actualFontSize * 2));
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class TXT extends ProviderV2 {
|
|||
return null;
|
||||
}
|
||||
|
||||
$content = stream_get_contents($content,3000);
|
||||
$content = stream_get_contents($content, 3000);
|
||||
|
||||
//don't create previews of empty text files
|
||||
if (trim($content) === '') {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class TrustedDomainHelper {
|
|||
return true;
|
||||
}
|
||||
// Reject misformed domains in any case
|
||||
if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) {
|
||||
if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) {
|
||||
return false;
|
||||
}
|
||||
// Match, allowing for * wildcards
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class MySQL extends AbstractDatabase {
|
|||
$connection->executeUpdate($query);
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
$this->logger->error('Database user creation failed.',[
|
||||
$this->logger->error('Database user creation failed.', [
|
||||
'exception' => $ex,
|
||||
'app' => 'mysql.setup',
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -847,7 +847,7 @@ class Share extends Constants {
|
|||
* @param array $parameters additional format parameters
|
||||
* @return array format result
|
||||
*/
|
||||
private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE , $parameters = null) {
|
||||
private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) {
|
||||
if ($format === self::FORMAT_NONE) {
|
||||
return $items;
|
||||
} elseif ($format === self::FORMAT_STATUSES) {
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ class DefaultShareProvider implements IShareProvider {
|
|||
);
|
||||
}
|
||||
|
||||
$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
|
||||
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
|
||||
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
|
||||
|
||||
$qb->orderBy('id');
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ class URLGenerator implements IURLGenerator {
|
|||
$theme = \OC_Util::getTheme();
|
||||
|
||||
//if a theme has a png but not an svg always use the png
|
||||
$basename = substr(basename($file),0,-4);
|
||||
$basename = substr(basename($file), 0, -4);
|
||||
|
||||
$appPath = \OC_App::getAppPath($appName);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class OC_DB {
|
|||
*
|
||||
* SQL query via Doctrine prepare(), needs to be execute()'d!
|
||||
*/
|
||||
public static function prepare($query , $limit = null, $offset = null, $isManipulation = null) {
|
||||
public static function prepare($query, $limit = null, $offset = null, $isManipulation = null) {
|
||||
$connection = \OC::$server->getDatabaseConnection();
|
||||
|
||||
if ($isManipulation === null) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class OC_DB_StatementWrapper {
|
|||
/**
|
||||
* pass all other function directly to the \Doctrine\DBAL\Driver\Statement
|
||||
*/
|
||||
public function __call($name,$arguments) {
|
||||
public function __call($name, $arguments) {
|
||||
return call_user_func_array([$this->statement,$name], $arguments);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -848,6 +848,7 @@ class OC_Util {
|
|||
'default_charset' => 'UTF-8',
|
||||
],
|
||||
];
|
||||
/** @var array<array-key, bool|string|int> $missingDependencies */
|
||||
$missingDependencies = [];
|
||||
$invalidIniSettings = [];
|
||||
|
||||
|
|
@ -894,7 +895,7 @@ class OC_Util {
|
|||
}
|
||||
foreach ($invalidIniSettings as $setting) {
|
||||
if (is_bool($setting[1])) {
|
||||
$setting[1] = $setting[1] ? 'on' : 'off';
|
||||
$setting[1] = $setting[1] === true ? 'on' : 'off';
|
||||
}
|
||||
$errors[] = [
|
||||
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ interface IDBConnection {
|
|||
* @return int number of inserted rows
|
||||
* @since 16.0.0
|
||||
*/
|
||||
public function insertIgnoreConflict(string $table,array $values) : int;
|
||||
public function insertIgnoreConflict(string $table, array $values) : int;
|
||||
|
||||
/**
|
||||
* Insert or update a row value
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ $url = $request->getServerProtocol() . '://' . substr($request->getServerHost()
|
|||
|
||||
$writer = new XMLWriter();
|
||||
$writer->openURI('php://output');
|
||||
$writer->startDocument('1.0','UTF-8');
|
||||
$writer->startDocument('1.0', 'UTF-8');
|
||||
$writer->setIndent(true);
|
||||
$writer->startElement('providers');
|
||||
$writer->startElement('provider');
|
||||
|
|
|
|||
|
|
@ -12,16 +12,15 @@
|
|||
</plugins>
|
||||
<projectFiles>
|
||||
<directory name="lib/public"/>
|
||||
<ignoreFiles>
|
||||
<directory name="lib/composer/bin"/>
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
<stubs>
|
||||
<file name="build/stubs/gd.php"/>
|
||||
<file name="build/stubs/ldap.php"/>
|
||||
</stubs>
|
||||
<extraFiles>
|
||||
<directory name="3rdparty"/>
|
||||
</extraFiles>
|
||||
<issueHandlers>
|
||||
<UndefinedDocblockClass>
|
||||
<errorLevel type="suppress">
|
||||
<!-- Classes from PHP>=8 -->
|
||||
<referencedClass name="GdImage" />
|
||||
</errorLevel>
|
||||
</UndefinedDocblockClass>
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
|
|
|
|||
|
|
@ -75,14 +75,14 @@
|
|||
<file name="build/stubs/sftp.php"/>
|
||||
<file name="build/stubs/ssh2.php"/>
|
||||
<file name="build/stubs/xsl.php"/>
|
||||
<file name="build/stubs/ftp.php"/>
|
||||
<file name="build/stubs/pcntl.php"/>
|
||||
</stubs>
|
||||
<issueHandlers>
|
||||
<UndefinedClass>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
|
||||
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
|
||||
<!-- Classes from PHP>=8 (needed to be able to use \GdImage::class) -->
|
||||
<referencedClass name="GdImage" />
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
<UndefinedFunction>
|
||||
|
|
@ -126,8 +126,6 @@
|
|||
<!-- Helper classes for sharing API integration from other apps -->
|
||||
<referencedClass name="OCA\Deck\Sharing\ShareAPIHelper" />
|
||||
<referencedClass name="OCA\Talk\Share\Helper\DeletedShareAPIController" />
|
||||
<!-- Classes from PHP>=8 -->
|
||||
<referencedClass name="GdImage" />
|
||||
</errorLevel>
|
||||
</UndefinedDocblockClass>
|
||||
</issueHandlers>
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@ class QBMapperTest extends \Test\TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->qb = $this->getMockBuilder(IQueryBuilder:: class)
|
||||
$this->qb = $this->getMockBuilder(IQueryBuilder::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$this->expr = $this->getMockBuilder(IExpressionBuilder:: class)
|
||||
$this->expr = $this->getMockBuilder(IExpressionBuilder::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('from.server.name:8080', $request->getInsecureServerHost());
|
||||
$this->assertSame('from.server.name:8080', $request->getInsecureServerHost());
|
||||
}
|
||||
|
||||
public function testInsecureServerHostHttpHostHeader() {
|
||||
|
|
@ -1079,7 +1079,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('from.host.header:8080', $request->getInsecureServerHost());
|
||||
$this->assertSame('from.host.header:8080', $request->getInsecureServerHost());
|
||||
}
|
||||
|
||||
public function testInsecureServerHostHttpFromForwardedHeaderSingle() {
|
||||
|
|
@ -1108,7 +1108,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('from.forwarded.host:8080', $request->getInsecureServerHost());
|
||||
$this->assertSame('from.forwarded.host:8080', $request->getInsecureServerHost());
|
||||
}
|
||||
|
||||
public function testInsecureServerHostHttpFromForwardedHeaderStacked() {
|
||||
|
|
@ -1137,7 +1137,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('from.forwarded.host2:8080', $request->getInsecureServerHost());
|
||||
$this->assertSame('from.forwarded.host2:8080', $request->getInsecureServerHost());
|
||||
}
|
||||
|
||||
public function testGetServerHostWithOverwriteHost() {
|
||||
|
|
@ -1161,7 +1161,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('my.overwritten.host', $request->getServerHost());
|
||||
$this->assertSame('my.overwritten.host', $request->getServerHost());
|
||||
}
|
||||
|
||||
public function testGetServerHostWithTrustedDomain() {
|
||||
|
|
@ -1190,7 +1190,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('my.trusted.host', $request->getServerHost());
|
||||
$this->assertSame('my.trusted.host', $request->getServerHost());
|
||||
}
|
||||
|
||||
public function testGetServerHostWithUntrustedDomain() {
|
||||
|
|
@ -1219,7 +1219,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('my.trusted.host', $request->getServerHost());
|
||||
$this->assertSame('my.trusted.host', $request->getServerHost());
|
||||
}
|
||||
|
||||
public function testGetServerHostWithNoTrustedDomain() {
|
||||
|
|
@ -1245,7 +1245,7 @@ class RequestTest extends \Test\TestCase {
|
|||
$this->stream
|
||||
);
|
||||
|
||||
$this->assertSame('', $request->getServerHost());
|
||||
$this->assertSame('', $request->getServerHost());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
|
|||
->willReturn(Http::STATUS_OK);
|
||||
|
||||
$this->middleWare->beforeController($this->controller, 'myMethod');
|
||||
$this->middleWare->afterController($this->controller,'myMethod', $response);
|
||||
$this->middleWare->afterController($this->controller, 'myMethod', $response);
|
||||
|
||||
$output = 'myoutput';
|
||||
$result = $this->middleWare->beforeOutput($this->controller, 'myMethod', $output);
|
||||
|
|
@ -90,7 +90,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
|
|||
->willReturn(Http::STATUS_OK);
|
||||
|
||||
$this->middleWare->beforeController($this->controller, 'myMethod');
|
||||
$this->middleWare->afterController($this->controller,'myMethod', $response);
|
||||
$this->middleWare->afterController($this->controller, 'myMethod', $response);
|
||||
|
||||
$output = 'myoutput';
|
||||
$result = $this->middleWare->beforeOutput($this->controller, 'myMethod', $output);
|
||||
|
|
@ -112,7 +112,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
|
|||
->willReturn(Http::STATUS_OK);
|
||||
|
||||
$this->middleWare->beforeController($this->controller, 'myMethod');
|
||||
$this->middleWare->afterController($this->controller,'myMethod', $response);
|
||||
$this->middleWare->afterController($this->controller, 'myMethod', $response);
|
||||
|
||||
$output = 'myoutput';
|
||||
$result = $this->middleWare->beforeOutput($this->controller, 'myMethod', $output);
|
||||
|
|
@ -132,7 +132,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
|
|||
$response->method('getStatus')
|
||||
->willReturn(Http::STATUS_OK);
|
||||
$this->middleWare->beforeController($this->controller, 'myMethod');
|
||||
$this->middleWare->afterController($this->controller,'myMethod', $response);
|
||||
$this->middleWare->afterController($this->controller, 'myMethod', $response);
|
||||
|
||||
$output = 'myoutput';
|
||||
$result = $this->middleWare->beforeOutput($this->controller, 'myMethod', $output);
|
||||
|
|
@ -153,7 +153,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
|
|||
->willReturn(Http::STATUS_NOT_FOUND);
|
||||
|
||||
$this->middleWare->beforeController($this->controller, 'myMethod');
|
||||
$this->middleWare->afterController($this->controller,'myMethod', $response);
|
||||
$this->middleWare->afterController($this->controller, 'myMethod', $response);
|
||||
|
||||
$output = 'myoutput';
|
||||
$result = $this->middleWare->beforeOutput($this->controller, 'myMethod', $output);
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class BruteForceMiddlewareTest extends TestCase {
|
|||
|
||||
/** @var Controller|\PHPUnit\Framework\MockObject\MockObject $controller */
|
||||
$controller = $this->createMock(Controller::class);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod' ,$response);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod', $response);
|
||||
}
|
||||
|
||||
public function testAfterControllerWithAnnotationAndNotThrottledRequest() {
|
||||
|
|
@ -165,7 +165,7 @@ class BruteForceMiddlewareTest extends TestCase {
|
|||
|
||||
/** @var Controller|\PHPUnit\Framework\MockObject\MockObject $controller */
|
||||
$controller = $this->createMock(Controller::class);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod' ,$response);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod', $response);
|
||||
}
|
||||
|
||||
public function testAfterControllerWithoutAnnotation() {
|
||||
|
|
@ -188,6 +188,6 @@ class BruteForceMiddlewareTest extends TestCase {
|
|||
$controller = $this->createMock(Controller::class);
|
||||
/** @var Response|\PHPUnit\Framework\MockObject\MockObject $response */
|
||||
$response = $this->createMock(Response::class);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod' ,$response);
|
||||
$this->bruteForceMiddleware->afterController($controller, 'testMethod', $response);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
* @SubAdminRequired
|
||||
*/
|
||||
public function testIsNotSubAdminCheck() {
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
$sec = $this->getMiddleware(true, false, false);
|
||||
|
||||
$this->expectException(SecurityException::class);
|
||||
|
|
@ -448,7 +448,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
* @SubAdminRequired
|
||||
*/
|
||||
public function testIsSubAdminCheck() {
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
$sec = $this->getMiddleware(true, false, true);
|
||||
|
||||
$sec->beforeController($this, __METHOD__);
|
||||
|
|
@ -460,7 +460,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
* @SubAdminRequired
|
||||
*/
|
||||
public function testIsSubAdminAndAdminCheck() {
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
$sec = $this->getMiddleware(true, true, true);
|
||||
|
||||
$sec->beforeController($this, __METHOD__);
|
||||
|
|
@ -513,7 +513,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
new NotLoggedInException()
|
||||
);
|
||||
$expected = new RedirectResponse('http://localhost/nextcloud/index.php/login?redirect_url=nextcloud/index.php/apps/specialapp');
|
||||
$this->assertEquals($expected , $response);
|
||||
$this->assertEquals($expected, $response);
|
||||
}
|
||||
|
||||
public function testAfterExceptionRedirectsToWebRootAfterStrictCookieFail() {
|
||||
|
|
@ -536,7 +536,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
);
|
||||
|
||||
$expected = new RedirectResponse(\OC::$WEBROOT . '/');
|
||||
$this->assertEquals($expected , $response);
|
||||
$this->assertEquals($expected, $response);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
);
|
||||
$expected = new TemplateResponse('core', '403', ['message' => $exception->getMessage()], 'guest');
|
||||
$expected->setStatus($exception->getCode());
|
||||
$this->assertEquals($expected , $response);
|
||||
$this->assertEquals($expected, $response);
|
||||
}
|
||||
|
||||
public function testAfterAjaxExceptionReturnsJSONError() {
|
||||
|
|
@ -614,7 +614,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
*/
|
||||
public function testRestrictedAppLoggedInPublicPage() {
|
||||
$middleware = $this->getMiddleware(true, false, false);
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
|
||||
$this->appManager->method('getAppPath')
|
||||
->with('files')
|
||||
|
|
@ -635,7 +635,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
*/
|
||||
public function testRestrictedAppNotLoggedInPublicPage() {
|
||||
$middleware = $this->getMiddleware(false, false, false);
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
|
||||
$this->appManager->method('getAppPath')
|
||||
->with('files')
|
||||
|
|
@ -655,7 +655,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
*/
|
||||
public function testRestrictedAppLoggedIn() {
|
||||
$middleware = $this->getMiddleware(true, false, false, false);
|
||||
$this->reader->reflect(__CLASS__,__FUNCTION__);
|
||||
$this->reader->reflect(__CLASS__, __FUNCTION__);
|
||||
|
||||
$this->appManager->method('getAppPath')
|
||||
->with('files')
|
||||
|
|
|
|||
|
|
@ -258,8 +258,8 @@ class UserAvatarTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testMixPalette() {
|
||||
$colorFrom = new \OC\Color(0,0,0);
|
||||
$colorTo = new \OC\Color(6,12,18);
|
||||
$colorFrom = new \OC\Color(0, 0, 0);
|
||||
$colorTo = new \OC\Color(6, 12, 18);
|
||||
$steps = 6;
|
||||
$palette = $this->invokePrivate($this->avatar, 'mixPalette', [$steps, $colorFrom, $colorTo]);
|
||||
foreach ($palette as $j => $color) {
|
||||
|
|
@ -268,7 +268,7 @@ class UserAvatarTest extends \Test\TestCase {
|
|||
$incG = $colorTo->g / $steps * $j;
|
||||
$incB = $colorTo->b / $steps * $j;
|
||||
// ensure everything is equal
|
||||
$this->assertEquals($color, new \OC\Color($incR, $incG,$incB));
|
||||
$this->assertEquals($color, new \OC\Color($incR, $incG, $incB));
|
||||
}
|
||||
$hashToInt = $this->invokePrivate($this->avatar, 'hashToInt', ['abcdef', 18]);
|
||||
$this->assertTrue(gettype($hashToInt) === 'integer');
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class FileCacheTest extends TestCache {
|
|||
$this->storage = \OC\Files\Filesystem::getStorage('/');
|
||||
\OC\Files\Filesystem::clearMounts();
|
||||
$storage = new \OC\Files\Storage\Temporary([]);
|
||||
\OC\Files\Filesystem::mount($storage,[],'/');
|
||||
\OC\Files\Filesystem::mount($storage, [], '/');
|
||||
$datadir = str_replace('local::', '', $storage->getId());
|
||||
$config = \OC::$server->getConfig();
|
||||
$this->datadir = $config->getSystemValue('cachedirectory', \OC::$SERVERROOT.'/data/cache');
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ class ExpressionBuilderDBTest extends TestCase {
|
|||
$query->createFunction(
|
||||
'(' . $query->expr()->castColumn('configvalue', IQueryBuilder::PARAM_INT)
|
||||
. ' + 1)'
|
||||
)
|
||||
, IQueryBuilder::PARAM_STR
|
||||
), IQueryBuilder::PARAM_STR
|
||||
)
|
||||
)
|
||||
->where($query->expr()->eq('appid', $query->createNamedParameter($appId)))
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class DateTimeFormatterTest extends TestCase {
|
|||
['in 2 years', $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 2)],
|
||||
|
||||
// Test with compare timestamp
|
||||
['today', $this->getTimestampAgo($time, 0, 0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
|
||||
['today', $this->getTimestampAgo($time, 0, 0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
|
||||
['yesterday', $this->getTimestampAgo($time, 30, 15, 3, 1, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
|
||||
['4 days ago', $this->getTimestampAgo($time, 30, 15, 3, 4, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
|
||||
['5 months ago', $this->getTimestampAgo($time, 30, 15, 3, 155, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ class StorageTest extends TestCase {
|
|||
/**
|
||||
* @dataProvider dataProviderCopyRename
|
||||
*/
|
||||
public function testCopyKeys($source, $target, $systemWideMountSource, $systemWideMountTarget , $expectedSource, $expectedTarget) {
|
||||
public function testCopyKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget) {
|
||||
$this->view->expects($this->any())
|
||||
->method('file_exists')
|
||||
->willReturn(true);
|
||||
|
|
|
|||
|
|
@ -399,23 +399,17 @@ class CacheTest extends \Test\TestCase {
|
|||
$user = $this->createMock(IUser::class);
|
||||
|
||||
$this->assertCount(1, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', 'foo')
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', 'foo'), 10, 0, [], $user)));
|
||||
$this->assertCount(2, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', 'foo%')
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', 'foo%'), 10, 0, [], $user)));
|
||||
$this->assertCount(2, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'mimetype', 'foo/file')
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'mimetype', 'foo/file'), 10, 0, [], $user)));
|
||||
$this->assertCount(3, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'mimetype', 'foo/%')
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'mimetype', 'foo/%'), 10, 0, [], $user)));
|
||||
$this->assertCount(1, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_GREATER_THAN, 'size', 100)
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_GREATER_THAN, 'size', 100), 10, 0, [], $user)));
|
||||
$this->assertCount(2, $this->cache->searchQuery(new SearchQuery(
|
||||
new SearchComparison(ISearchComparison::COMPARE_GREATER_THAN_EQUAL, 'size', 100)
|
||||
, 10, 0, [], $user)));
|
||||
new SearchComparison(ISearchComparison::COMPARE_GREATER_THAN_EQUAL, 'size', 100), 10, 0, [], $user)));
|
||||
}
|
||||
|
||||
public function movePathProvider() {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class ObjectStoreStorageTest extends Storage {
|
|||
*/
|
||||
public function testMove($source, $target) {
|
||||
$this->initSourceAndTarget($source);
|
||||
$sourceId = $this->instance->getCache()->getId(ltrim('/',$source));
|
||||
$sourceId = $this->instance->getCache()->getId(ltrim('/', $source));
|
||||
$this->assertNotEquals(-1, $sourceId);
|
||||
|
||||
$this->instance->rename($source, $target);
|
||||
|
|
@ -98,7 +98,7 @@ class ObjectStoreStorageTest extends Storage {
|
|||
$this->assertFalse($this->instance->file_exists($source), $source.' still exists');
|
||||
$this->assertSameAsLorem($target);
|
||||
|
||||
$targetId = $this->instance->getCache()->getId(ltrim('/',$target));
|
||||
$targetId = $this->instance->getCache()->getId(ltrim('/', $target));
|
||||
$this->assertSame($sourceId, $targetId, 'fileid must be stable on move or shares will break');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class L10nTest extends TestCase {
|
|||
|
||||
public function testRussianPluralTranslations() {
|
||||
$transFile = \OC::$SERVERROOT.'/tests/data/l10n/ru.json';
|
||||
$l = new L10N($this->getFactory(), 'test', 'ru', 'ru_UA',[$transFile]);
|
||||
$l = new L10N($this->getFactory(), 'test', 'ru', 'ru_UA', [$transFile]);
|
||||
|
||||
$this->assertEquals('1 файл', (string)$l->n('%n file', '%n files', 1));
|
||||
$this->assertEquals('2 файла', (string)$l->n('%n file', '%n files', 2));
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class MessageTest extends TestCase {
|
|||
/**
|
||||
* @dataProvider getMailAddressProvider
|
||||
*/
|
||||
public function testGetTo($swiftresult,$return) {
|
||||
public function testGetTo($swiftresult, $return) {
|
||||
$this->swiftMessage
|
||||
->expects($this->once())
|
||||
->method('getTo')
|
||||
|
|
@ -133,7 +133,7 @@ class MessageTest extends TestCase {
|
|||
/**
|
||||
* @dataProvider getMailAddressProvider
|
||||
*/
|
||||
public function testGetCc($swiftresult,$return) {
|
||||
public function testGetCc($swiftresult, $return) {
|
||||
$this->swiftMessage
|
||||
->expects($this->once())
|
||||
->method('getCc')
|
||||
|
|
@ -153,7 +153,7 @@ class MessageTest extends TestCase {
|
|||
/**
|
||||
* @dataProvider getMailAddressProvider
|
||||
*/
|
||||
public function testGetBcc($swiftresult,$return) {
|
||||
public function testGetBcc($swiftresult, $return) {
|
||||
$this->swiftMessage
|
||||
->expects($this->once())
|
||||
->method('getBcc')
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class HasherTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
|
||||
$this->assertTrue($this->hasher->verify($message, $blowfish,$newHash));
|
||||
$this->assertTrue($this->hasher->verify($message, $blowfish, $newHash));
|
||||
$this->assertTrue($this->hasher->verify($message, $argon2));
|
||||
|
||||
$relativePath = self::invokePrivate($this->hasher, 'splitHash', [$newHash]);
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|||
$this->rootFolder->method('getUserFolder')->with('shareOwner')->willReturnSelf();
|
||||
$this->rootFolder->method('getById')->with($fileId)->willReturn([$file]);
|
||||
|
||||
$share = $this->provider->getSharedWith('sharedWith', IShare::TYPE_USER, null, 1 , 0);
|
||||
$share = $this->provider->getSharedWith('sharedWith', IShare::TYPE_USER, null, 1, 0);
|
||||
$this->assertCount(1, $share);
|
||||
|
||||
$share = $share[0];
|
||||
|
|
@ -1023,7 +1023,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|||
$this->rootFolder->method('getUserFolder')->with('shareOwner')->willReturnSelf();
|
||||
$this->rootFolder->method('getById')->with($fileId)->willReturn([$file]);
|
||||
|
||||
$share = $this->provider->getSharedWith('sharedWith', IShare::TYPE_GROUP, null, 20 , 1);
|
||||
$share = $this->provider->getSharedWith('sharedWith', IShare::TYPE_GROUP, null, 20, 1);
|
||||
$this->assertCount(1, $share);
|
||||
|
||||
$share = $share[0];
|
||||
|
|
@ -1267,7 +1267,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|||
]);
|
||||
$this->groupManager->method('getUserGroupIds')->with($user)->willReturn($groups);
|
||||
|
||||
$share = $this->provider->getSharedWith('sharedWith', $shareType, null, 1 , 0);
|
||||
$share = $this->provider->getSharedWith('sharedWith', $shareType, null, 1, 0);
|
||||
$this->assertCount(0, $share);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->getMock();
|
||||
|
||||
$date = new \DateTime();
|
||||
$date->setTime(0,0,0);
|
||||
$date->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($date)
|
||||
|
|
@ -586,30 +586,30 @@ class ManagerTest extends \Test\TestCase {
|
|||
->willReturn($storage);
|
||||
|
||||
$data = [
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, null, $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $group0, $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, 'foo@bar.com', $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, null, $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $group0, $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, 'foo@bar.com', $user0, $user0, 31, null, null), 'SharedWith is not a valid user', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, $file, null, $user0, $user0, 31, null, null), 'SharedWith is not a valid group', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, $file, $user2, $user0, $user0, 31, null, null), 'SharedWith is not a valid group', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, $file, 'foo@bar.com', $user0, $user0, 31, null, null), 'SharedWith is not a valid group', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, $user2, $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, $group0, $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, 'foo@bar.com', $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, $user2, $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, $group0, $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, 'foo@bar.com', $user0, $user0, 31, null, null), 'SharedWith should be empty', true],
|
||||
[$this->createShare(null, -1, $file, null, $user0, $user0, 31, null, null), 'unknown share type', true],
|
||||
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $user2, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $user2, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, $file, $group0, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, null, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $file, null, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $user0, $user0, $user0, 31, null, null), 'Cannot share with yourself', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $file, $user0, $user0, $user0, 31, null, null), 'Cannot share with yourself', true],
|
||||
|
||||
[$this->createShare(null, IShare::TYPE_USER, null, $user2, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, null, $user2, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, null, $group0, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, null, null, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, null, null, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||
|
||||
[$this->createShare(null, IShare::TYPE_USER, $node, $user2, $user0, $user0, 31, null, null), 'Path should be either a file or a folder', true],
|
||||
[$this->createShare(null, IShare::TYPE_USER, $node, $user2, $user0, $user0, 31, null, null), 'Path should be either a file or a folder', true],
|
||||
[$this->createShare(null, IShare::TYPE_GROUP, $node, $group0, $user0, $user0, 31, null, null), 'Path should be either a file or a folder', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $node, null, $user0, $user0, 31, null, null), 'Path should be either a file or a folder', true],
|
||||
[$this->createShare(null, IShare::TYPE_LINK, $node, null, $user0, $user0, 31, null, null), 'Path should be either a file or a folder', true],
|
||||
];
|
||||
|
||||
$nonShareAble = $this->createMock(Folder::class);
|
||||
|
|
@ -621,9 +621,9 @@ class ManagerTest extends \Test\TestCase {
|
|||
$nonShareAble->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonShareAble, $user2, $user0, $user0, 31, null, null), 'You are not allowed to share name', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonShareAble, $user2, $user0, $user0, 31, null, null), 'You are not allowed to share name', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $nonShareAble, $group0, $user0, $user0, 31, null, null), 'You are not allowed to share name', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $nonShareAble, null, $user0, $user0, 31, null, null), 'You are not allowed to share name', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $nonShareAble, null, $user0, $user0, 31, null, null), 'You are not allowed to share name', true];
|
||||
|
||||
$limitedPermssions = $this->createMock(File::class);
|
||||
$limitedPermssions->method('isShareable')->willReturn(true);
|
||||
|
|
@ -636,17 +636,17 @@ class ManagerTest extends \Test\TestCase {
|
|||
$limitedPermssions->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, null, null, null), 'A share requires permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, null, null, null), 'A share requires permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, null, null, null), 'A share requires permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, null, null, null), 'A share requires permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, null, null, null), 'A share requires permissions', true];
|
||||
|
||||
$mount = $this->createMock(MoveableMount::class);
|
||||
$limitedPermssions->method('getMountPoint')->willReturn($mount);
|
||||
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, 31, null, null), 'Cannot increase permissions of path', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, 31, null, null), 'Cannot increase permissions of path', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Cannot increase permissions of path', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true];
|
||||
|
||||
$nonMoveableMountPermssions = $this->createMock(Folder::class);
|
||||
$nonMoveableMountPermssions->method('isShareable')->willReturn(true);
|
||||
|
|
@ -659,7 +659,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
$nonMoveableMountPermssions->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonMoveableMountPermssions, $user2, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonMoveableMountPermssions, $user2, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $nonMoveableMountPermssions, $group0, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false];
|
||||
|
||||
$rootFolder = $this->createMock(Folder::class);
|
||||
|
|
@ -667,9 +667,9 @@ class ManagerTest extends \Test\TestCase {
|
|||
$rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
|
||||
$rootFolder->method('getId')->willReturn(42);
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You cannot share your root folder', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You cannot share your root folder', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $rootFolder, $group0, $user0, $user0, 2, null, null), 'You cannot share your root folder', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You cannot share your root folder', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You cannot share your root folder', true];
|
||||
|
||||
$allPermssions = $this->createMock(Folder::class);
|
||||
$allPermssions->method('isShareable')->willReturn(true);
|
||||
|
|
@ -680,12 +680,12 @@ class ManagerTest extends \Test\TestCase {
|
|||
$allPermssions->method('getStorage')
|
||||
->willReturn($storage);
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $allPermssions, $user2, $user0, $user0, 30, null, null), 'Shares need at least read permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $allPermssions, $user2, $user0, $user0, 30, null, null), 'Shares need at least read permissions', true];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $allPermssions, $group0, $user0, $user0, 2, null, null), 'Shares need at least read permissions', true];
|
||||
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $allPermssions, $user2, $user0, $user0, 31, null, null), null, false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $allPermssions, $user2, $user0, $user0, 31, null, null), null, false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $allPermssions, $group0, $user0, $user0, 3, null, null), null, false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $allPermssions, null, $user0, $user0, 17, null, null), null, false];
|
||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $allPermssions, null, $user0, $user0, 17, null, null), null, false];
|
||||
|
||||
|
||||
$remoteStorage = $this->createMock(Storage\IStorage::class);
|
||||
|
|
@ -881,7 +881,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
$expected = new \DateTime();
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
$expected->add(new \DateInterval('P3D'));
|
||||
|
||||
self::invokePrivate($this->manager, 'validateExpirationDateInternal', [$share]);
|
||||
|
|
@ -916,7 +916,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
$expected = new \DateTime();
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
$expected->add(new \DateInterval('P1D'));
|
||||
|
||||
self::invokePrivate($this->manager, 'validateExpirationDateInternal', [$share]);
|
||||
|
|
@ -964,10 +964,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateInternalEnforceValid($shareType) {
|
||||
$future = new \DateTime();
|
||||
$future->add(new \DateInterval('P2D'));
|
||||
$future->setTime(1,2,3);
|
||||
$future->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $future;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setShareType($shareType);
|
||||
|
|
@ -1006,10 +1006,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateInternalNoDefault($shareType) {
|
||||
$date = new \DateTime();
|
||||
$date->add(new \DateInterval('P5D'));
|
||||
$date->setTime(1,2,3);
|
||||
$date->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $date;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setShareType($shareType);
|
||||
|
|
@ -1054,7 +1054,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
|
||||
$expected = new \DateTime();
|
||||
$expected->add(new \DateInterval('P3D'));
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
if ($shareType === IShare::TYPE_USER) {
|
||||
$this->config->method('getAppValue')
|
||||
|
|
@ -1089,10 +1089,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateInternalDefault($shareType) {
|
||||
$future = new \DateTime();
|
||||
$future->add(new \DateInterval('P5D'));
|
||||
$future->setTime(1,2,3);
|
||||
$future->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $future;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setShareType($shareType);
|
||||
|
|
@ -1131,7 +1131,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateInternalHookModification($shareType) {
|
||||
$nextWeek = new \DateTime();
|
||||
$nextWeek->add(new \DateInterval('P7D'));
|
||||
$nextWeek->setTime(0,0,0);
|
||||
$nextWeek->setTime(0, 0, 0);
|
||||
|
||||
$save = clone $nextWeek;
|
||||
|
||||
|
|
@ -1160,7 +1160,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
|
||||
$nextWeek = new \DateTime();
|
||||
$nextWeek->add(new \DateInterval('P7D'));
|
||||
$nextWeek->setTime(0,0,0);
|
||||
$nextWeek->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setShareType($shareType);
|
||||
|
|
@ -1259,7 +1259,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]);
|
||||
|
||||
$expected = new \DateTime();
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
$expected->add(new \DateInterval('P3D'));
|
||||
|
||||
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
|
||||
|
|
@ -1280,7 +1280,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]);
|
||||
|
||||
$expected = new \DateTime();
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
$expected->add(new \DateInterval('P1D'));
|
||||
|
||||
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
|
||||
|
|
@ -1312,10 +1312,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateEnforceValid() {
|
||||
$future = new \DateTime();
|
||||
$future->add(new \DateInterval('P2D'));
|
||||
$future->setTime(1,2,3);
|
||||
$future->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $future;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($future);
|
||||
|
|
@ -1341,10 +1341,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateNoDefault() {
|
||||
$date = new \DateTime();
|
||||
$date->add(new \DateInterval('P5D'));
|
||||
$date->setTime(1,2,3);
|
||||
$date->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $date;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($date);
|
||||
|
|
@ -1380,7 +1380,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
|
||||
$expected = new \DateTime();
|
||||
$expected->add(new \DateInterval('P3D'));
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$this->config->method('getAppValue')
|
||||
->willReturnMap([
|
||||
|
|
@ -1403,10 +1403,10 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateDefault() {
|
||||
$future = new \DateTime();
|
||||
$future->add(new \DateInterval('P5D'));
|
||||
$future->setTime(1,2,3);
|
||||
$future->setTime(1, 2, 3);
|
||||
|
||||
$expected = clone $future;
|
||||
$expected->setTime(0,0,0);
|
||||
$expected->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($future);
|
||||
|
|
@ -1432,7 +1432,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
public function testValidateExpirationDateHookModification() {
|
||||
$nextWeek = new \DateTime();
|
||||
$nextWeek->add(new \DateInterval('P7D'));
|
||||
$nextWeek->setTime(0,0,0);
|
||||
$nextWeek->setTime(0, 0, 0);
|
||||
|
||||
$save = clone $nextWeek;
|
||||
|
||||
|
|
@ -1457,7 +1457,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
|
||||
$nextWeek = new \DateTime();
|
||||
$nextWeek->add(new \DateInterval('P7D'));
|
||||
$nextWeek->setTime(0,0,0);
|
||||
$nextWeek->setTime(0, 0, 0);
|
||||
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($nextWeek);
|
||||
|
|
@ -2615,7 +2615,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
$today = new \DateTime();
|
||||
$today->setTime(0,0,0);
|
||||
$today->setTime(0, 0, 0);
|
||||
|
||||
/*
|
||||
* Set the expiration date to today for some shares
|
||||
|
|
@ -2840,7 +2840,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->getMock();
|
||||
|
||||
$date = new \DateTime();
|
||||
$date->setTime(0,0,0);
|
||||
$date->setTime(0, 0, 0);
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($date);
|
||||
|
||||
|
|
@ -2864,7 +2864,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->willReturn('yes');
|
||||
|
||||
$date = new \DateTime();
|
||||
$date->setTime(0,0,0);
|
||||
$date->setTime(0, 0, 0);
|
||||
$date->add(new \DateInterval('P2D'));
|
||||
$share = $this->manager->newShare();
|
||||
$share->setExpirationDate($date);
|
||||
|
|
@ -3184,7 +3184,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setPermissions(15);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3265,7 +3265,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setPermissions(15);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3331,7 +3331,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setPermissions(\OCP\Constants::PERMISSION_ALL);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3413,7 +3413,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3496,7 +3496,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3587,7 +3587,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3660,7 +3660,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3733,7 +3733,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3806,7 +3806,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(false);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3880,7 +3880,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(true);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
@ -3954,7 +3954,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->setSendPasswordByTalk(true);
|
||||
|
||||
$tomorrow = new \DateTime();
|
||||
$tomorrow->setTime(0,0,0);
|
||||
$tomorrow->setTime(0, 0, 0);
|
||||
$tomorrow->add(new \DateInterval('P1D'));
|
||||
|
||||
$file = $this->createMock(File::class);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class UserTest extends TestCase {
|
|||
});
|
||||
|
||||
$user = new User('foo', $backend, $this->dispatcher);
|
||||
$this->assertTrue($user->setPassword('bar',''));
|
||||
$this->assertTrue($user->setPassword('bar', ''));
|
||||
}
|
||||
|
||||
public function testSetPasswordNotSupported() {
|
||||
|
|
@ -133,7 +133,7 @@ class UserTest extends TestCase {
|
|||
->willReturn(false);
|
||||
|
||||
$user = new User('foo', $backend, $this->dispatcher);
|
||||
$this->assertFalse($user->setPassword('bar',''));
|
||||
$this->assertFalse($user->setPassword('bar', ''));
|
||||
}
|
||||
|
||||
public function testChangeAvatarSupportedYes() {
|
||||
|
|
@ -389,12 +389,12 @@ class UserTest extends TestCase {
|
|||
|
||||
$backend->expects($this->once())
|
||||
->method('setDisplayName')
|
||||
->with('foo','Foo')
|
||||
->with('foo', 'Foo')
|
||||
->willReturn(true);
|
||||
|
||||
$user = new User('foo', $backend, $this->dispatcher);
|
||||
$this->assertTrue($user->setDisplayName('Foo'));
|
||||
$this->assertEquals('Foo',$user->getDisplayName());
|
||||
$this->assertEquals('Foo', $user->getDisplayName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -418,7 +418,7 @@ class UserTest extends TestCase {
|
|||
|
||||
$user = new User('foo', $backend, $this->dispatcher);
|
||||
$this->assertFalse($user->setDisplayName(' '));
|
||||
$this->assertEquals('foo',$user->getDisplayName());
|
||||
$this->assertEquals('foo', $user->getDisplayName());
|
||||
}
|
||||
|
||||
public function testSetDisplayNameNotSupported() {
|
||||
|
|
@ -436,7 +436,7 @@ class UserTest extends TestCase {
|
|||
|
||||
$user = new User('foo', $backend, $this->dispatcher);
|
||||
$this->assertFalse($user->setDisplayName('Foo'));
|
||||
$this->assertEquals('foo',$user->getDisplayName());
|
||||
$this->assertEquals('foo', $user->getDisplayName());
|
||||
}
|
||||
|
||||
public function testSetPasswordHooks() {
|
||||
|
|
@ -476,7 +476,7 @@ class UserTest extends TestCase {
|
|||
|
||||
$user = new User('foo', $backend, $this->dispatcher, $emitter);
|
||||
|
||||
$user->setPassword('bar','');
|
||||
$user->setPassword('bar', '');
|
||||
$this->assertEquals(2, $hooksCalled);
|
||||
}
|
||||
|
||||
|
|
|
|||
11
vendor-bin/cs-fixer/composer.json
Normal file
11
vendor-bin/cs-fixer/composer.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.3"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"friendsofphp/php-cs-fixer": "^3.4.0",
|
||||
"nextcloud/coding-standard": "^1.0.0"
|
||||
}
|
||||
}
|
||||
2161
vendor-bin/cs-fixer/composer.lock
generated
Normal file
2161
vendor-bin/cs-fixer/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
13
vendor-bin/psalm/composer.json
Normal file
13
vendor-bin/psalm/composer.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"require": {
|
||||
"vimeo/psalm": "^4.18"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.3"
|
||||
},
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true
|
||||
}
|
||||
}
|
||||
}
|
||||
2143
vendor-bin/psalm/composer.lock
generated
Normal file
2143
vendor-bin/psalm/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue