diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 782b62d..643b3b7 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -18,9 +18,9 @@ jobs: strategy: matrix: include: + - { php-version: "7.2", dependencies: "lowest", pimcore_version: "", phpstan_args: "", experimental: false } - { php-version: "8.0", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false } - { php-version: "8.1", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false } - - { php-version: "8.1", dependencies: "highest", pimcore_version: "11.x-dev", phpstan_args: "", experimental: true } steps: - name: "Checkout code" uses: "actions/checkout@v2" @@ -40,12 +40,22 @@ jobs: PIMCORE_VERSION: "${{ matrix.pimcore_version }}" run: | if [ ! -z "$PIMCORE_VERSION" ]; then - composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION} as 10.99.9" + composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}" fi + - name: "Fix composer plugins (remove when removing Pimcore 6.9 support)" + run: | + composer config --no-plugins allow-plugins.endroid/installer true + composer config --no-plugins allow-plugins.ocramius/package-versions true + - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" - - name: "Run a static analysis with phpstan/phpstan" - run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1" \ No newline at end of file + - name: "Run a static analysis with phpstan/phpstan (highest)" + if: ${{ matrix.dependencies == 'highest' }} + run: "vendor/bin/phpstan analyse --memory-limit=-1" + + - name: "Run a static analysis with phpstan/phpstan (lowest)" + if: ${{ matrix.dependencies == 'lowest' }} + run: "vendor/bin/phpstan analyse --memory-limit=-1 -c phpstan-lowest.neon" diff --git a/composer.json b/composer.json index ee4d68c..5283b4a 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,11 @@ "require": { "pimcore/pimcore": "^6.8 || ^10.0" }, + "conflict": { + "symfony/symfony": "<4.1" + }, "require-dev": { - "phpstan/phpstan": "^1.2" + "phpstan/phpstan": "^1.10" }, "extra": { "pimcore": { diff --git a/phpstan-lowest.neon b/phpstan-lowest.neon new file mode 100644 index 0000000..88f9275 --- /dev/null +++ b/phpstan-lowest.neon @@ -0,0 +1,9 @@ +includes: + - phpstan.neon + +parameters: + ignoreErrors: + - + message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#" + count: 1 + path: src/Service.php