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:
Kamil Kokot
2026-06-12 17:43:01 +02:00
parent dff5cbd479
commit 47a9d45cd1
38 changed files with 436 additions and 720 deletions

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class AppiumFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_appium()
public function it_is_named_appium()
{
$this->getDriverName()->shouldReturn('appium');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -2,22 +2,22 @@
namespace spec\Behat\MinkExtension\ServiceContainer\Driver;
use PhpSpec\ObjectBehavior;
use Behat\MinkExtension\ServiceContainer\Driver\DriverFactory;
use PhpSpec\ObjectBehavior;
class BrowserKitFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType(DriverFactory::class);
}
function it_is_named_browserkit()
public function it_is_named_browserkit()
{
$this->getDriverName()->shouldReturn('browserkit_http');
}
function it_does_not_support_javascript()
public function it_does_not_support_javascript()
{
$this->supportsJavascript()->shouldBe(false);
}

View File

@@ -3,21 +3,20 @@
namespace spec\Behat\MinkExtension\ServiceContainer\Driver;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class BrowserStackFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_browser_stack()
public function it_is_named_browser_stack()
{
$this->getDriverName()->shouldReturn('browser_stack');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -1,23 +0,0 @@
<?php
namespace spec\Behat\MinkExtension\ServiceContainer\Driver;
use PhpSpec\ObjectBehavior;
class GoutteFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_goutte()
{
$this->getDriverName()->shouldReturn('goutte');
}
function it_does_not_support_javascript()
{
$this->supportsJavascript()->shouldBe(false);
}
}

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class SahiFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_sahi()
public function it_is_named_sahi()
{
$this->getDriverName()->shouldReturn('sahi');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class SauceLabsFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_sauce_labs()
public function it_is_named_sauce_labs()
{
$this->getDriverName()->shouldReturn('sauce_labs');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class Selenium2FactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_selenium2()
public function it_is_named_selenium2()
{
$this->getDriverName()->shouldReturn('selenium2');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class SeleniumFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_selenium()
public function it_is_named_selenium()
{
$this->getDriverName()->shouldReturn('selenium');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -2,8 +2,8 @@
namespace spec\Behat\MinkExtension\ServiceContainer\Driver;
use PhpSpec\ObjectBehavior;
use Behat\MinkExtension\ServiceContainer\Driver\DriverFactory;
use PhpSpec\ObjectBehavior;
class WebdriverClassicFactorySpec extends ObjectBehavior
{

View File

@@ -6,17 +6,17 @@ use PhpSpec\ObjectBehavior;
class ZombieFactorySpec extends ObjectBehavior
{
function it_is_a_driver_factory()
public function it_is_a_driver_factory()
{
$this->shouldHaveType('Behat\MinkExtension\ServiceContainer\Driver\DriverFactory');
}
function it_is_named_zombie()
public function it_is_named_zombie()
{
$this->getDriverName()->shouldReturn('zombie');
}
function it_supports_javascript()
public function it_supports_javascript()
{
$this->supportsJavascript()->shouldBe(true);
}

View File

@@ -6,12 +6,12 @@ use PhpSpec\ObjectBehavior;
class MinkExtensionSpec extends ObjectBehavior
{
function it_is_a_testwork_extension()
public function it_is_a_testwork_extension()
{
$this->shouldHaveType('Behat\Testwork\ServiceContainer\Extension');
}
function it_is_named_mink()
public function it_is_named_mink()
{
$this->getConfigKey()->shouldReturn('mink');
}