- Replace all local-variable @var annotations with proper type guards:
- MinkExtension configure closure: build inner array directly
($sessions[$driverType] = [$driverType => ...]) to avoid mixed offset access
- MinkExtension loadSessions: add is_array($session) guard inside foreach
so PHPStan narrows $session from mixed to array before key() call
- DriverFactory::buildDriver @param broadened from array<string, mixed>
to array<mixed> — is_array() only narrows to array<mixed> (key type
unknown), so array<string, mixed> was unreachable at the call site
- MinkAwareInitializer: move @var from inside constructor parameter list
to a proper @param on the method docblock
- SessionsListenerSpec: replace 'goutte' (deleted driver) with
'browserkit_http' as the example default session name
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add friendsofphp/php-cs-fixer ^3.75 and phpstan/phpstan ^2.0 to
require-dev; add .php-cs-fixer.dist.php (@Symfony ruleset with
phpdoc_to_comment ignored_tags) and phpstan.neon (level max,
treatPhpDocTypesAsCertain: false)
- Run CS Fixer and PHPStan in every CI matrix job alongside tests
- Add composer scripts: cs, cs-check, phpstan
- Add .php-cs-fixer.cache to .gitignore
- Fix all PHPStan max violations across src/: add return/param types,
narrow mixed config values with is_string()/is_array() guards,
use TaggedNodeInterface for scenario tag access in SessionsListener
- Remove GoutteFactory and its spec — the goutte driver and its
underlying client library are abandoned
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Mark Goutte, Selenium, Sahi and Zombie driver/support as abandoned
This marks the four drivers as abandoned where the driver implementations are no longer maintained.
* Correctly indent notes so they don't break the enumeration list
* Indent a few more notes that are part of a numerated list
The configuration now makes sessions a first-class citizen instead of
being centered around drivers. This allows defining several session based
on the same driver type.
Instead of allowing other extensions to register their own sessions to add
new drivers, they can now register a DriverFactory in the MinkExtension
during the extension initialization to make a new driver type available.