diff --git a/.github/workflows/tests-laravel-9.yml b/.github/workflows/tests-laravel-9.yml index 4a0c4f4..86c456a 100644 --- a/.github/workflows/tests-laravel-9.yml +++ b/.github/workflows/tests-laravel-9.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.0, 8.1] + php: [8.0, 8.1, 8.2] name: PHP ${{ matrix.php }} diff --git a/composer.json b/composer.json index 1f96044..ce11e64 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "library", "license": "MIT", "require": { - "php": "^8.0|^8.1", + "php": "^8.0|^8.1|^8.2", "illuminate/console": "^7.0|^8.0|^9.0", "illuminate/contracts": "^7.0|^8.0|^9.0", "illuminate/support": "^7.0|^8.0|^9.0", diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index a105e4a..e828b95 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -51,8 +51,10 @@ final class ServiceProvider extends \Illuminate\Support\ServiceProvider /** {@inheritDoc} */ public function register(): void { - /** @psalm-suppress DeprecatedMethod */ - AnnotationRegistry::registerLoader('class_exists'); + if (method_exists(AnnotationRegistry::class, 'registerLoader')) { + /** @psalm-suppress DeprecatedMethod */ + AnnotationRegistry::registerLoader('class_exists'); + } $configPath = __DIR__ . '/../config/cycle.php'; $this->mergeConfigFrom($configPath, 'cycle'); diff --git a/tests/src/Command/Schema/RenderCommandTest.php b/tests/src/Command/Schema/RenderCommandTest.php index 62ae89f..27db1e2 100644 --- a/tests/src/Command/Schema/RenderCommandTest.php +++ b/tests/src/Command/Schema/RenderCommandTest.php @@ -20,7 +20,7 @@ public function testRender(): void $console = $this->app->get(Kernel::class); $exitCode = $console->call('cycle:schema:render', ['-nc' => true]); $realOutput = $console->output(); - $expectedOutput = [ + $articlesOutput = [ '[customer] :: default.customers', 'Entity:', Customer::class, 'Mapper:', Mapper::class, @@ -28,7 +28,9 @@ public function testRender(): void 'Primary key:', 'id', 'Fields', '(property -> db.field -> typecast)', 'id -> id -> int', 'name -> name', 'Relations:', 'not defined', + ]; + $customersOutput = [ '[article] :: default.articles', 'Entity:', Article::class, 'Mapper:', Mapper::class, @@ -43,6 +45,7 @@ public function testRender(): void : new \Illuminate\Foundation\Testing\Constraints\SeeInOrder($realOutput); $this->assertSame(Command::SUCCESS, $exitCode); - $this->assertThat($expectedOutput, $constraint); + $this->assertThat($articlesOutput, $constraint); + $this->assertThat($customersOutput, $constraint); } }