Skip to content

Modernise CI: Behat 4 + Symfony 8 matrix, PHPStan, CS Fixer, source cleanup - #19

Merged
pamil merged 4 commits into
masterfrom
ci/modernize-php-symfony-requirements
Jun 12, 2026
Merged

Modernise CI: Behat 4 + Symfony 8 matrix, PHPStan, CS Fixer, source cleanup#19
pamil merged 4 commits into
masterfrom
ci/modernize-php-symfony-requirements

Conversation

@pamil

@pamil pamil commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Expand CI matrix with correct version constraints:
    • Stable: PHP 8.3–8.5 × Symfony 7.4 × Behat 3.31
    • Experimental (continue-on-error: true): Behat 4.x-dev × Symfony 7.4/8.0/8.1 — PHP 8.3 excluded from Symfony 8.x rows (Symfony 8 requires PHP ≥8.4; Behat 3 cannot install alongside Symfony 8)
  • Add bin/lock-symfony-version.sh and bin/lock-behat-version.sh for CI version pinning via safe jq … > tmp && mv pattern
  • Add PHPStan (level 8, baseline for existing issues, treatPhpDocTypesAsCertain: false, bootstrap defining BEHAT_BIN_PATH) and php-cs-fixer (@Symfony ruleset) with dedicated CI jobs
  • Widen composer.json: behat/behat ^3.31 || 4.x-dev, all symfony/* to ^7.4 || ^8.0, added symfony/routing (needed for static analysis of SymfonyPage), minimum-stability: dev + prefer-stable: true

Source simplifications

  • Fix dead array_map in Page::resolveParameters and Element::resolveParameters — result was silently discarded; parameter substitution never applied for array-style selectors
  • Extract SymfonyPage::matchCurrentRoute() — removes verbatim-duplicated parse_url → preg_replace → router->match block shared by verifyRoute() and verifyUrl()
  • Replace assertProcessIsAvailable() with getProcess(): Process (non-nullable return, PHPStan-friendly) in TestContext
  • parse_url($url, PHP_URL_PATH) ?? '/' — null-safe path extraction replacing parse_url($url)['path']
  • Drop unused catch variable bindings; array_key_first() over key(); remove redundant @var array docblock and @param docblocks already covered by union types

🤖 Generated with Claude Code

pamil and others added 4 commits June 12, 2026 13:56
- Require PHP ^8.3 (drop EOL PHP 7.x, 8.0, 8.1, 8.2)
- Require behat/mink ^1.9 (from ^1.7)
- Require symfony/routing ^7.4 in require-dev (drop EOL 3.x/4.x/5.x)
- Modernize source: typed properties, constructor promotion, union types,
  str_starts_with(), remove manual ArrayAccess validation (now enforced by type)
- Add .github/workflows/build.yml: composer validation + PHP syntax check
  across PHP 8.3/8.4/8.5
- Bump branch alias to 0.4-dev

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add dev dependencies: behat/behat, symfony/filesystem, symfony/process, symfony/yaml
- Add autoload-dev entry for tests namespace
- Add TestContext with subprocess behat runner + FakeDriver step
- Add ArrayConfig wrapper for PHP-format behat config
- Add behat.dist.php (behat 4.x) and behat.yml.dist (behat 3.x) outer configs
- Add feature files covering page opening, isOpen checks, and element lookup
- Update CI to run behat tests across PHP 8.3–8.5

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- FakeDriver: use findElementXpaths() instead of overriding final find()
- FakeDriver: remove isDisabled() which is not part of DriverInterface
- thereIsFile: guard replaceAnnotationsWithAttributes with str_contains
  check — skips the regex for files that have no annotations
- thereIsFeatureFile: drop redundant md5() wrapping uniqid()
- assertOutputMatches: collapse dead false-branch (preg_quote always
  produces a valid pattern) into a single if check

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…lifications

- Expand CI matrix: stable PHP 8.3–8.5 × Symfony 7.4 × Behat 3.31; experimental
  rows for Behat 4.x-dev × Symfony 7.4/8.0/8.1 with continue-on-error: true
  (PHP 8.3 excluded from Symfony 8.x per its PHP ≥8.4 requirement)
- Add bin/lock-symfony-version.sh and bin/lock-behat-version.sh for CI pinning
- Add check-cs (php-cs-fixer) and static-analysis (PHPStan level 8) CI jobs
- Widen composer.json: behat/behat ^3.31||4.x-dev, symfony/* ^7.4||^8.0;
  add phpstan/phpstan ^2.0, php-cs-fixer ^3.75, symfony/routing; set
  minimum-stability: dev + prefer-stable: true
- Add phpstan.neon with bootstrap (defines BEHAT_BIN_PATH), level 8 baseline,
  treatPhpDocTypesAsCertain: false; add .php-cs-fixer.dist.php (@symfony ruleset)
- Fix dead array_map in Page/Element resolveParameters (result was discarded)
- Extract SymfonyPage::matchCurrentRoute() to remove duplicated URL-parse block
- Replace assertProcessIsAvailable() with getProcess(): Process (non-nullable)
- Use parse_url($url, PHP_URL_PATH) ?? '/' for null-safe path extraction
- Drop unused catch variable bindings; use array_key_first() over key()

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@pamil pamil changed the title Drop PHP <8.3 and Symfony <7.4, add CI workflow Modernise CI: Behat 4 + Symfony 8 matrix, PHPStan, CS Fixer, source cleanup Jun 12, 2026
@pamil
pamil merged commit ed51844 into master Jun 12, 2026
16 checks passed
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