Skip to content

Commit

Permalink
Add Laravel 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
babenkoivan committed May 20, 2024
1 parent e4228a7 commit e48c03f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 34 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0, 8.1]
php: [8.2]
include:
- php: 7.4
testbench: 6.0
phpunit: 9.5

- php: 8.0
testbench: 7.0
phpunit: 9.5

- php: 8.1
testbench: 8.0
phpunit: 9.5
- php: 8.2
testbench: 9.0
phpunit: 11.0
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ The official PHP Elasticsearch client integrated with Laravel.

The current version of Elastic Client has been tested with the following configuration:

* PHP 7.4-8.x
* PHP 8.2
* Elasticsearch 8.x
* Laravel 6.x-10.x
* Laravel 11.x

If your project uses older Laravel (or PHP) version check [the previous major version](https://github.com/babenkoivan/elastic-client/tree/v2.1.0#compatibility) of the package.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"elasticsearch/elasticsearch": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^11.0",
"orchestra/testbench": "^9.0",
"friendsofphp/php-cs-fixer": "^3.14",
"phpstan/phpstan": "^1.10"
},
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
parameters:
level: max
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- src
25 changes: 12 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd"
bootstrap="vendor/autoload.php"
executionOrder="depends,defects"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true"
colors="true">
<coverage processUncoveredFiles="true">
colors="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true">
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<file>src/ServiceProvider.php</file>
</exclude>
</coverage>
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">tests/Unit</directory>
</testsuite>
</testsuites>
</source>
</phpunit>
4 changes: 4 additions & 0 deletions src/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

namespace Elastic\Client;

use Elastic\Elasticsearch\Client;
use Elastic\Elasticsearch\ClientBuilder as BaseClientBuilder;
use Elastic\Elasticsearch\ClientInterface;
use ErrorException;

class ClientBuilder implements ClientBuilderInterface
{
/**
* @var array<string, Client>
*/
protected array $cache;

public function default(): ClientInterface
Expand Down
5 changes: 2 additions & 3 deletions tests/Unit/ClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
use Elastic\Elasticsearch\ClientInterface;
use ErrorException;
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;

/**
* @covers \Elastic\Client\ClientBuilder
*/
#[CoversClass(ClientBuilder::class)]
final class ClientBuilderTest extends TestCase
{
private ClientBuilder $clientBuilder;
Expand Down

0 comments on commit e48c03f

Please sign in to comment.