Skip to content

CI: align PHPStan on PS 8.2+, refresh neon configs and fix renderCartPage error#178

Merged
jolelievre merged 8 commits into
PrestaShop:devfrom
mattgoud:fix-ci-remove-9.0.x-phpstan
Jun 11, 2026
Merged

CI: align PHPStan on PS 8.2+, refresh neon configs and fix renderCartPage error#178
jolelievre merged 8 commits into
PrestaShop:devfrom
mattgoud:fix-ci-remove-9.0.x-phpstan

Conversation

@mattgoud

@mattgoud mattgoud commented Jun 2, 2026

Copy link
Copy Markdown
Contributor
Questions Answers
Branch? dev
Description? The phpstan-80-84 CI job targeted PrestaShop 9.0.x which no longer exists as a branch, causing systematic PHPStan failures. Rather than dropping PS 9.0 coverage, this PR moves it into the main phpstan job using the 9.0.3 tag 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.7 PHPStan target (the PHP 7.4/8.1 job now runs 8.2.x only)
- replaces the dead phpstan-9.0.x.neon (branch) with phpstan-9.0.3.neon (tag) and removes the orphaned phpstan-8.1.7.neon
- the phpstan job now targets 9.0.3, 9.1.x and develop (PHP 8.1–8.5, with 9.0.3 capped at PHP 8.4 since PS 9.0.x does not support 8.5)
- expands php-linter to check every PHP version from 7.2 to 8.5 (the phpstan-74 analysis job stays on PHP 7.4, as the module's dev tooling — prestashop/php-dev-tools — requires it)
- bumps ps_versions_compliancy min to 8.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 remaining ignoreErrors are documented inline as genuine framework/structural limitations: Cookie magic __get/__set properties, parent::uninstall() called through a closure rebound via Closure::bindTo(), and the HookActionValidateOrder::$module property (the HookInterface constructor signature mandates the $module argument, so it must be stored even in hooks that never read it back).
Type? improvement
BC breaks? no
Deprecations? no
Fixed issue or discussion? Part of PrestaShop/PrestaShop#41648
Sponsor company PrestaShop SA

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>
@ps-jarvis

Copy link
Copy Markdown

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!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Jun 2, 2026
@mattgoud mattgoud self-assigned this Jun 2, 2026
@mattgoud mattgoud added the bug label Jun 2, 2026
mattgoud and others added 3 commits June 8, 2026 17:49
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>
@mattgoud mattgoud force-pushed the fix-ci-remove-9.0.x-phpstan branch from fcc484c to 3b86d3c Compare June 8, 2026 16:24
@mattgoud mattgoud changed the title CI: remove PHPStan job targeting PrestaShop 9.0.x CI: align PHPStan on PS 8.2+, prune obsolete neon configs and fix renderCartPage error Jun 8, 2026
Comment thread .github/workflows/php.yml
composer-version: '2.2.18'

# Run PHPStan against the module (PHP 8.1 – 8.4)
phpstan-80-84:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove those?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@mattgoud mattgoud changed the title CI: align PHPStan on PS 8.2+, prune obsolete neon configs and fix renderCartPage error CI: align PHPStan on PS 8.2+, refresh neon configs and fix renderCartPage error Jun 9, 2026
mattgoud and others added 2 commits June 9, 2026 17:25
- 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>
@ps-jarvis ps-jarvis added the Waiting for QA Status: Action required, Waiting for test feedback label Jun 10, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Jun 10, 2026

@jf-viguier jf-viguier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes asked to fit source of truth from @Progi1984 PrestaShop/PrestaShop#41648

Comment thread .github/workflows/php.yml
composer-version: '2.2.18'

# Run PHPStan against the module (PHP 8.1 – 8.4)
phpstan-80-84:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to source of truth here PrestaShop/PrestaShop#41648
9.0.3 is not supported, only 9.1.x and develop

Comment thread .github/workflows/php.yml
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' }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use matrix style

presta_version: ['9.1.x', 'develop']
php_version: ['8.1', '8.5']

@mattgoud mattgoud Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).

@mattgoud

mattgoud commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

correction: this is a major bump, not a patch — version set to 6.0.0 (ps_googleanalytics.php + config.xml)

@mattgoud mattgoud requested a review from jf-viguier June 11, 2026 09:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mattgoud mattgoud force-pushed the fix-ci-remove-9.0.x-phpstan branch from aa9d8cd to fd269ff Compare June 11, 2026 09:37
@jolelievre jolelievre dismissed jf-viguier’s stale review June 11, 2026 09:44

We still need to test at least one version per minor, so this one is fine It was forgotten in the reference PR

@jolelievre jolelievre merged commit 11d786d into PrestaShop:dev Jun 11, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from To be tested to Merged in PR Dashboard Jun 11, 2026
@ps-jarvis

Copy link
Copy Markdown

PR merged, well done!

Message to @PrestaShop/committers: do not forget to milestone it before the merge.

@mattgoud mattgoud added this to the 6.0.0 milestone Jun 19, 2026
@mattgoud mattgoud removed waiting for author Waiting for QA Status: Action required, Waiting for test feedback labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

5 participants