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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Crypto/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function encrypt($plainContent, $iv, $passPhrase = '', $cipher = self::D
$encryptedContent = openssl_encrypt($plainContent,
$cipher,
$passPhrase,
false,
0,
$iv);

if (!$encryptedContent) {
Expand Down Expand Up @@ -617,7 +617,7 @@ private function decrypt($encryptedContent, $iv, $passPhrase = '', $cipher = sel
$plainContent = openssl_decrypt($encryptedContent,
$cipher,
$passPhrase,
false,
0,
$iv);

if ($plainContent) {
Expand Down
2 changes: 1 addition & 1 deletion apps/encryption/lib/KeyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function __construct(
$this->config->setAppValue('encryption', 'masterKeyId', $this->masterKeyId);
}

$this->keyId = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
$this->keyId = $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
$this->log = $log;
}

Expand Down
4 changes: 2 additions & 2 deletions apps/encryption/lib/Migration/SetMasterKeyStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function run(IOutput $output) {

// if no config for the master key is set we set it explicitly to '0' in
// order not to break old installations because the default changed to '1'.
$configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', false);
if ($configAlreadySet === false) {
$configAlreadySet = $this->config->getAppValue('encryption', 'useMasterKey', 'not-set');
if ($configAlreadySet === 'not-set') {
$this->config->setAppValue('encryption', 'useMasterKey', '0');
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/encryption/lib/Recovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(IUserSession $userSession,
IConfig $config,
IFile $file,
View $view) {
$this->user = ($userSession && $userSession->isLoggedIn()) ? $userSession->getUser() : false;
$this->user = ($userSession->isLoggedIn()) ? $userSession->getUser() : null;
$this->crypt = $crypt;
$this->keyManager = $keyManager;
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion apps/files_external/lib/Lib/Storage/FtpConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Low level wrapper around the ftp functions that smooths over some difference between servers
*/
class FtpConnection {
/** @var resource */
/** @var resource|\FTP\Connection */
private $connection;

public function __construct(bool $secure, string $hostname, int $port, string $username, string $password) {
Expand Down
5 changes: 1 addition & 4 deletions apps/settings/lib/SetupChecks/CheckUserCertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class CheckUserCertificates {

public function __construct(IL10N $l10n, IConfig $config, IURLGenerator $urlGenerator) {
$this->l10n = $l10n;
$configValue = $config->getAppValue('files_external', 'user_certificate_scan', false);
if (!is_string($configValue)) {
$configValue = '';
}
$configValue = $config->getAppValue('files_external', 'user_certificate_scan', '');
$this->configValue = $configValue;
$this->urlGenerator = $urlGenerator;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ private function detectUuidAttribute($dn, $isUser = true, $force = false, array
}

$attribute = $this->connection->getFromCache($uuidAttr);
if (!$attribute === null) {
if ($attribute !== null) {
$this->connection->$uuidAttr = $attribute;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public function userUploadsChunkedFiles($user, $name1, $content1, $name2, $conte
$body .= $content3."\r\n";
$body .= '--'.$boundary."--\r\n";

$stream = fopen('php://temp','r+');
$stream = fopen('php://temp', 'r+');
fwrite($stream, $body);
rewind($stream);

Expand Down
6 changes: 4 additions & 2 deletions build/psalm-baseline-ocp.xml
Original file line number Diff line number Diff line change
@@ -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="lib/private/legacy/OC_Image.php">
<ImplementedReturnTypeMismatch occurrences="1">
<code>null|string</code>
Expand Down Expand Up @@ -220,7 +220,9 @@
<InvalidReturnType occurrences="1">
<code>float</code>
</InvalidReturnType>
<UndefinedClass occurrences="12">
<UndefinedClass occurrences="14">
<code>\OC</code>
<code>\OC</code>
<code>\OC</code>
<code>\OC</code>
<code>\OC</code>
Expand Down
Loading