Skip to content

feat: support PHP 8.1 - #60

Merged
PrestaEdit merged 4 commits into
mainfrom
feat/php-8.1-support
Aug 17, 2026
Merged

feat: support PHP 8.1#60
PrestaEdit merged 4 commits into
mainfrom
feat/php-8.1-support

Conversation

@PrestaEdit

Copy link
Copy Markdown
Contributor

Contexte

Suite à l'investigation menée après la mise en place de la CI (#59) : le blocage sur PHP 8.2+ n'était pas dû au code de la lib mais à un lockfile qui avait résolu symfony/* en 7.x (qui exige PHP 8.2) alors que composer.json déclare symfony/* ^6.0. Aucune syntaxe 8.2+ n'est utilisée dans src/.

PrestaShop 8.x tourne encore sur PHP 8.1, donc supporter cette version élargit la couverture réelle des utilisateurs de la lib.

Changements

composer.json

  • require: "php": "^8.1".
  • config.platform.php = 8.1.0 pour que toute regen future du lock reste compatible 8.1.

composer.lock — regénéré :

  • symfony/* : 7.3.x → 6.4 LTS (event-dispatcher, filesystem, process, string, console, etc.)
  • chrome-php/chrome : 1.14.0 → 1.16.1
  • phpunit/phpunit : 10.5.63 → 10.5.64
  • diverses mises à jour patch mineures

.github/workflows/tests.yml — remet 8.1 dans la matrice → ['8.1', '8.2', '8.3', '8.4'].

Vérification locale

vendor/bin/phpunit --testsuite Unit
OK (117 tests, 442 assertions)

À faire en suivant (hors PR)

Point de vigilance

Symfony 6.4 atteint son EOL en novembre 2027. Il faudra alors bumper à nouveau à PHP 8.2+ pour passer à Symfony 7.x. Un rappel en commentaire dans le commit message.

Ce qui n'a pas été fait

PHP 8.0 — investigué mais bloqué par sapientpro/image-comparator ^1.0 (PHP ^8.1) et phpunit ^10 (PHP 8.1+), sans version de rechange raisonnable. PHP 8.0 est de toute façon en fin de vie.

🤖 Generated with Claude Code

PrestaEdit and others added 4 commits August 17, 2026 10:36
Downshift the minimum PHP requirement from 8.2 to 8.1. The source code
itself has no 8.2-specific syntax — the previous 8.2 floor was purely
an accident of the lockfile: composer had resolved symfony/* to 7.x
(which requires 8.2) even though composer.json only asks for ^6.0.

Changes:
- composer.json: add "php": "^8.1" to require, and pin
  config.platform.php = 8.1.0 so future lockfile regens stay compatible.
- composer.lock: regenerated against the 8.1 platform — symfony/* drops
  to the 6.4 LTS line, chrome-php/chrome to 1.16.1, phpunit to 10.5.64.
- .github/workflows/tests.yml: add 8.1 back to the matrix.

Rationale: PrestaShop 8.x still runs on PHP 8.1, so widening support
matches real-world PrestaShop installs.

Note: symfony 6.4 reaches EOL in November 2027 — at that point we'll
need to bump back to 8.2+ to move to symfony 7.x.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Constants in traits require PHP 8.2+. Traits\Version had a
SUPPORTED_VERSIONS const used only internally (self::SUPPORTED_VERSIONS
on a single line, no external references). Converting it to a private
static array preserves the "shared list at the top of the file"
readability while restoring PHP 8.1 compatibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Same PHP 8.1 constraint as Traits\Version: constants cannot live inside
a trait before PHP 8.2. The Output trait held ten public constants
(state markers PASS/FAIL/… and output modes) referenced from three
places: internally via self::PASS, and externally in TestsSuite and
ExecuteSuite via self::OUTPUT_* — both of which relied on the trait
injecting the constants onto the using class.

Move the constants into a new OutputStates interface and have
TestsSuite / ExecuteSuite implement it. self::PASS inside the trait
still resolves because a trait's self:: binds to the using class, and
that class now inherits the constants through the interface. All
external self::OUTPUT_* references keep working unchanged.

Also fully qualified: PrestaFlow\Library\Utils\OutputStates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@PrestaEdit
PrestaEdit merged commit a246da6 into main Aug 17, 2026
5 checks passed
@PrestaEdit
PrestaEdit deleted the feat/php-8.1-support branch August 17, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant