Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use matrix generator #307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
31 changes: 29 additions & 2 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
9 changes: 5 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions src/Components/Health/Checker/HealthChecker/MysqlChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/Components/LineReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading