CI: align PHPStan on PS 8.2+, refresh neon configs and fix renderCartPage error#178
Conversation
The 9.0.x branch no longer exists. PHPStan coverage for PS 9.x is already provided by the phpstan job targeting 9.1.x and develop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello @mattgoud! This is your first pull request on ps_googleanalytics repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
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 to 8.2.0 - remove the now-unreferenced phpstan-8.1.7.neon config - remove the orphaned phpstan-9.0.x.neon config (no longer in the matrix) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop dead PHPStan configs no longer referenced by the CI matrix (targeting PrestaShop versions < 8.2): - phpstan-1.7.7.neon - phpstan-1.7.8.neon - phpstan-8.0.neon - phpstan-latest.neon Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Epic #41648) renderCartPage(): the method definition used a different case (renderCartpage) than its call site at run() (renderCartPage). PHP method names are case-insensitive so it worked at runtime, but the PHPStan 0.12 job flagged the definition as unused. Align the casing and drop its ignoreErrors entry. The remaining ignoreErrors are genuine framework/structural limitations, now documented inline in the neon configs: - Cookie magic __get/__set properties (ga_admin_order / ga_admin_refund) - parent::uninstall() called through a closure rebound via Closure::bindTo() - HookActionValidateOrder::$module: HookInterface mandates the (Ps_Googleanalytics $module, Context) constructor signature, so $module must be stored even though this hook never reads it back Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fcc484c to
3b86d3c
Compare
| composer-version: '2.2.18' | ||
|
|
||
| # Run PHPStan against the module (PHP 8.1 – 8.4) | ||
| phpstan-80-84: |
There was a problem hiding this comment.
ok @jolelievre good point, re-added it using the 9.0.3 tag instead of the deleted 9.0.x branch: presta_version: ['9.0.3', '9.1.x', 'develop'] + matching phpstan-9.0.3.neon.
There was a problem hiding this comment.
According to source of truth here PrestaShop/PrestaShop#41648
9.0.3 is not supported, only 9.1.x and develop
…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, the 9.0.x branch no longer exists) + neon config Part of PrestaShop/PrestaShop#41648 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- phpstan-9.0.3.neon was missing the ignoreErrors block (framework/structural limitations), so the PS 9.0.3 jobs reported them as errors; align it with the 9.1.x/develop configs - restore the phpstan-74 floor to PHP 7.4: the module's dev tooling (prestashop/php-dev-tools) pulls a dependency requiring PHP >= 7.4, so composer install fails on 7.2 (php-linter still covers 7.2 at the syntax level) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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). Also make the "Prepare PHP env" step name reflect the actual matrix version. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jf-viguier
left a comment
There was a problem hiding this comment.
Small changes asked to fit source of truth from @Progi1984 PrestaShop/PrestaShop#41648
| composer-version: '2.2.18' | ||
|
|
||
| # Run PHPStan against the module (PHP 8.1 – 8.4) | ||
| phpstan-80-84: |
There was a problem hiding this comment.
According to source of truth here PrestaShop/PrestaShop#41648
9.0.3 is not supported, only 9.1.x and develop
| php_version: ['8.1', '8.5'] | ||
| include: | ||
| # PrestaShop 9.0.x supports PHP 8.1 up to 8.4 (8.5 is not supported) | ||
| - { presta_version: '9.0.3', php_version: '8.1' } |
There was a problem hiding this comment.
Please use matrix style
presta_version: ['9.1.x', 'develop']
php_version: ['8.1', '8.5']
There was a problem hiding this comment.
hello @jf-viguier, We need to test tag 9.0.3 (because the 9.0.x branch no longer exists). I've forwarded your comment to the team to be sure. The goal is to keep the modules up-to-date without any gaps, because even shops on 9.0.x may need to upgrade their modules. Therefore, it was decided to adopt and maintain a compatibility range for the modules.
There was a problem hiding this comment.
@jf-viguier, for the matrix, we can't use the previous style because, as we're testing 9.0.3, this version doesn't support PHP 8.5 (hence the need for a more atomic approach using the "includes" attribute).
|
correction: this is a major bump, not a patch — version set to 6.0.0 (ps_googleanalytics.php + config.xml) |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
aa9d8cd to
fd269ff
Compare
We still need to test at least one version per minor, so this one is fine It was forgotten in the reference PR
|
PR merged, well done! Message to @PrestaShop/committers: do not forget to milestone it before the merge. |
phpstan-80-84CI job targeted PrestaShop9.0.xwhich no longer exists as a branch, causing systematic PHPStan failures. Rather than dropping PS 9.0 coverage, this PR moves it into the mainphpstanjob using the9.0.3tag instead of the removed branch.This PR also aligns the module on the PS 8.2+ baseline targeted by the cleanup Epic:
- drops the
8.1.7PHPStan target (the PHP 7.4/8.1 job now runs8.2.xonly)- replaces the dead
phpstan-9.0.x.neon(branch) withphpstan-9.0.3.neon(tag) and removes the orphanedphpstan-8.1.7.neon- the
phpstanjob now targets9.0.3,9.1.xanddevelop(PHP 8.1–8.5, with9.0.3capped at PHP 8.4 since PS 9.0.x does not support 8.5)- expands
php-linterto check every PHP version from 7.2 to 8.5 (thephpstan-74analysis job stays on PHP 7.4, as the module's dev tooling —prestashop/php-dev-tools— requires it)- bumps
ps_versions_compliancymin to8.2.0- removes 4 orphaned legacy PHPStan neon configs no longer referenced by the matrix (
1.7.7,1.7.8,8.0,latest)- fixes a PHPStan error directly instead of suppressing it: aligns the
renderCartPage()method casing with its call site (PHP is case-insensitive so it worked at runtime, but the PHPStan 0.12 job flagged it as unused). The remainingignoreErrorsare documented inline as genuine framework/structural limitations: Cookie magic__get/__setproperties,parent::uninstall()called through a closure rebound viaClosure::bindTo(), and theHookActionValidateOrder::$moduleproperty (theHookInterfaceconstructor signature mandates the$moduleargument, so it must be stored even in hooks that never read it back).