Skip to content

Commit 89d109a

Browse files
authored
Merge pull request #30508 from nextcloud/fix/psaml-bin
Fix psalm not running
2 parents 7d5a63a + 6312c0d commit 89d109a

File tree

78 files changed

+1188
-2362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1188
-2362
lines changed

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
declare(strict_types=1);
44

5-
require_once './lib/composer/autoload.php';
5+
require_once './vendor-bin/cs-fixer/vendor/autoload.php';
66

77
use Nextcloud\CodingStandard\Config;
88

99
$config = new Config();
1010
$config
1111
->getFinder()
12+
->ignoreVCSIgnored(true)
1213
->exclude('config')
1314
->exclude('data')
1415
->notPath('3rdparty')

apps/encryption/lib/Crypto/Crypt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private function encrypt($plainContent, $iv, $passPhrase = '', $cipher = self::D
237237
$encryptedContent = openssl_encrypt($plainContent,
238238
$cipher,
239239
$passPhrase,
240-
false,
240+
0,
241241
$iv);
242242

243243
if (!$encryptedContent) {
@@ -617,7 +617,7 @@ private function decrypt($encryptedContent, $iv, $passPhrase = '', $cipher = sel
617617
$plainContent = openssl_decrypt($encryptedContent,
618618
$cipher,
619619
$passPhrase,
620-
false,
620+
0,
621621
$iv);
622622

623623
if ($plainContent) {

apps/encryption/lib/KeyManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function __construct(
159159
$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);
160160
}
161161

162-
$this->keyId = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
162+
$this->keyId = $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
163163
$this->log = $log;
164164
}
165165

apps/encryption/lib/Migration/SetMasterKeyStatus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public function run(IOutput $output) {
6262

6363
// if no config for the master key is set we set it explicitly to '0' in
6464
// order not to break old installations because the default changed to '1'.
65-
$configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', false);
66-
if ($configAlreadySet === false) {
65+
$configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', 'not-set');
66+
if ($configAlreadySet === 'not-set') {
6767
$this->config->setAppValue('encryption', 'useMasterKey', '0');
6868
}
6969
}

apps/encryption/lib/Recovery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(IUserSession $userSession,
7676
IConfig $config,
7777
IFile $file,
7878
View $view) {
79-
$this->user = ($userSession && $userSession->isLoggedIn()) ? $userSession->getUser() : false;
79+
$this->user = ($userSession->isLoggedIn()) ? $userSession->getUser() : null;
8080
$this->crypt = $crypt;
8181
$this->keyManager = $keyManager;
8282
$this->config = $config;

apps/files_external/lib/Lib/Storage/FtpConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* Low level wrapper around the ftp functions that smooths over some difference between servers
2828
*/
2929
class FtpConnection {
30-
/** @var resource */
30+
/** @var resource|\FTP\Connection */
3131
private $connection;
3232

3333
public function __construct(bool $secure, string $hostname, int $port, string $username, string $password) {

apps/settings/lib/SetupChecks/CheckUserCertificates.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ class CheckUserCertificates {
3939

4040
public function __construct(IL10N $l10n, IConfig $config, IURLGenerator $urlGenerator) {
4141
$this->l10n = $l10n;
42-
$configValue = $config->getAppValue('files_external', 'user_certificate_scan', false);
43-
if (!is_string($configValue)) {
44-
$configValue = '';
45-
}
42+
$configValue = $config->getAppValue('files_external', 'user_certificate_scan', '');
4643
$this->configValue = $configValue;
4744
$this->urlGenerator = $urlGenerator;
4845
}

apps/user_ldap/lib/Access.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ private function detectUuidAttribute($dn, $isUser = true, $force = false, array
17531753
}
17541754

17551755
$attribute = $this->connection->getFromCache($uuidAttr);
1756-
if (!$attribute === null) {
1756+
if ($attribute !== null) {
17571757
$this->connection->$uuidAttr = $attribute;
17581758
return true;
17591759
}

build/integration/features/bootstrap/WebDav.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ public function userUploadsBulkedFiles($user, $name1, $content1, $name2, $conten
625625
$body .= $content3."\r\n";
626626
$body .= '--'.$boundary."--\r\n";
627627

628-
$stream = fopen('php://temp','r+');
628+
$stream = fopen('php://temp', 'r+');
629629
fwrite($stream, $body);
630630
rewind($stream);
631631

build/psalm-baseline-ocp.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.8.1@f73f2299dbc59a3e6c4d66cff4605176e728ee69">
2+
<files psalm-version="4.18.1@dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb">
33
<file src="lib/private/legacy/OC_Image.php">
44
<ImplementedReturnTypeMismatch occurrences="1">
55
<code>null|string</code>
@@ -220,7 +220,9 @@
220220
<InvalidReturnType occurrences="1">
221221
<code>float</code>
222222
</InvalidReturnType>
223-
<UndefinedClass occurrences="12">
223+
<UndefinedClass occurrences="14">
224+
<code>\OC</code>
225+
<code>\OC</code>
224226
<code>\OC</code>
225227
<code>\OC</code>
226228
<code>\OC</code>

0 commit comments

Comments
 (0)