Skip to content

Commit

Permalink
- fix composer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hbagherzadegan committed Jul 25, 2023
1 parent 9720a09 commit 9b60679
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use FriendsOfBehat\SymfonyExtension\Mink\MinkParameters;
use FriendsOfBehat\SymfonyExtension\ServiceContainer\SymfonyExtension;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Component\BrowserKit\Client;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -78,8 +79,8 @@ private function provideBrowserKitIntegration(ContainerBuilder $container): void
return;
}

if (class_exists(\Symfony\Component\BrowserKit\AbstractBrowser::class)) {
$container->setAlias(\Symfony\Component\BrowserKit\AbstractBrowser::class, 'test.client');
if (class_exists(Client::class)) {
$container->setAlias(Client::class, 'test.client');
}

$container->setAlias(KernelBrowser::class, 'test.client');
Expand Down
17 changes: 8 additions & 9 deletions src/Mink/MinkParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@

namespace FriendsOfBehat\SymfonyExtension\Mink;

use ArrayAccess;
use IteratorAggregate;
use ReturnTypeWillChange;

/**
* @template-implements ArrayAccess<int,int>
* @template-implements IteratorAggregate<string, int>
*/
final class MinkParameters implements \Countable, IteratorAggregate, ArrayAccess
/** @final */
class MinkParameters implements \Countable, \IteratorAggregate, \ArrayAccess
{
private array $minkParameters;
/** @var array */
private $minkParameters;

public function __construct(array $minkParameters)
{
Expand All @@ -31,8 +27,11 @@ public function offsetExists($offset): bool
return array_key_exists($offset, $this->minkParameters);
}

/**
* @return mixed
*/
#[ReturnTypeWillChange]
public function offsetGet($offset): mixed
public function offsetGet($offset)
{
return $this->minkParameters[$offset] ?? null;
}
Expand Down
12 changes: 4 additions & 8 deletions src/ServiceContainer/SymfonyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ final class SymfonyExtension implements Extension
*/
public const DRIVER_KERNEL_ID = 'fob_symfony.driver_kernel';

private bool $minkExtensionFound = false;
/** @var bool */
private $minkExtensionFound = false;

public function getConfigKey(): string
{
Expand All @@ -48,18 +49,13 @@ public function initialize(ExtensionManager $extensionManager): void
{
$this->registerMinkDriver($extensionManager);
}
/**
* @psalm-suppress UndefinedInterfaceMethod
*/

public function configure(ArrayNodeDefinition $builder): void
{

$builder
->addDefaultsIfNotSet()
->children()
->scalarNode('bootstrap')
->defaultNull()
->end()
->scalarNode('bootstrap')->defaultNull()->end()
->arrayNode('kernel')
->addDefaultsIfNotSet()
->children()
Expand Down

0 comments on commit 9b60679

Please sign in to comment.