From 67dc6f53b0edb0472bfb5e6c021270a82833d307 Mon Sep 17 00:00:00 2001 From: Michael Flynn Date: Thu, 27 Apr 2023 17:02:08 -0400 Subject: [PATCH 1/2] Github Action Tweaks Adding dev package requirements. Some of the dev tools to help with code improvement do not support PHP 8.0. Change removing unneeded packages for testing in GitHub Actions. --- .github/workflows/tests.yml | 7 ++++++- composer.json | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43b4bd1..0b2181a 100755 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,13 +4,14 @@ on: push: branches: - master + - 9.x pull_request: jobs: tests: runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: true matrix: php: [8.0, 8.1, 8.2] laravel: [^9, ^10] @@ -35,6 +36,10 @@ jobs: - name: Install dependencies run: | + composer remove nunomaduro/larastan --dev --no-update + composer remove orchestra/testbench --dev --no-update + composer remove tightenco/duster --dev --no-update + composer remove laravel/pint --dev --no-update composer require "illuminate/contracts=${{ matrix.laravel }}" --no-update composer require "illuminate/database=${{ matrix.laravel }}" --no-update composer require "illuminate/support=${{ matrix.laravel }}" --no-update diff --git a/composer.json b/composer.json index b915f29..2faf06b 100755 --- a/composer.json +++ b/composer.json @@ -35,8 +35,12 @@ "laravel/scout": "^9|^10" }, "require-dev": { + "laravel/pint": "^1.10", + "mockery/mockery": "^1.5", + "nunomaduro/larastan": "^2.6", + "orchestra/testbench": "^8.5", "phpunit/phpunit": "^9.6", - "mockery/mockery": "^1.5" + "tightenco/duster": "^2.0" }, "autoload": { "psr-4": { From 8e5dd7e4e23f7e8f271be8d144ed120d9b527ce3 Mon Sep 17 00:00:00 2001 From: Michael Flynn Date: Fri, 28 Apr 2023 11:22:17 -0400 Subject: [PATCH 2/2] Larastan Level 9 III Finally got enough Larastan under my belt to see how to get rid of the error. Fixed #3 --- composer.json | 2 +- phpstan-baseline.neon | 5 +---- src/PostgresEngineServiceProvider.php | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 2faf06b..9f434f1 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "authors": [ { "name": "Michael Flynn", - "email": "flynnmj@devnoise.com.com", + "email": "flynnmj@devnoise.com", "homepage": "https://github.com/devNoiseConsulting" }, { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index d9d146d..0ec50ee 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -14,7 +14,4 @@ parameters: message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:toSearchableArray\\(\\)\\.$#" count: 1 path: src/PostgresEngine.php - - - message: "#^Access to an undefined property ScoutEngines\\\\Postgres\\\\PostgresEngineServiceProvider\\:\\:\\$callback\\.$#" - count: 1 - path: src/PostgresEngineServiceProvider.php + diff --git a/src/PostgresEngineServiceProvider.php b/src/PostgresEngineServiceProvider.php index 16a7e3b..b62390e 100644 --- a/src/PostgresEngineServiceProvider.php +++ b/src/PostgresEngineServiceProvider.php @@ -50,6 +50,7 @@ protected function registerBuilderMacro(string $name, string $class): void { if (! Builder::hasMacro($name)) { Builder::macro($name, function () use ($class) { + /** @var Builder $this */ $this->callback = function ($builder, $config) use ($class) { return new $class($builder->query, $config); };