Bump package versions and fix errors
This commit is contained in:
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@@ -17,15 +17,15 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-version:
|
||||
- '8.1'
|
||||
- '8.2'
|
||||
- '8.3'
|
||||
- '8.4'
|
||||
symfony-version:
|
||||
- '6.2.*'
|
||||
- '6.4.*'
|
||||
- '7.0.*'
|
||||
exclude:
|
||||
- '7.3.*'
|
||||
include:
|
||||
- php-version: '8.1'
|
||||
symfony-version: '7.0.*'
|
||||
symfony-version: '6.4.*'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
1
.php-version
Normal file
1
.php-version
Normal file
@@ -0,0 +1 @@
|
||||
8.3
|
||||
@@ -12,9 +12,9 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"behat/behat": "^3.6.1",
|
||||
"symfony/dependency-injection": "^6.2 || ^7.0",
|
||||
"symfony/http-kernel": "^6.2 || ^7.0"
|
||||
"behat/behat": "^3.22",
|
||||
"symfony/dependency-injection": "^6.4 || ^7.0",
|
||||
"symfony/http-kernel": "^6.4 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"behat/mink-browserkit-driver": "^2.0",
|
||||
@@ -24,11 +24,11 @@
|
||||
"friends-of-behat/page-object-extension": "^0.3.2",
|
||||
"friends-of-behat/service-container-extension": "^1.1",
|
||||
"sylius-labs/coding-standard": ">=4.1.1, <=4.2.1",
|
||||
"symfony/browser-kit": "^6.2 || ^7.0",
|
||||
"symfony/framework-bundle": "^6.2 || ^7.0",
|
||||
"symfony/process": "^6.2 || ^7.0",
|
||||
"symfony/yaml": "^6.2 || ^7.0",
|
||||
"vimeo/psalm": "4.30.0"
|
||||
"symfony/browser-kit": "^6.4 || ^7.0",
|
||||
"symfony/framework-bundle": "^6.4 || ^7.0",
|
||||
"symfony/process": "^6.4 || ^7.0",
|
||||
"symfony/yaml": "^6.4 || ^7.0",
|
||||
"vimeo/psalm": "^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"behat/mink-browserkit-driver": "^2.0",
|
||||
|
||||
52
psalm.xml
52
psalm.xml
@@ -14,24 +14,62 @@
|
||||
</projectFiles>
|
||||
|
||||
<issueHandlers>
|
||||
<UndefinedClass>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="Symfony\Component\BrowserKit\AbstractBrowser" />
|
||||
<referencedClass name="Symfony\Component\BrowserKit\Client" />
|
||||
<referencedClass name="Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator" />
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
<InvalidAttribute>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/Mink/MinkParameters.php" />
|
||||
</errorLevel>
|
||||
</InvalidAttribute>
|
||||
|
||||
<InvalidOperand>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/ServiceContainer/SymfonyExtension.php" />
|
||||
</errorLevel>
|
||||
</InvalidOperand>
|
||||
|
||||
<InvalidReturnStatement>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/Context/Environment/InitializedSymfonyExtensionEnvironment.php" />
|
||||
</errorLevel>
|
||||
</InvalidReturnStatement>
|
||||
|
||||
<InvalidReturnType>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/Context/Environment/InitializedSymfonyExtensionEnvironment.php" />
|
||||
</errorLevel>
|
||||
</InvalidReturnType>
|
||||
|
||||
<MissingTemplateParam>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/Mink/MinkParameters.php" />
|
||||
</errorLevel>
|
||||
</MissingTemplateParam>
|
||||
|
||||
<!-- Workaround for https://github.com/vimeo/psalm/issues/7026 -->
|
||||
<ReservedWord>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="src" />
|
||||
</errorLevel>
|
||||
</ReservedWord>
|
||||
|
||||
<UndefinedClass>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="Symfony\Component\BrowserKit\AbstractBrowser" />
|
||||
<referencedClass name="Symfony\Component\BrowserKit\Client" />
|
||||
<referencedClass name="Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator" />
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
|
||||
<UndefinedInterfaceMethod>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/ServiceContainer/SymfonyExtension.php" />
|
||||
</errorLevel>
|
||||
</UndefinedInterfaceMethod>
|
||||
|
||||
<UnusedForeachValue>
|
||||
<errorLevel type="suppress">
|
||||
<file name="src/Bundle/DependencyInjection/FriendsOfBehatSymfonyExtensionExtension.php" />
|
||||
<file name="src/ServiceContainer/SymfonyExtension.php" />
|
||||
</errorLevel>
|
||||
</UnusedForeachValue>
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
|
||||
@@ -22,6 +22,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
final class FriendsOfBehatSymfonyExtensionExtension extends Extension implements CompilerPassInterface
|
||||
{
|
||||
#[\Override]
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
$this->provideMinkIntegration($container);
|
||||
@@ -31,6 +32,7 @@ final class FriendsOfBehatSymfonyExtensionExtension extends Extension implements
|
||||
$container->registerForAutoconfiguration(Context::class)->addTag('fob.context');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$this->provideBrowserKitIntegration($container);
|
||||
|
||||
@@ -51,11 +51,13 @@ final class ContextServiceEnvironmentHandler implements EnvironmentHandler
|
||||
$this->contextInitializers[] = $contextInitializer;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supportsSuite(Suite $suite): bool
|
||||
{
|
||||
return $suite->hasSetting('contexts');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function buildEnvironment(Suite $suite): Environment
|
||||
{
|
||||
$symfonyContexts = [];
|
||||
@@ -65,7 +67,6 @@ final class ContextServiceEnvironmentHandler implements EnvironmentHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var object $service */
|
||||
$service = $this->getContainer()->get($serviceId);
|
||||
|
||||
$symfonyContexts[$serviceId] = get_class($service);
|
||||
@@ -79,6 +80,7 @@ final class ContextServiceEnvironmentHandler implements EnvironmentHandler
|
||||
return new UninitializedSymfonyExtensionEnvironment($suite, $symfonyContexts, $delegatedEnvironment);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supportsEnvironmentAndSubject(Environment $environment, $testSubject = null): bool
|
||||
{
|
||||
return $environment instanceof UninitializedSymfonyExtensionEnvironment;
|
||||
@@ -87,6 +89,7 @@ final class ContextServiceEnvironmentHandler implements EnvironmentHandler
|
||||
/**
|
||||
* @throws EnvironmentIsolationException
|
||||
*/
|
||||
#[\Override]
|
||||
public function isolateEnvironment(Environment $environment, $testSubject = null): Environment
|
||||
{
|
||||
$this->assertEnvironmentCanBeIsolated($environment, $testSubject);
|
||||
@@ -158,7 +161,12 @@ final class ContextServiceEnvironmentHandler implements EnvironmentHandler
|
||||
return new GenericSuite($suite->getName(), array_merge($suite->getSettings(), ['contexts' => $contexts]));
|
||||
}
|
||||
|
||||
private function normalizeContext($context): string
|
||||
/**
|
||||
* @return (int|string)|false
|
||||
*
|
||||
* @psalm-return array-key|false
|
||||
*/
|
||||
private function normalizeContext($context)
|
||||
{
|
||||
if (is_array($context)) {
|
||||
return current(array_keys($context));
|
||||
|
||||
@@ -43,11 +43,13 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn
|
||||
$this->contexts[get_class($context)] = $context;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getSuite(): Suite
|
||||
{
|
||||
return $this->suite;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function bindCallee(Callee $callee): callable
|
||||
{
|
||||
$callable = $callee->getCallable();
|
||||
@@ -59,16 +61,24 @@ final class InitializedSymfonyExtensionEnvironment implements SymfonyExtensionEn
|
||||
return $callable;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function hasContexts(): bool
|
||||
{
|
||||
return count($this->contexts) > 0;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
/**
|
||||
* @return key-of<TArray>[]
|
||||
*
|
||||
* @psalm-return list<key-of<class-string-map<T as Behat\Behat\Context\Context, T:class-string-map as Behat\Behat\Context\Context>>>
|
||||
*/
|
||||
public function getContextClasses(): array
|
||||
{
|
||||
return array_keys($this->contexts);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function hasContextClass($class): bool
|
||||
{
|
||||
return isset($this->contexts[$class]);
|
||||
|
||||
@@ -42,16 +42,19 @@ final class UninitializedSymfonyExtensionEnvironment extends StaticEnvironment i
|
||||
return array_keys($this->contexts);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function hasContexts(): bool
|
||||
{
|
||||
return count($this->contexts) > 0 || $this->delegatedEnvironment->hasContexts();
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getContextClasses(): array
|
||||
{
|
||||
return array_merge(array_values($this->contexts), $this->delegatedEnvironment->getContextClasses());
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function hasContextClass($class): bool
|
||||
{
|
||||
return in_array($class, $this->contexts, true) || $this->delegatedEnvironment->hasContextClass($class);
|
||||
|
||||
@@ -25,20 +25,24 @@ final class SymfonyDriverFactory implements DriverFactory
|
||||
$this->kernel = $kernel;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getDriverName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supportsJavascript(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function configure(ArrayNodeDefinition $builder): void
|
||||
{
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function buildDriver(array $config): Definition
|
||||
{
|
||||
if (!class_exists(BrowserKitDriver::class)) {
|
||||
|
||||
@@ -34,6 +34,7 @@ final class SymfonyDriver extends BrowserKitDriver
|
||||
parent::__construct($this->createBrowser(), $this->baseUrl);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function reset()
|
||||
{
|
||||
parent::reset();
|
||||
@@ -61,7 +62,6 @@ final class SymfonyDriver extends BrowserKitDriver
|
||||
|
||||
private function createBrowser(): AbstractBrowser
|
||||
{
|
||||
/** @var object $testClient */
|
||||
$testClient = $this->kernel->getContainer()->get('test.client');
|
||||
|
||||
if (!$testClient instanceof AbstractBrowser) {
|
||||
|
||||
@@ -28,6 +28,7 @@ final class KernelOrchestrator implements EventSubscriberInterface
|
||||
$this->behatContainer = $behatContainer;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -18,6 +18,7 @@ class Mink extends BaseMink
|
||||
* in an invalid state. Therefore, not stopping all the sessions while destructing Mink
|
||||
* saves our sanity.
|
||||
*/
|
||||
#[\Override]
|
||||
public function __destruct()
|
||||
{
|
||||
// Intentionally left empty
|
||||
|
||||
@@ -17,11 +17,13 @@ class MinkParameters implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
$this->minkParameters = $minkParameters;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getIterator(): \Traversable
|
||||
{
|
||||
return new \ArrayIterator($this->minkParameters);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return array_key_exists($offset, $this->minkParameters);
|
||||
@@ -30,22 +32,26 @@ class MinkParameters implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
#[\Override]
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->minkParameters[$offset] ?? null;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
throw new \BadMethodCallException(sprintf('"%s" is immutable.', self::class));
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
throw new \BadMethodCallException(sprintf('"%s" is immutable.', self::class));
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function count(): int
|
||||
{
|
||||
return count($this->minkParameters);
|
||||
|
||||
@@ -40,16 +40,19 @@ final class SymfonyExtension implements Extension
|
||||
/** @var bool */
|
||||
private $minkExtensionFound = false;
|
||||
|
||||
#[\Override]
|
||||
public function getConfigKey(): string
|
||||
{
|
||||
return 'fob_symfony';
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function initialize(ExtensionManager $extensionManager): void
|
||||
{
|
||||
$this->registerMinkDriver($extensionManager);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function configure(ArrayNodeDefinition $builder): void
|
||||
{
|
||||
$builder
|
||||
@@ -69,6 +72,7 @@ final class SymfonyExtension implements Extension
|
||||
;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function load(ContainerBuilder $container, array $config): void
|
||||
{
|
||||
$this->setupTestEnvironment($config['kernel']['environment'] ?? 'test');
|
||||
@@ -89,6 +93,7 @@ final class SymfonyExtension implements Extension
|
||||
}
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
$this->processEnvironmentHandler($container);
|
||||
|
||||
Reference in New Issue
Block a user