aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-12-30 11:03:38 +0100
committerGitHub <noreply@github.com>2022-12-30 11:03:38 +0100
commit0459f58a0389375f97075b585ebe9a51794e8b35 (patch)
treec14df70bccb6c6bd17576132e2489676d2f22444
parent9cef2c0745b059326819c1029dcf30a02cbf9f0b (diff)
parent3c2360483442399d81c45f43a9bdef6f5d16ff63 (diff)
downloadnextcloud-server-0459f58a0389375f97075b585ebe9a51794e8b35.tar.gz
nextcloud-server-0459f58a0389375f97075b585ebe9a51794e8b35.zip
Merge pull request #35911 from nextcloud/fix/workflows-8.0
chore(actions): update php min supported to 8.0
-rw-r--r--.github/workflows/command-compile.yml2
-rw-r--r--.github/workflows/ftp.yml4
-rw-r--r--.github/workflows/lint-eslint.yml2
-rw-r--r--.github/workflows/lint-php-cs.yml37
-rw-r--r--.github/workflows/lint-php.yml57
-rw-r--r--.github/workflows/lint.yml42
-rw-r--r--.github/workflows/node-tests.yml8
-rw-r--r--.github/workflows/oci.yml2
-rw-r--r--.github/workflows/psalm-github.yml65
-rw-r--r--.github/workflows/psalm-security.yml28
-rw-r--r--.github/workflows/s3-external.yml8
-rw-r--r--.github/workflows/s3-primary.yml2
-rw-r--r--.github/workflows/smb-kerberos.yml4
-rw-r--r--.github/workflows/static-code-analysis.yml113
-rw-r--r--.github/workflows/update-psalm-baseline.yml4
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php11
-rw-r--r--apps/dav/lib/CalDAV/Schedule/IMipPlugin.php36
-rw-r--r--apps/encryption/lib/Crypto/Crypt.php2
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTPReadStream.php3
-rw-r--r--build/psalm-baseline.xml6
-rw-r--r--core/Command/Log/Manage.php50
21 files changed, 269 insertions, 217 deletions
diff --git a/.github/workflows/command-compile.yml b/.github/workflows/command-compile.yml
index 090324e987b..db8f976eb52 100644
--- a/.github/workflows/command-compile.yml
+++ b/.github/workflows/command-compile.yml
@@ -54,7 +54,7 @@ jobs:
steps:
- name: Checkout ${{ needs.init.outputs.head_ref }}
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
fetch-depth: 0
diff --git a/.github/workflows/ftp.yml b/.github/workflows/ftp.yml
index aa9fe3aad79..d3b0af3cb80 100644
--- a/.github/workflows/ftp.yml
+++ b/.github/workflows/ftp.yml
@@ -21,14 +21,14 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0']
ftpd: ['proftpd', 'vsftpd', 'pure-ftpd']
name: php${{ matrix.php-versions }}-${{ matrix.ftpd }}
steps:
- name: Checkout server
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: true
diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml
index 11590ffb04a..bcf039ad728 100644
--- a/.github/workflows/lint-eslint.yml
+++ b/.github/workflows/lint-eslint.yml
@@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml
new file mode 100644
index 00000000000..b24ad95dac8
--- /dev/null
+++ b/.github/workflows/lint-php-cs.yml
@@ -0,0 +1,37 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Lint
+
+on: pull_request
+
+permissions:
+ contents: read
+
+concurrency:
+ group: lint-php-cs-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+
+ name: php-cs
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: "8.0"
+ coverage: none
+
+ - name: Install dependencies
+ run: composer i
+
+ - name: Lint
+ run: composer run cs:check || ( echo "Please run `composer run cs:fix` to format your code" && exit 1 )
diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml
new file mode 100644
index 00000000000..ad3add22d60
--- /dev/null
+++ b/.github/workflows/lint-php.yml
@@ -0,0 +1,57 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Lint
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+concurrency:
+ group: lint-php-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ php-lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["8.0", "8.1", "8.2"]
+
+ name: php-lint
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: Lint
+ run: composer run lint
+
+ summary:
+ permissions:
+ contents: none
+ runs-on: ubuntu-latest
+ needs: php-lint
+
+ if: always()
+
+ name: php-lint-summary
+
+ steps:
+ - name: Summary status
+ run: if ${{ needs.php-lint.result != "success" && needs.php-lint.result != "skipped" }}; then exit 1; fi
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
deleted file mode 100644
index 983b0af6d93..00000000000
--- a/.github/workflows/lint.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Lint
-on: pull_request
-
-jobs:
- php-linters:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- php-versions: ['7.4', '8.0', '8.1', '8.2']
- name: php${{ matrix.php-versions }} lint
- steps:
- - name: Checkout
- uses: actions/checkout@master
- - name: Set up php${{ matrix.php-versions }}
- uses: shivammathur/setup-php@master
- with:
- php-version: ${{ matrix.php-versions }}
- extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
- coverage: none
- - name: Lint
- run: composer run lint
-
- php-cs-fixer:
- name: php-cs check
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@master
- - name: Set up php
- uses: shivammathur/setup-php@master
- with:
- php-version: 7.4
- extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
- coverage: none
- tools: cs2pr
- - name: Install dependencies
- run: composer i
- - name: Run coding standards check
- run: |
- composer run cs:check -- --format=checkstyle | cs2pr
- composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
- shell: bash
diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml
index 6be1006a937..596e4494e43 100644
--- a/.github/workflows/node-tests.yml
+++ b/.github/workflows/node-tests.yml
@@ -16,7 +16,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
@@ -31,7 +31,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Set up node ${{ needs.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
@@ -53,7 +53,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Set up node ${{ needs.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
@@ -75,7 +75,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Set up node ${{ needs.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
diff --git a/.github/workflows/oci.yml b/.github/workflows/oci.yml
index adcc48dc90d..f7537d642d8 100644
--- a/.github/workflows/oci.yml
+++ b/.github/workflows/oci.yml
@@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
- php-versions: [ '7.4', '8.0', '8.1']
+ php-versions: ['8.0', '8.1']
services:
oracle:
diff --git a/.github/workflows/psalm-github.yml b/.github/workflows/psalm-github.yml
index d27e0a1f143..0a355d122b7 100644
--- a/.github/workflows/psalm-github.yml
+++ b/.github/workflows/psalm-github.yml
@@ -1,4 +1,4 @@
-name: Psalm show github
+name: Psalm
on:
pull_request:
@@ -8,21 +8,62 @@ on:
- stable*
jobs:
- psalm:
- name: Psalm
+ generate-report:
runs-on: ubuntu-latest
+
steps:
- - name: Checkout code
- uses: actions/checkout@v2
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: Set up php
+ uses: shivammathur/setup-php@v2
with:
- submodules: recursive
+ php-version: '8.0'
+ extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
+ coverage: none
+
+ - name: Composer install
+ run: composer i
+
- name: Psalm
- uses: docker://vimeo/psalm-github-actions:4.9.3
+ # Make sure we pass and still upload the report
continue-on-error: true
+ run: composer run psalm -- --monochrome --no-progress --output-format=github --report=psalm.sarif
+
+ - name: Upload report to GitHub
+ if: always()
+ uses: github/codeql-action/upload-sarif@v2
+ with:
+ sarif_file: psalm.sarif
+
+ generate-security-report:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
with:
- composer_ignore_platform_reqs: false
- report_file: results.sarif
- - name: Upload Analysis results to GitHub
- uses: github/codeql-action/upload-sarif@v1
+ submodules: true
+
+ - name: Set up php
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '8.0'
+ extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
+ coverage: none
+
+ - name: Composer install
+ run: composer i
+
+ - name: Psalm
+ # Make sure we pass and still upload the report
+ continue-on-error: true
+ run: composer run psalm -- --monochrome --no-progress --output-format=github --taint-analysis --report=psalm.sarif
+
+ - name: Upload report to GitHub
+ if: always()
+ uses: github/codeql-action/upload-sarif@v2
with:
- sarif_file: results.sarif
+ sarif_file: psalm.sarif
diff --git a/.github/workflows/psalm-security.yml b/.github/workflows/psalm-security.yml
deleted file mode 100644
index a97abba44c2..00000000000
--- a/.github/workflows/psalm-security.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: Psalm Security Analysis
-
-on:
- pull_request:
- push:
- branches:
- - master
- - stable*
-
-jobs:
- psalm:
- name: Psalm
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- with:
- submodules: recursive
- - name: Psalm
- uses: docker://vimeo/psalm-github-actions:4.9.3
- with:
- security_analysis: true
- composer_ignore_platform_reqs: false
- report_file: results.sarif
- - name: Upload Security Analysis results to GitHub
- uses: github/codeql-action/upload-sarif@v1
- with:
- sarif_file: results.sarif
diff --git a/.github/workflows/s3-external.yml b/.github/workflows/s3-external.yml
index 8c2cdd7cfd1..45b585c5295 100644
--- a/.github/workflows/s3-external.yml
+++ b/.github/workflows/s3-external.yml
@@ -21,7 +21,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0', '8.1']
name: php${{ matrix.php-versions }}-minio
@@ -36,7 +36,7 @@ jobs:
steps:
- name: Checkout server
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: true
@@ -70,7 +70,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0', '8.1']
name: php${{ matrix.php-versions }}-localstack
@@ -85,7 +85,7 @@ jobs:
steps:
- name: Checkout server
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: true
diff --git a/.github/workflows/s3-primary.yml b/.github/workflows/s3-primary.yml
index a6ee0970ada..50bab8965f5 100644
--- a/.github/workflows/s3-primary.yml
+++ b/.github/workflows/s3-primary.yml
@@ -30,7 +30,7 @@ jobs:
steps:
- name: Checkout server
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: true
diff --git a/.github/workflows/smb-kerberos.yml b/.github/workflows/smb-kerberos.yml
index 2875a7f4fbd..a3f0598d845 100644
--- a/.github/workflows/smb-kerberos.yml
+++ b/.github/workflows/smb-kerberos.yml
@@ -17,13 +17,13 @@ jobs:
strategy:
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['8.0', '8.1']
name: php${{ matrix.php-versions }}-${{ matrix.ftpd }}
steps:
- name: Checkout server
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: true
- name: Pull images
diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml
index 31ee0f89fa2..8a83b7d02ba 100644
--- a/.github/workflows/static-code-analysis.yml
+++ b/.github/workflows/static-code-analysis.yml
@@ -1,56 +1,63 @@
-name: Static code analysis
+name: Psalm static code analysis
-on: [pull_request]
+on:
+ pull_request:
jobs:
- static-code-analysis:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Checkout submodules
- shell: bash
- run: |
- 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: Set up php7.4
- uses: shivammathur/setup-php@master
- with:
- php-version: 7.4
- extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
- coverage: none
- - name: Composer install
- run: composer i
- - name: Psalm
- run: composer run psalm -- --monochrome --no-progress --output-format=github --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)"
-
- static-code-analysis-ocp:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - name: Checkout submodules
- shell: bash
- run: |
- 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: Set up php7.4
- uses: shivammathur/setup-php@master
- with:
- php-version: 7.4
- extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
- coverage: none
- - name: Composer install
- run: composer i
- - name: Psalm
- run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --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-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)"
+ static-code-analysis:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: Set up php
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '8.0'
+ extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
+ coverage: none
+
+ - name: Composer install
+ run: composer i
+
+ - name: Psalm
+ run: composer run psalm -- --monochrome --no-progress --output-format=github --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)"
+
+ static-code-analysis-ocp:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: Set up php
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: '8.0'
+ extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
+ coverage: none
+
+ - name: Composer install
+ run: composer i
+
+ - name: Psalm
+ run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --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-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)"
diff --git a/.github/workflows/update-psalm-baseline.yml b/.github/workflows/update-psalm-baseline.yml
index 42f2d7450e7..fd73d555c86 100644
--- a/.github/workflows/update-psalm-baseline.yml
+++ b/.github/workflows/update-psalm-baseline.yml
@@ -22,10 +22,10 @@ jobs:
ref: ${{ matrix.branches }}
submodules: true
- - name: Set up php7.4
+ - name: Set up php
uses: shivammathur/setup-php@v2
with:
- php-version: 7.4
+ php-version: '8.0'
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
index c2e68605d17..355d95057ff 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
@@ -35,10 +35,10 @@ use DateTime;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
+use OCP\IUser;
use OCP\L10N\IFactory as L10NFactory;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
-use OCP\IUser;
use Psr\Log\LoggerInterface;
use Sabre\VObject;
use Sabre\VObject\Component\VEvent;
@@ -51,7 +51,6 @@ use Sabre\VObject\Property;
* @package OCA\DAV\CalDAV\Reminder\NotificationProvider
*/
class EmailProvider extends AbstractProvider {
-
/** @var string */
public const NOTIFICATION_TYPE = 'EMAIL';
@@ -77,7 +76,7 @@ class EmailProvider extends AbstractProvider {
*/
public function send(VEvent $vevent,
string $calendarDisplayName,
- array $principalEmailAddresses,
+ array $principalEmailAddresses,
array $users = []):void {
$fallbackLanguage = $this->getFallbackLanguage();
@@ -202,7 +201,7 @@ class EmailProvider extends AbstractProvider {
$organizerEMail = substr($organizer->getValue(), 7);
- if ($organizerEMail === false || !$this->mailer->validateMailAddress($organizerEMail)) {
+ if (!$this->mailer->validateMailAddress($organizerEMail)) {
return null;
}
@@ -273,7 +272,7 @@ class EmailProvider extends AbstractProvider {
foreach ($emailAddressesOfDelegates as $addressesOfDelegate) {
if (strcasecmp($addressesOfDelegate, 'mailto:') === 0) {
$delegateEmail = substr($addressesOfDelegate, 7);
- if ($delegateEmail !== false && $this->mailer->validateMailAddress($delegateEmail)) {
+ if ($this->mailer->validateMailAddress($delegateEmail)) {
$emailAddresses[$delegateEmail] = [];
}
}
@@ -333,7 +332,7 @@ class EmailProvider extends AbstractProvider {
return null;
}
$attendeeEMail = substr($attendee->getValue(), 7);
- if ($attendeeEMail === false || !$this->mailer->validateMailAddress($attendeeEMail)) {
+ if (!$this->mailer->validateMailAddress($attendeeEMail)) {
return null;
}
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
index 515072fd227..be238ae5afb 100644
--- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
+++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
@@ -71,7 +71,6 @@ use Sabre\VObject\Recur\EventIterator;
* @license http://sabre.io/license/ Modified BSD License
*/
class IMipPlugin extends SabreIMipPlugin {
-
/** @var string */
private $userId;
@@ -138,7 +137,6 @@ class IMipPlugin extends SabreIMipPlugin {
* @return void
*/
public function schedule(Message $iTipMessage) {
-
// Not sending any emails if the system considers the update
// insignificant.
if (!$iTipMessage->significantChange) {
@@ -168,7 +166,7 @@ class IMipPlugin extends SabreIMipPlugin {
// Strip off mailto:
$sender = substr($iTipMessage->sender, 7);
$recipient = substr($iTipMessage->recipient, 7);
- if ($recipient === false || !$this->mailer->validateMailAddress($recipient)) {
+ if (!$this->mailer->validateMailAddress($recipient)) {
// Nothing to send if the recipient doesn't have a valid email address
$iTipMessage->scheduleStatus = '5.0; EMail delivery failed';
return;
@@ -224,11 +222,8 @@ class IMipPlugin extends SabreIMipPlugin {
$message = $this->mailer->createMessage()
->setFrom([$fromEMail => $fromName])
- ->setTo([$recipient => $recipientName]);
-
- if ($sender !== false) {
- $message->setReplyTo([$sender => $senderName]);
- }
+ ->setTo([$recipient => $recipientName])
+ ->setReplyTo([$sender => $senderName]);
$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
$template->addHeader();
@@ -240,7 +235,6 @@ class IMipPlugin extends SabreIMipPlugin {
// Only add response buttons to invitation requests: Fix Issue #11230
if (($method == self::METHOD_REQUEST) && $this->getAttendeeRsvpOrReqForParticipant($attendee)) {
-
/*
** Only offer invitation accept/reject buttons, which link back to the
** nextcloud server, to recipients who can access the nextcloud server via
@@ -530,25 +524,25 @@ class IMipPlugin extends SabreIMipPlugin {
private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) {
if ($vevent->SUMMARY) {
$template->addBodyListItem($vevent->SUMMARY, $l10n->t('Title:'),
- $this->getAbsoluteImagePath('caldav/title.png'),'','',self::IMIP_INDENT);
+ $this->getAbsoluteImagePath('caldav/title.png'), '', '', self::IMIP_INDENT);
}
$meetingWhen = $this->generateWhenString($l10n, $vevent);
if ($meetingWhen) {
$template->addBodyListItem($meetingWhen, $l10n->t('Time:'),
- $this->getAbsoluteImagePath('caldav/time.png'),'','',self::IMIP_INDENT);
+ $this->getAbsoluteImagePath('caldav/time.png'), '', '', self::IMIP_INDENT);
}
if ($vevent->LOCATION) {
$template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'),
- $this->getAbsoluteImagePath('caldav/location.png'),'','',self::IMIP_INDENT);
+ $this->getAbsoluteImagePath('caldav/location.png'), '', '', self::IMIP_INDENT);
}
if ($vevent->URL) {
$url = $vevent->URL->getValue();
$template->addBodyListItem(sprintf('<a href="%s">%s</a>',
- htmlspecialchars($url),
- htmlspecialchars($url)),
+ htmlspecialchars($url),
+ htmlspecialchars($url)),
$l10n->t('Link:'),
$this->getAbsoluteImagePath('caldav/link.png'),
- $url,'',self::IMIP_INDENT);
+ $url, '', self::IMIP_INDENT);
}
$this->addAttendees($template, $l10n, $vevent);
@@ -556,7 +550,7 @@ class IMipPlugin extends SabreIMipPlugin {
/* Put description last, like an email body, since it can be arbitrarily long */
if ($vevent->DESCRIPTION) {
$template->addBodyListItem($vevent->DESCRIPTION->getValue(), $l10n->t('Description:'),
- $this->getAbsoluteImagePath('caldav/description.png'),'','',self::IMIP_INDENT);
+ $this->getAbsoluteImagePath('caldav/description.png'), '', '', self::IMIP_INDENT);
}
}
@@ -586,7 +580,7 @@ class IMipPlugin extends SabreIMipPlugin {
/** @var Property\ICalendar\CalAddress $organizer */
$organizer = $vevent->ORGANIZER;
$organizerURI = $organizer->getNormalizedValue();
- [$scheme,$organizerEmail] = explode(':',$organizerURI,2); # strip off scheme mailto:
+ [$scheme,$organizerEmail] = explode(':', $organizerURI, 2); # strip off scheme mailto:
/** @var string|null $organizerName */
$organizerName = isset($organizer['CN']) ? $organizer['CN'] : null;
$organizerHTML = sprintf('<a href="%s">%s</a>',
@@ -603,7 +597,7 @@ class IMipPlugin extends SabreIMipPlugin {
}
$template->addBodyListItem($organizerHTML, $l10n->t('Organizer:'),
$this->getAbsoluteImagePath('caldav/organizer.png'),
- $organizerText,'',self::IMIP_INDENT);
+ $organizerText, '', self::IMIP_INDENT);
}
$attendees = $vevent->select('ATTENDEE');
@@ -615,7 +609,7 @@ class IMipPlugin extends SabreIMipPlugin {
$attendeesText = [];
foreach ($attendees as $attendee) {
$attendeeURI = $attendee->getNormalizedValue();
- [$scheme,$attendeeEmail] = explode(':',$attendeeURI,2); # strip off scheme mailto:
+ [$scheme,$attendeeEmail] = explode(':', $attendeeURI, 2); # strip off scheme mailto:
$attendeeName = isset($attendee['CN']) ? $attendee['CN'] : null;
$attendeeHTML = sprintf('<a href="%s">%s</a>',
htmlspecialchars($attendeeURI),
@@ -630,9 +624,9 @@ class IMipPlugin extends SabreIMipPlugin {
array_push($attendeesText, $attendeeText);
}
- $template->addBodyListItem(implode('<br/>',$attendeesHTML), $l10n->t('Attendees:'),
+ $template->addBodyListItem(implode('<br/>', $attendeesHTML), $l10n->t('Attendees:'),
$this->getAbsoluteImagePath('caldav/attendees.png'),
- implode("\n",$attendeesText),'',self::IMIP_INDENT);
+ implode("\n", $attendeesText), '', self::IMIP_INDENT);
}
/**
diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php
index 7429c613b52..8bfeb0c7a68 100644
--- a/apps/encryption/lib/Crypto/Crypt.php
+++ b/apps/encryption/lib/Crypto/Crypt.php
@@ -160,7 +160,7 @@ class Crypt {
/**
* Generates a new private key
*
- * @return resource
+ * @return \OpenSSLAsymmetricKey|false
*/
public function getOpenSSLPKey() {
$config = $this->getOpenSSLConfig();
diff --git a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
index 680a51cfa10..c4749b15453 100644
--- a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
+++ b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php
@@ -136,9 +136,6 @@ class SFTPReadStream implements File {
$data = substr($this->buffer, 0, $count);
$this->buffer = substr($this->buffer, $count);
- if ($this->buffer === false) {
- $this->buffer = '';
- }
$this->readPosition += strlen($data);
return $data;
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index ed0a232ec8d..b1f1b737492 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -578,15 +578,9 @@
</UndefinedInterfaceMethod>
</file>
<file src="apps/dav/lib/Controller/InvitationResponseController.php">
- <InvalidScalarArgument occurrences="1">
- <code>$guests</code>
- </InvalidScalarArgument>
<UndefinedPropertyAssignment occurrences="1">
<code>$vEvent-&gt;DTSTAMP</code>
</UndefinedPropertyAssignment>
- <UndefinedPropertyFetch occurrences="1">
- <code>$vEvent-&gt;{'ATTENDEE'}</code>
- </UndefinedPropertyFetch>
</file>
<file src="apps/dav/lib/DAV/CustomPropertiesBackend.php">
<InvalidArgument occurrences="1">
diff --git a/core/Command/Log/Manage.php b/core/Command/Log/Manage.php
index 34ec5ea54a8..63a8efde370 100644
--- a/core/Command/Log/Manage.php
+++ b/core/Command/Log/Manage.php
@@ -141,18 +141,18 @@ class Manage extends Command implements CompletionAwareInterface {
protected function convertLevelString($level) {
$level = strtolower($level);
switch ($level) {
- case 'debug':
- return 0;
- case 'info':
- return 1;
- case 'warning':
- case 'warn':
- return 2;
- case 'error':
- case 'err':
- return 3;
- case 'fatal':
- return 4;
+ case 'debug':
+ return 0;
+ case 'info':
+ return 1;
+ case 'warning':
+ case 'warn':
+ return 2;
+ case 'error':
+ case 'err':
+ return 3;
+ case 'fatal':
+ return 4;
}
throw new \InvalidArgumentException('Invalid log level string');
}
@@ -164,16 +164,16 @@ class Manage extends Command implements CompletionAwareInterface {
*/
protected function convertLevelNumber($levelNum) {
switch ($levelNum) {
- case 0:
- return 'Debug';
- case 1:
- return 'Info';
- case 2:
- return 'Warning';
- case 3:
- return 'Error';
- case 4:
- return 'Fatal';
+ case 0:
+ return 'Debug';
+ case 1:
+ return 'Info';
+ case 2:
+ return 'Warning';
+ case 3:
+ return 'Error';
+ case 4:
+ return 'Fatal';
}
throw new \InvalidArgumentException('Invalid log level number');
}
@@ -189,11 +189,7 @@ class Manage extends Command implements CompletionAwareInterface {
} elseif ($optionName === 'level') {
return ['debug', 'info', 'warning', 'error', 'fatal'];
} elseif ($optionName === 'timezone') {
- $identifier = \DateTimeZone::listIdentifiers();
- if ($identifier === false) {
- return [];
- }
- return $identifier;
+ return \DateTimeZone::listIdentifiers();
}
return [];
}