From 2a2de029784873e01c6683a9d94e68617888f122 Mon Sep 17 00:00:00 2001 From: fab2s Date: Fri, 31 Jul 2026 21:34:06 +0200 Subject: [PATCH 1/2] v1.1: bump php to 8.5 --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/qa.yml | 4 ++-- .gitignore | 1 + CHANGELOG.md | 8 ++++++++ README.md | 2 +- composer.json | 6 +++--- src/SearchQuery.php | 8 ++++---- tests/ListenerTest.php | 12 ++++++------ 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a184c..7edd115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '8.1', '8.2', '8.3', '8.4' ] - orchestra-versions: [ '8.0', '9.0', '10.0' ] + php-versions: [ '8.5', '8.4', '8.3', '8.2' ] + orchestra-versions: [ '11.0', '10.0', '9.0' ] exclude: - - php-versions: 8.1 + # Laravel 13 (Testbench 11) requires PHP >= 8.3 + - php-versions: 8.2 + orchestra-versions: 11.0 + # Laravel 11 (Testbench 9) does not support PHP 8.5 + - php-versions: 8.5 orchestra-versions: 9.0 - - php-versions: 8.1 - orchestra-versions: 10.0 - - php-versions: 8.4 - orchestra-versions: 8.0 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index ade5fcc..69ceff1 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -17,7 +17,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.4 + php-version: 8.5 extensions: mbstring, dom, fileinfo, gmp, bcmath coverage: xdebug @@ -51,6 +51,6 @@ jobs: run: vendor/bin/phpunit --colors --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 8de3fa0..72f8ff0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ composer.lock .env /cov +/.* diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d24e74..eae0930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.1.0] - 2026-07-31 + +### Changed + +- Requires PHP 8.2+ (PHP 8.1 is EOL, pin `1.0.*` to stay on it) +- Tested against PHP 8.5, CI matrix is now PHP 8.2 to 8.5 against Orchestra 9, 10 and 11 +- `phpunit/phpunit` `^11.0|^12.0|^13.0`, `orchestra/testbench` `^9.0|^10.0|^11.0` + ## [1.0.0] - 2026-02-21 ### Added diff --git a/README.md b/README.md index 2fb1a9c..ed6ba3a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Searchable is not a replacement for a dedicated search engine — it's a lightwe ## Requirements -- PHP 8.1+ +- PHP 8.2+ - Laravel 10.x / 11.x / 12.x - MySQL / MariaDB or PostgreSQL - `ext-intl` PHP extension diff --git a/composer.json b/composer.json index 4e0ece4..9f63c86 100644 --- a/composer.json +++ b/composer.json @@ -27,13 +27,13 @@ ], "require": { "ext-intl": "*", - "php": "^8.1", + "php": "^8.2", "fab2s/strings": "^1.0" }, "require-dev": { "ext-pdo": "*", - "phpunit/phpunit": "^10.0|^11.0", - "orchestra/testbench": "^8.0|^9.0|^10.0", + "phpunit/phpunit": "^11.0|^12.0|^13.0", + "orchestra/testbench": "^9.0|^10.0|^11.0", "laravel/pint": "^1.27", "phpstan/phpstan": "^2.1" }, diff --git a/src/SearchQuery.php b/src/SearchQuery.php index 3a0ff69..cfaa102 100644 --- a/src/SearchQuery.php +++ b/src/SearchQuery.php @@ -52,19 +52,19 @@ public function addMatch(Builder $query, string|array $search, string $tableAlia $order = $order ? $this->getOrder($order) : $this->order; if ($driver === 'pgsql') { - $query->whereRaw("to_tsvector('{$this->tsConfig}', {$searchField}) @@ to_tsquery('{$this->tsConfig}', ?)", [$terms]); + $query->whereRaw("to_tsvector('{$this->tsConfig}', {$searchField}) @@ to_tsquery('{$this->tsConfig}', ?)", [$terms]); // @phpstan-ignore argument.type if ($order) { - $query->orderByRaw("ts_rank(to_tsvector('{$this->tsConfig}', {$searchField}), to_tsquery('{$this->tsConfig}', ?)) {$order}", [$terms]); + $query->orderByRaw("ts_rank(to_tsvector('{$this->tsConfig}', {$searchField}), to_tsquery('{$this->tsConfig}', ?)) {$order}", [$terms]); // @phpstan-ignore argument.type } return; } - $query->whereRaw('MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)', [$terms]); + $query->whereRaw('MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)', [$terms]); // @phpstan-ignore argument.type if ($order) { - $query->orderByRaw('(MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)) ' . $order, [$terms]); + $query->orderByRaw('(MATCH (' . $searchField . ') AGAINST (? IN BOOLEAN MODE)) ' . $order, [$terms]); // @phpstan-ignore argument.type } } diff --git a/tests/ListenerTest.php b/tests/ListenerTest.php index 70a47af..a7128ef 100644 --- a/tests/ListenerTest.php +++ b/tests/ListenerTest.php @@ -34,8 +34,8 @@ private static function supportsOptions(): bool public function test_runs_enable_after_up_migration(): void { $mock = Mockery::mock(); - $mock->shouldReceive('call') // @phpstan-ignore method.notFound - ->once() + $mock->shouldReceive('call') + ->once() // @phpstan-ignore method.notFound ->with('searchable:enable', [], Mockery::type(ConsoleOutput::class)) ; Artisan::swap($mock); @@ -72,8 +72,8 @@ public function test_runs_when_pretend_is_false(): void } $mock = Mockery::mock(); - $mock->shouldReceive('call') // @phpstan-ignore method.notFound - ->once() + $mock->shouldReceive('call') + ->once() // @phpstan-ignore method.notFound ->with('searchable:enable', [], Mockery::type(ConsoleOutput::class)) ; Artisan::swap($mock); @@ -88,8 +88,8 @@ public function test_runs_when_options_missing_pretend(): void } $mock = Mockery::mock(); - $mock->shouldReceive('call') // @phpstan-ignore method.notFound - ->once() + $mock->shouldReceive('call') + ->once() // @phpstan-ignore method.notFound ->with('searchable:enable', [], Mockery::type(ConsoleOutput::class)) ; Artisan::swap($mock); From f2b66feda1dc86f4cc5b571cb985f617e5126fd1 Mon Sep 17 00:00:00 2001 From: fab2s Date: Fri, 31 Jul 2026 21:35:44 +0200 Subject: [PATCH 2/2] pint pass --- tests/DefaultSizeModel.php | 3 ++- tests/NoTimestampModel.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/DefaultSizeModel.php b/tests/DefaultSizeModel.php index dbefd9e..98101f8 100644 --- a/tests/DefaultSizeModel.php +++ b/tests/DefaultSizeModel.php @@ -13,8 +13,9 @@ use fab2s\Searchable\SearchableInterface; use fab2s\Searchable\Traits\Searchable; +use Illuminate\Database\Eloquent\Model; -class DefaultSizeModel extends \Illuminate\Database\Eloquent\Model implements SearchableInterface +class DefaultSizeModel extends Model implements SearchableInterface { use Searchable; protected $table = 'models'; diff --git a/tests/NoTimestampModel.php b/tests/NoTimestampModel.php index de3a734..08da850 100644 --- a/tests/NoTimestampModel.php +++ b/tests/NoTimestampModel.php @@ -13,8 +13,9 @@ use fab2s\Searchable\SearchableInterface; use fab2s\Searchable\Traits\Searchable; +use Illuminate\Database\Eloquent\Model; -class NoTimestampModel extends \Illuminate\Database\Eloquent\Model implements SearchableInterface +class NoTimestampModel extends Model implements SearchableInterface { use Searchable; protected $table = 'no_timestamp_models';