Skip to content

Commit

Permalink
Add PHP 8 compatibility (#33)
Browse files Browse the repository at this point in the history
* Upgrade atoum/atoum

* Upgrade elasticsearch/elasticsearch and add ConnectionInterface return type
  • Loading branch information
fxbt committed Nov 2, 2021
1 parent 7ccebae commit 81dbf1c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"require": {
"php": ">=7.0",
"ext-json": "*",
"elasticsearch/elasticsearch": "^5.1.0||^6.0.0"
"elasticsearch/elasticsearch": "^5.1.0||^6.0.0||^7.0"
},
"require-dev": {
"atoum/atoum": "^2.8||^3.0",
"atoum/atoum": "^4.0",
"m6web/coke": "~1.2.0",
"m6web/symfony2-coding-standard": "~1.2.0",
"symfony/dependency-injection": "^4.4||^5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RandomStickySelector implements SelectorInterface
*
* @return ConnectionInterface
*/
public function select($connections)
public function select($connections): ConnectionInterface
{
if (empty($connections)) {
throw new NoNodesAvailableException('No node to select from…');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
use Elasticsearch\ConnectionPool\StaticNoPingConnectionPool;
use Elasticsearch\Connections\Connection;
use Elasticsearch\Connections\ConnectionInterface;

/**
* Class StaticAliveNoPingConnectionPool
Expand Down Expand Up @@ -52,7 +53,7 @@ public function setMaxPingTimeout($maxPingTimeout)
* @return Connection
* @throws \Elasticsearch\Common\Exceptions\NoNodesAvailableException
*/
public function nextConnection($force = false)
public function nextConnection($force = false): ConnectionInterface
{
// > Replace $this->connections by $connections in order to modify the list later.
$connections = $this->connections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace M6Web\Bundle\ElasticsearchBundle\Tests\Units\DependencyInjection;

use M6Web\Bundle\ElasticsearchBundle\DependencyInjection\M6WebElasticsearchExtension as TestedClass;
use mageekguy\atoum\test;
use atoum\atoum\test;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
use Elasticsearch\Connections\Connection;
use M6Web\Bundle\ElasticsearchBundle\Tests\Units\Elasticsearch\ConnectionMocker;
use mageekguy\atoum\test;
use atoum\atoum\test;

/**
* Class RandomStickySelector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Elasticsearch\Connections\Connection;
use Elasticsearch\Connections\ConnectionFactoryInterface;
use M6Web\Bundle\ElasticsearchBundle\Tests\Units\Elasticsearch\ConnectionMocker;
use mageekguy\atoum\test;
use atoum\atoum\test;

/**
* Class StaticAliveNoPingConnectionPool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use GuzzleHttp\Ring\Future\FutureArray;
use M6Web\Bundle\ElasticsearchBundle\EventDispatcher\ElasticsearchEvent;
use M6Web\Bundle\ElasticsearchBundle\Handler\EventHandler as TestedClass;
use mageekguy\atoum;
use atoum\atoum;
use React\Promise\RejectedPromise;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace M6Web\Bundle\ElasticsearchBundle\Tests\Units\Handler;

use M6Web\Bundle\ElasticsearchBundle\Handler\HeadersHandler as TestedClass;
use mageekguy\atoum;
use atoum\atoum;

/**
* HeadersHandler
Expand Down

0 comments on commit 81dbf1c

Please sign in to comment.