diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 2182132..ca99265 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -10,8 +10,35 @@ jobs: cs: if: github.event_name != 'schedule' uses: shopware/github-actions/.github/workflows/cs-fixer.yml@main + get-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get Shopware Version + id: shopware-constraint + run: echo "shopware_constraint=$(cat composer.json | jq -r '.require."shopware/core"')" >> $GITHUB_OUTPUT + + - name: Get Shopware Matrix + uses: tinect/github-shopware-matrix-generator@main + id: matrix + with: + versionConstraint: ${{ steps.shopware-constraint.outputs.shopware_constraint }} + allowEol: false + justMinMaxShopware: false + allowShopwareNext: true + allowShopwareRC: false + includePhpVersion: false phpstan: + name: PHPStan + needs: get-matrix + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }} uses: shopware/github-actions/.github/workflows/phpstan.yml@main with: - extensionName: FroshTools - shopwareVersion: v6.6.0.0-rc1 + extensionName: FroshTools + shopwareVersion: ${{ matrix.shopware }} diff --git a/phpstan.neon.dist b/phpstan.neon.dist index aafcb7b..81c2d44 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,7 +2,8 @@ parameters: level: 8 paths: - src - type_coverage: - return_type: 100 - param_type: 98 - property_type: 100 + + ignoreErrors: + - + message: "#^Out of .* possible param types, only .* %% actually have it\\. Add more param types to get over .* %%$#" + reportUnmatched: false diff --git a/src/Components/Health/Checker/HealthChecker/MysqlChecker.php b/src/Components/Health/Checker/HealthChecker/MysqlChecker.php index 4ee105d..485d13f 100644 --- a/src/Components/Health/Checker/HealthChecker/MysqlChecker.php +++ b/src/Components/Health/Checker/HealthChecker/MysqlChecker.php @@ -100,8 +100,9 @@ private function checkMysqlVersion(HealthCollection $collection, string $version private function extract(string $versionString): array { if (mb_stripos($versionString, 'mariadb') === false) { - if (mb_strpos($versionString, '-')) { - $versionString = mb_substr($versionString, 0, mb_strpos($versionString, '-')); + $versionMetaPos = mb_strpos($versionString, '-'); + if ($versionMetaPos) { + $versionString = mb_substr($versionString, 0, $versionMetaPos); } return ['mysql' => $versionString]; diff --git a/src/Components/LineReader.php b/src/Components/LineReader.php index b067113..de2972c 100644 --- a/src/Components/LineReader.php +++ b/src/Components/LineReader.php @@ -100,7 +100,7 @@ private static function readBackwards($fh, int $pos): \Generator $pos -= $bufferSize; } fseek($fh, $pos); - if ($bufferSize < 0) { + if ($bufferSize < 1) { throw new \RuntimeException('Buffer size cannot be negative'); } $chunk = fread($fh, $bufferSize);