Merge pull request #23480 from nextcloud/backport/23401/stable20

[stable20] Use own psalm instead of a global one
This commit is contained in:
Morris Jobke 2020-10-16 13:22:33 +02:00 committed by GitHub
commit 3c1a745301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1148 additions and 131 deletions

View File

@ -13,13 +13,17 @@ jobs:
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Remove composer.json
shell: bash
run: rm composer.json composer.lock
- name: Psalm
uses: docker://jakzal/phpqa:php7.4-alpine
- name: Set up php7.4
uses: shivammathur/setup-php@master
with:
args: psalm --monochrome --no-progress --output-format=text --update-baseline || ( git diff && exit 1 )
php-version: 7.4
coverage: none
- name: Composer install
run: composer i
- name: Psalm
run: composer run psalm -- --monochrome --no-progress --output-format=text --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 )
- name: Check diff
run: git diff -- . ':!lib/composer'
- name: Show potential changes in Psalm baseline
run: |
bash -c "[[ ! \"`git status --porcelain build/psalm-baseline.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)"

View File

@ -397,7 +397,10 @@
</UndefinedFunction>
</file>
<file src="apps/dav/lib/CalDAV/Schedule/IMipPlugin.php">
<ImplicitToStringCast occurrences="2"/>
<ImplicitToStringCast occurrences="2">
<code>$vevent-&gt;SUMMARY</code>
<code>$vevent-&gt;LOCATION</code>
</ImplicitToStringCast>
<InvalidNullableReturnType occurrences="1">
<code>string</code>
</InvalidNullableReturnType>
@ -409,6 +412,11 @@
<code>$lang-&gt;getValue()</code>
</NullableReturnStatement>
<UndefinedMethod occurrences="15">
<code>getDateTime</code>
<code>getDateTime</code>
<code>getDateTime</code>
<code>hasTime</code>
<code>getDateTime</code>
<code>isFloating</code>
<code>getDateTime</code>
<code>setDateTime</code>
@ -418,11 +426,6 @@
<code>setDateTime</code>
<code>getDateTime</code>
<code>getDateTime</code>
<code>getDateTime</code>
<code>hasTime</code>
<code>getDateTime</code>
<code>getDateTime</code>
<code>getDateTime</code>
<code>isFloating</code>
</UndefinedMethod>
<UndefinedPropertyFetch occurrences="1">
@ -1069,6 +1072,43 @@
<code>\Sabre\Uri\split($this-&gt;principalInfo['uri'])</code>
</UndefinedFunction>
</file>
<file src="apps/encryption/lib/AppInfo/Application.php">
<UndefinedClass occurrences="33">
<code>'UserSetup'</code>
<code>'KeyManager'</code>
<code>'UserSetup'</code>
<code>'Util'</code>
<code>'Session'</code>
<code>'Crypt'</code>
<code>'Recovery'</code>
<code>'Crypt'</code>
<code>'KeyManager'</code>
<code>'Util'</code>
<code>'Session'</code>
<code>'EncryptAll'</code>
<code>'DecryptAll'</code>
<code>'Crypt'</code>
<code>'Util'</code>
<code>'Crypt'</code>
<code>'KeyManager'</code>
<code>'Recovery'</code>
<code>'Session'</code>
<code>'KeyManager'</code>
<code>'Crypt'</code>
<code>'Session'</code>
<code>'Util'</code>
<code>'Crypt'</code>
<code>'KeyManager'</code>
<code>'Crypt'</code>
<code>'UserSetup'</code>
<code>'KeyManager'</code>
<code>'Util'</code>
<code>'Util'</code>
<code>'KeyManager'</code>
<code>'Crypt'</code>
<code>'Session'</code>
</UndefinedClass>
</file>
<file src="apps/encryption/lib/Command/ScanLegacyFormat.php">
<RedundantCondition occurrences="1">
<code>$result</code>
@ -1714,6 +1754,13 @@
<code>$_</code>
</UndefinedVariable>
</file>
<file src="apps/files_sharing/lib/AppInfo/Application.php">
<UndefinedClass occurrences="3">
<code>'ExternalMountProvider'</code>
<code>'OCP\Collaboration\Resources::loadAdditionalScripts'</code>
<code>'OCP\Share::postShare'</code>
</UndefinedClass>
</file>
<file src="apps/files_sharing/lib/Cache.php">
<FalsableReturnStatement occurrences="1">
<code>false</code>
@ -1744,6 +1791,9 @@
</UndefinedInterfaceMethod>
</file>
<file src="apps/files_sharing/lib/Controller/DeletedShareAPIController.php">
<UndefinedClass occurrences="1">
<code>'\OCA\Talk\Share\Helper\DeletedShareAPIController'</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="2">
<code>$this-&gt;getRoomShareHelper()</code>
<code>\OCA\Talk\Share\Helper\DeletedShareAPIController</code>
@ -1767,8 +1817,9 @@
<TypeDoesNotContainType occurrences="1">
<code>$date === false</code>
</TypeDoesNotContainType>
<UndefinedClass occurrences="2">
<UndefinedClass occurrences="3">
<code>\OCA\Circles\Api\v1\Circles</code>
<code>'\OCA\Talk\Share\Helper\ShareAPIController'</code>
<code>\OCA\Circles\Api\v1\Circles</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="4">
@ -1902,7 +1953,6 @@
<code>false</code>
<code>false</code>
<code>$this-&gt;nonMaskedStorage-&gt;fopen($this-&gt;getUnjailedPath($path), $mode)</code>
<code>false</code>
</FalsableReturnStatement>
<InvalidNullableReturnType occurrences="1">
<code>ICacheEntry</code>
@ -1941,11 +1991,13 @@
</InvalidArgument>
<TooManyArguments occurrences="1">
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
<code>dispatch</code>
</TooManyArguments>
</file>
<file src="apps/files_trashbin/lib/BackgroundJob/ExpireTrash.php">
<UndefinedClass occurrences="1">
<code>'Expiration'</code>
</UndefinedClass>
</file>
<file src="apps/files_trashbin/lib/Sabre/AbstractTrash.php">
<InvalidNullableReturnType occurrences="1">
<code>int</code>
@ -2034,6 +2086,10 @@
<code>$timestamp</code>
<code>$timestamp</code>
</InvalidScalarArgument>
<UndefinedClass occurrences="2">
<code>'Expiration'</code>
<code>'Expiration'</code>
</UndefinedClass>
</file>
<file src="apps/files_versions/appinfo/routes.php">
<InvalidScope occurrences="2">
@ -2079,6 +2135,11 @@
<code>getURLGenerator</code>
</TooManyArguments>
</file>
<file src="apps/lookup_server_connector/lib/AppInfo/Application.php">
<UndefinedClass occurrences="1">
<code>'OC\AccountManager::userUpdated'</code>
</UndefinedClass>
</file>
<file src="apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php">
<InvalidArrayOffset occurrences="10">
<code>$publicData[IAccountManager::PROPERTY_DISPLAYNAME]['value']</code>
@ -2138,6 +2199,9 @@
<InvalidScalarArgument occurrences="1">
<code>\OC_User::getUser()</code>
</InvalidScalarArgument>
<UndefinedClass occurrences="1">
<code>'ServerContainer'</code>
</UndefinedClass>
<UndefinedInterfaceMethod occurrences="1">
<code>getSettingsManager</code>
</UndefinedInterfaceMethod>
@ -2183,6 +2247,11 @@
<code>$this-&gt;l10n-&gt;t('You need to set your user email before being able to send test emails.')</code>
</InvalidArgument>
</file>
<file src="apps/settings/lib/Controller/UsersController.php">
<UndefinedClass occurrences="1">
<code>'OC\Settings\Users::loadAdditionalScripts'</code>
</UndefinedClass>
</file>
<file src="apps/settings/lib/Hooks.php">
<InvalidArgument occurrences="1">
<code>[$user-&gt;getEMailAddress() =&gt; $user-&gt;getDisplayName()]</code>
@ -2297,14 +2366,6 @@
<code>$iconFile !== false</code>
</RedundantCondition>
</file>
<file src="apps/theming/lib/Controller/ThemingController.php">
<InvalidScalarArgument occurrences="4">
<code>'r'</code>
<code>$newHeight</code>
<code>'r'</code>
<code>'r'</code>
</InvalidScalarArgument>
</file>
<file src="apps/theming/lib/IconBuilder.php">
<InvalidScalarArgument occurrences="2">
<code>$offset_w</code>
@ -2769,6 +2830,7 @@
</file>
<file src="apps/user_status/lib/Db/UserStatusMapper.php">
<ImplicitToStringCast occurrences="2">
<code>$qb-&gt;createNamedParameter([IUserStatus::ONLINE, IUserStatus::AWAY, IUserStatus::OFFLINE], IQueryBuilder::PARAM_STR_ARRAY)</code>
<code>$qb-&gt;createNamedParameter($userIds, IQueryBuilder::PARAM_STR_ARRAY)</code>
</ImplicitToStringCast>
<MoreSpecificImplementedParamType occurrences="1"/>
@ -2843,11 +2905,12 @@
<InvalidPropertyAssignmentValue occurrences="1">
<code>[]</code>
</InvalidPropertyAssignmentValue>
<InvalidReturnStatement occurrences="1">
<InvalidReturnStatement occurrences="2">
<code>array_merge($this-&gt;getBuildInChecks(), $this-&gt;registeredChecks)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<InvalidReturnType occurrences="2">
<code>ICheck[]</code>
<code>IEntity[]</code>
</InvalidReturnType>
<InvalidScalarArgument occurrences="1">
<code>$missingCheck</code>
@ -2875,6 +2938,11 @@
<code>getChecks</code>
</UndefinedInterfaceMethod>
</file>
<file src="apps/workflowengine/lib/Settings/ASettings.php">
<UndefinedClass occurrences="1">
<code>'OCP\WorkflowEngine::loadAdditionalSettingScripts'</code>
</UndefinedClass>
</file>
<file src="apps/workflowengine/lib/Settings/Personal.php">
<InvalidNullableReturnType occurrences="1">
<code>getSection</code>
@ -2909,6 +2977,11 @@
<code>array</code>
</LessSpecificImplementedReturnType>
</file>
<file src="core/Command/Broadcast/Test.php">
<UndefinedClass occurrences="1">
<code>broadcasttest</code>
</UndefinedClass>
</file>
<file src="core/Command/Config/App/GetConfig.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>null|int</code>
@ -3140,6 +3213,7 @@
<InvalidScope occurrences="2">
<code>$this</code>
<code>$this</code>
<code>$this</code>
</InvalidScope>
</file>
<file src="core/templates/layout.public.php">
@ -3161,6 +3235,9 @@
<RedundantCondition occurrences="1">
<code>((array)$request-&gt;getParam('appid')) !== ''</code>
</RedundantCondition>
<UndefinedInterfaceMethod occurrences="1">
<code>listen</code>
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/Accounts/AccountManager.php">
<InvalidArgument occurrences="1">
@ -3269,6 +3346,12 @@
<code>$default</code>
</NullableReturnStatement>
</file>
<file src="lib/private/AppFramework/App.php">
<UndefinedInterfaceMethod occurrences="2">
<code>setUrlParameters</code>
<code>setUrlParameters</code>
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/AppFramework/Bootstrap/Coordinator.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$this-&gt;bootedApps</code>
@ -3285,6 +3368,9 @@
<code>\OCP\IServerContainer</code>
<code>mixed</code>
</InvalidReturnType>
<UndefinedClass occurrences="1">
<code>'AppName'</code>
</UndefinedClass>
<UndefinedInterfaceMethod occurrences="1">
<code>getAppDataDir</code>
</UndefinedInterfaceMethod>
@ -3606,11 +3692,6 @@
<code>$this-&gt;shareeEnumerationInGroupOnly</code>
</UndefinedThisPropertyFetch>
</file>
<file src="lib/private/Collaboration/Collaborators/Search.php">
<UndefinedMethod occurrences="1">
<code>search</code>
</UndefinedMethod>
</file>
<file src="lib/private/Collaboration/Resources/Manager.php">
<InvalidArgument occurrences="4"/>
<RedundantCondition occurrences="1">
@ -4815,9 +4896,7 @@
<InvalidScalarArgument occurrences="1">
<code>$position</code>
</InvalidScalarArgument>
<UndefinedInterfaceMethod occurrences="1">
<code>$cacheEntry</code>
</UndefinedInterfaceMethod>
<UndefinedInterfaceMethod occurrences="1"/>
</file>
<file src="lib/private/Files/Stream/SeekableHttpStream.php">
<FalsableReturnStatement occurrences="3">
@ -4887,7 +4966,7 @@
<code>$result &amp;&amp; in_array('delete', $hooks) and $result</code>
</RedundantCondition>
<UndefinedDocblockClass occurrences="2">
<code>list($storage, $internalPath)</code>
<code>[$storage, $internalPath]</code>
<code>$storage</code>
</UndefinedDocblockClass>
<UndefinedInterfaceMethod occurrences="20">
@ -5112,15 +5191,6 @@
<code>is_string($request-&gt;getMethod())</code>
</RedundantCondition>
</file>
<file src="lib/private/Log/LogFactory.php">
<InvalidReturnStatement occurrences="2">
<code>$this-&gt;c-&gt;resolve(Syslog::class)</code>
<code>$this-&gt;c-&gt;resolve(Systemdlog::class)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>IWriter</code>
</InvalidReturnType>
</file>
<file src="lib/private/Log/Systemdlog.php">
<UndefinedFunction occurrences="1"/>
</file>
@ -5450,9 +5520,27 @@
<TooManyArguments occurrences="1">
<code>dispatch</code>
</TooManyArguments>
<UndefinedClass occurrences="13">
<code>'SystemTagManagerFactory'</code>
<code>'SystemTagManagerFactory'</code>
<code>'RootFolder'</code>
<code>'EncryptionFileHelper'</code>
<code>'EncryptionKeyStorage'</code>
<code>'RedisFactory'</code>
<code>'OcsClient'</code>
<code>'AsyncCommandBus'</code>
<code>'ThemingDefaults'</code>
<code>'IntegrityCodeChecker'</code>
<code>'CryptoWrapper'</code>
<code>'LDAPProvider'</code>
<code>'LockdownManager'</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="1">
<code>\OC\OCSClient</code>
</UndefinedDocblockClass>
<UndefinedInterfaceMethod occurrences="1">
<code>getSession</code>
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/ServerContainer.php">
<InvalidPropertyAssignmentValue occurrences="1">
@ -5612,8 +5700,9 @@
<code>null</code>
<code>null</code>
</NullableReturnStatement>
<UndefinedClass occurrences="1">
<UndefinedClass occurrences="2">
<code>\OCA\Circles\ShareByCircleProvider</code>
<code>'\OCA\Talk\Share\RoomShareProvider'</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="5">
<code>\OCA\Circles\ShareByCircleProvider</code>
@ -5960,7 +6049,6 @@
</UndefinedDocblockClass>
</file>
<file src="lib/private/legacy/OC_Files.php">
<EmptyArrayAccess occurrences="2"/>
<InvalidArgument occurrences="3">
<code>$fileInfos</code>
<code>[$fileInfo]</code>
@ -6087,6 +6175,11 @@
<code>clearCache</code>
</UndefinedInterfaceMethod>
</file>
<file src="lib/private/legacy/template/functions.php">
<UndefinedClass occurrences="1">
<code>'DateTimeFormatter'</code>
</UndefinedClass>
</file>
<file src="lib/public/AppFramework/ApiController.php">
<NoInterfaceProperties occurrences="1">
<code>$this-&gt;request-&gt;server</code>

View File

@ -17,11 +17,12 @@
},
"require-dev": {
"nextcloud/coding-standard": "^0.3.0",
"psalm/phar": "^3.12"
"vimeo/psalm": "3.15"
},
"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"
"lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm"
}
}

1083
composer.lock generated

File diff suppressed because it is too large Load Diff