CI: migrate PHPStan to PrestaShop/.github action#44
Merged
jolelievre merged 10 commits intoJun 11, 2026
Conversation
Replace the Docker-based phpstan.sh approach with the shared PrestaShop/.github PHPStan action. The old approach was failing because the prestashop/prestashop:latest Docker image now exits immediately (due to entrypoint changes), causing "No such container: temp-ps" errors. - Add tests/php/phpstan/ with version-specific neon configs for 8.1.7, 8.2.x, 9.1.x and develop - Add prepend-constants.php for PS 9.x bootstrap constants - Replace single Docker-based phpstan job with two action-based jobs: phpstan-74 (PS 8.x, PHP 7.4-8.1) and phpstan (PS 9.x, PHP 8.1-8.5) - Remove tests/phpstan.sh (no longer needed) Fixes #ISSUE Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello @mattgoud! This is your first pull request on pagesnotfound repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
- Add missing blank line after <?php in index.php (php-cs-fixer) - Add ignoreErrors for pre-existing PHPStan errors on PS 8.x Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Declare the full row shape returned by executeS() via a @var PHPDoc and stop mutating $row['http_referer'] (use a local $httpReferer variable), so PHPStan no longer narrows $row to array{http_referer: string} and correctly recognizes the request_uri and nb offsets. Cast nb to int for the counter arithmetic. Removes the now-unneeded ignoreErrors from the PS 8.x PHPStan configs. Fixes PrestaShop#45 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…figs The PHPStan CI no longer covers PS 1.7.x / 8.0 (the shared PrestaShop/.github action targets 8.1.7+). Bump ps_versions_compliancy min from 1.7.7 to 8.1.0 so the declared support matches what CI actually verifies, consistent with sibling native modules (ps_googleanalytics, ps_emailsubscription). Also remove the orphaned tests/phpstan/ directory (1.7.7/1.7.8/8.0/latest neon configs) left behind by the migration to tests/php/phpstan/ — no workflow references it anymore. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All four version-specific PHPStan configs now contain only the `includes` block, removing the leftover empty `parameters: / ignoreErrors:` scaffolding that suppressed nothing. Consistent across versions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the 8.1.7 target to match the project-wide module cleanup Epic which standardizes native modules on PS 8.2+: - php.yml: phpstan-74 matrix now runs against 8.2.x only (PHP 7.4/8.1) - ps_versions_compliancy min bumped 8.1.0 -> 8.2.0 - remove the now-unreferenced phpstan-8.1.7.neon config Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jolelievre
reviewed
Jun 8, 2026
…9.0.3 - php-linter: add missing intermediate syntax checks (7.3, 8.1, 8.2, 8.3, 8.4) - phpstan-74: lower floor to PHP 7.2 (real minimum for PS 8.2.x) - phpstan: add PrestaShop 9.0.3 (tag) + neon config Part of PrestaShop/PrestaShop#41648 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jolelievre
reviewed
Jun 10, 2026
Co-authored-by: Jonathan Lelievre <jo.lelievre@gmail.com>
jolelievre
previously approved these changes
Jun 10, 2026
jolelievre
reviewed
Jun 10, 2026
| matrix: | ||
| presta-versions: ['1.7.7', '1.7.8', '8.0', 'latest'] | ||
| presta_version: ['9.0.3', '9.1.x', 'develop'] | ||
| php_version: ['8.1', '8.5'] |
Contributor
There was a problem hiding this comment.
Ah wait! The 8.5 won't work for 9.0.3
Contributor
Author
There was a problem hiding this comment.
ok @jolelievre, fixed, switched to an explicit include list so 9.0.3 caps at 8.4 (no more 9.0.3 x 8.5), while 9.1.x and develop still test up to 8.5
PrestaShop 9.0.x supports PHP 8.1 up to 8.4 only, so the cross-product matrix was generating an invalid 9.0.3 x 8.5 combination. Switch to an explicit include list so each PrestaShop version tests its proper PHP floor and ceiling (9.0.3: 8.1/8.4, 9.1.x and develop: 8.1/8.5). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
correction: this is a major bump, not a patch — version set to 4.0.0 (pagesnotfound.php + config.xml) |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c854b0e to
1c3393a
Compare
|
PR merged, well done! Message to @PrestaShop/committers: do not forget to milestone it before the merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/phpstan.sh) was failing withError response from daemon: No such container: temp-psbecause theprestashop/prestashop:latestDocker image now exits immediately due to entrypoint changes, causing the volume container to disappear before PHPStan can use it.This PR migrates to the shared
PrestaShop/.githubPHPStan action (as used byps_googleanalytics,ps_emailsubscription,blockreassurance):- Adds
tests/php/phpstan/with version-specific neon configs for8.2.x,9.0.3,9.1.xanddevelop- Replaces the single Docker-based job with two action-based jobs:
phpstan-74(PS 8.2.x / PHP 7.2–8.1) andphpstan(PS 9.x —9.0.3,9.1.x,develop/ PHP 8.1–8.5, with9.0.3capped at PHP 8.4 since PS 9.0.x does not support 8.5)- Expands the
php-linterjob to check every PHP version from 7.2 to 8.5 (adds the missing 7.3, 8.1, 8.2, 8.3, 8.4 intermediates)- Removes
tests/phpstan.shand the now-orphaned legacytests/phpstan/configs (1.7.7/1.7.8/8.0/latest)- Fixes the pre-existing PHPStan offset errors in
getPages()by declaring the DB row shape via a@varPHPDoc instead of mutating$row(noignoreErrorsneeded)- Bumps
ps_versions_compliancymin from1.7.7to8.2.0so the declared support matches the PS 8.2+ baseline targeted by the module cleanup Epic and what the CI actually verifies, consistent with sibling native modulesPart of PrestaShop/PrestaShop#41648