Modernise CI: Behat 4 + Symfony 8 matrix, PHPStan, CS Fixer, source cleanup - #19
Merged
Merged
Conversation
- 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>
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.
Summary
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)bin/lock-symfony-version.shandbin/lock-behat-version.shfor CI version pinning via safejq … > tmp && mvpatterntreatPhpDocTypesAsCertain: false, bootstrap definingBEHAT_BIN_PATH) and php-cs-fixer (@Symfonyruleset) with dedicated CI jobscomposer.json:behat/behat ^3.31 || 4.x-dev, allsymfony/*to^7.4 || ^8.0, addedsymfony/routing(needed for static analysis ofSymfonyPage),minimum-stability: dev+prefer-stable: trueSource simplifications
array_mapinPage::resolveParametersandElement::resolveParameters— result was silently discarded; parameter substitution never applied for array-style selectorsSymfonyPage::matchCurrentRoute()— removes verbatim-duplicatedparse_url → preg_replace → router->matchblock shared byverifyRoute()andverifyUrl()assertProcessIsAvailable()withgetProcess(): Process(non-nullable return, PHPStan-friendly) inTestContextparse_url($url, PHP_URL_PATH) ?? '/'— null-safe path extraction replacingparse_url($url)['path']array_key_first()overkey(); remove redundant@var arraydocblock and@paramdocblocks already covered by union types🤖 Generated with Claude Code