Add PHP CS Fixer and PHPStan max to CI; remove abandoned GoutteFactory
- 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>
This commit is contained in:
@@ -15,26 +15,17 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
class SahiFactory implements DriverFactory
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDriverName()
|
||||
public function getDriverName(): string
|
||||
{
|
||||
return 'sahi';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function supportsJavascript()
|
||||
public function supportsJavascript(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configure(ArrayNodeDefinition $builder)
|
||||
public function configure(ArrayNodeDefinition $builder): void
|
||||
{
|
||||
$builder
|
||||
->children()
|
||||
@@ -48,29 +39,27 @@ class SahiFactory implements DriverFactory
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @param array<string, mixed> $config
|
||||
*/
|
||||
public function buildDriver(array $config)
|
||||
public function buildDriver(array $config): Definition
|
||||
{
|
||||
trigger_deprecation('friends-of-behat/mink-extension', '2.8.0', 'Configuration for the "sahi" driver is deprecated, since the client implementation has been abandoned. Support for it will be removed in the next major version of this extension.');
|
||||
|
||||
if (!class_exists('Behat\Mink\Driver\SahiDriver')) {
|
||||
throw new \RuntimeException(
|
||||
'Install MinkSahiDriver in order to use sahi driver.'
|
||||
);
|
||||
throw new \RuntimeException('Install MinkSahiDriver in order to use sahi driver.');
|
||||
}
|
||||
|
||||
return new Definition('Behat\Mink\Driver\SahiDriver', array(
|
||||
return new Definition('Behat\Mink\Driver\SahiDriver', [
|
||||
'%mink.browser_name%',
|
||||
new Definition('Behat\SahiClient\Client', array(
|
||||
new Definition('Behat\SahiClient\Connection', array(
|
||||
new Definition('Behat\SahiClient\Client', [
|
||||
new Definition('Behat\SahiClient\Connection', [
|
||||
$config['sid'],
|
||||
$config['host'],
|
||||
$config['port'],
|
||||
$config['browser'],
|
||||
$config['limit'],
|
||||
)),
|
||||
)),
|
||||
));
|
||||
]),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user