diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9832cf9..44dea79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/README.md b/README.md index 970e4bb..fed3acf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json index a104212..a67705a 100644 --- a/composer.json +++ b/composer.json @@ -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" }, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9198b58..a1c637a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,4 @@ parameters: level: max - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false paths: - src diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1aa1dea..efe3f50 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,24 @@ - + colors="true" + cacheDirectory=".phpunit.cache" + requireCoverageMetadata="true" + beStrictAboutCoverageMetadata="true"> + + + tests/Unit + + + src src/ServiceProvider.php - - - - tests/Unit - - + diff --git a/src/ClientBuilder.php b/src/ClientBuilder.php index 3868a43..ea78668 100644 --- a/src/ClientBuilder.php +++ b/src/ClientBuilder.php @@ -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 + */ protected array $cache; public function default(): ClientInterface diff --git a/tests/Unit/ClientBuilderTest.php b/tests/Unit/ClientBuilderTest.php index c2c6e14..97ca504 100644 --- a/tests/Unit/ClientBuilderTest.php +++ b/tests/Unit/ClientBuilderTest.php @@ -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;