From 540608682988c627d46b6891089183568db06798 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 4 Feb 2021 20:58:05 +0100 Subject: Psalm: Fix class loading --- .github/workflows/static-code-check.yml | 25 +++++++++++++++++++++---- AUTHORS.md | 2 +- lib/Db/ItemMapperV2.php | 2 +- psalm.xml | 1 + tests/psalm-autoload.php | 13 +++++++++++++ 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 tests/psalm-autoload.php diff --git a/.github/workflows/static-code-check.yml b/.github/workflows/static-code-check.yml index cad11c939..4473057bb 100644 --- a/.github/workflows/static-code-check.yml +++ b/.github/workflows/static-code-check.yml @@ -7,8 +7,10 @@ jobs: continue-on-error: true strategy: matrix: - ocp-version: [ '21.0.0.x-dev', 'v20.0.5' ] - name: "Psalm: Nextcloud ${{ matrix.ocp-version }}" + php-versions: [ '7.4' ] + nextcloud: [ 'stable20', 'v21.0.0RC1' ] + database: [ 'sqlite' ] + name: "Psalm: Nextcloud ${{ matrix.nextcloud }}" steps: - name: Checkout uses: actions/checkout@master @@ -16,10 +18,25 @@ jobs: uses: shivammathur/setup-php@master with: php-version: 7.4 + extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none + + - name: Set up server non MySQL + uses: SMillerDev/nextcloud-actions/setup-nextcloud@main + with: + cron: true + version: ${{ matrix.nextcloud }} + database-type: ${{ matrix.database }} + - name: Install dependencies run: composer install - - name: Install dependencies - run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }} + + - name: Configure server with app + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main + with: + app: 'news' + check-code: false + - name: Run coding standards check + working-directory: ../server/apps/news run: ./vendor/bin/psalm \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index 89571c36c..558128d24 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -5,8 +5,8 @@ * [Robin Appelman](mailto:icewind@owncloud.com) * [Sean Molenaar](mailto:sean@seanmolenaar.eu) * [Gregor Tätzner](mailto:gregor@freenet.de) -* [Morris Jobke](mailto:hey@morrisjobke.de) * [Sean Molenaar](mailto:SMillerDev@users.noreply.github.com) +* [Morris Jobke](mailto:hey@morrisjobke.de) * [anoy](mailto:anoymouserver+github@mailbox.org) * [Jan-Christoph Borchardt](mailto:hey@jancborchardt.net) * [Daniel Schaal](mailto:daniel@schaal.email) diff --git a/lib/Db/ItemMapperV2.php b/lib/Db/ItemMapperV2.php index ecc635e32..ed7efff3f 100644 --- a/lib/Db/ItemMapperV2.php +++ b/lib/Db/ItemMapperV2.php @@ -144,7 +144,7 @@ class ItemMapperV2 extends NewsMapperV2 * * @return int|null Removed items * - * @throws \Doctrine\DBAL\Exception|\OCP\DB\Exception + * @throws \Doctrine\DBAL\Exception */ public function deleteOverThreshold(int $threshold, bool $removeUnread = false): ?int { diff --git a/psalm.xml b/psalm.xml index 2b9dcc3ba..45b8231b3 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,6 +6,7 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="tests/psalm-baseline.xml" + autoloader="tests/psalm-autoload.php" > diff --git a/tests/psalm-autoload.php b/tests/psalm-autoload.php new file mode 100644 index 000000000..3da2d7f55 --- /dev/null +++ b/tests/psalm-autoload.php @@ -0,0 +1,13 @@ + + * @copyright Sean Molenaar 2021 + */ + +require_once __DIR__ . '/../../../3rdparty/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; -- cgit v1.2.3