From 7c19648e9a30336f8c58579a5e9f82b68476f558 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Mon, 3 Feb 2025 09:38:51 +0100 Subject: [PATCH] Fix coding style issues --- composer.json | 1 + src/Exceptions/UnknownApplicationConfiguration.php | 4 +++- src/Providers/ApplicationProvider.php | 3 +-- src/Providers/ModelStubProvider.php | 1 + tests/README.md | 6 +++--- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 7a9fdb70..5f15ed5f 100644 --- a/composer.json +++ b/composer.json @@ -76,6 +76,7 @@ "@test:unit", "@test:type" ], + "test:app": "./tests/Application/laravel-test.sh", "test:type": "phpunit --testsuite=type", "test:unit": "phpunit --testsuite=unit" } diff --git a/src/Exceptions/UnknownApplicationConfiguration.php b/src/Exceptions/UnknownApplicationConfiguration.php index 3cf10856..6f0cf899 100644 --- a/src/Exceptions/UnknownApplicationConfiguration.php +++ b/src/Exceptions/UnknownApplicationConfiguration.php @@ -1,4 +1,6 @@ -createApplication(); // Orchestra\Testbench + $app = (new self())->createApplication(); // Orchestra\Testbench (e.g., test:type command) } if (! $app instanceof LaravelApplication) { diff --git a/src/Providers/ModelStubProvider.php b/src/Providers/ModelStubProvider.php index ee1517b0..c0ecebf7 100644 --- a/src/Providers/ModelStubProvider.php +++ b/src/Providers/ModelStubProvider.php @@ -13,6 +13,7 @@ use function glob; use function method_exists; use function unlink; +use function is_array; final class ModelStubProvider implements GeneratesStubs { diff --git a/tests/README.md b/tests/README.md index 219055f9..6c9f85c7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,6 @@ # Tests There are 3 types of tests: -1. Type (main one): Use phpt files to run Psalm over code snippets in the context of fake Laravel app [using orchestra/testbench] -2. Application: create an [almost] empty Laravel app and run Psalm over its codebase. -3. Unit: use PHPUnit to test some internal logic without running Psalm. +1. **Type** (the main one): uses .phpt files to run Psalm over code snippets in the context of a fake Laravel app [using orchestra/testbench] +2. **Application**: creates an empty Laravel app, adds some typical classes of different types and run Psalm over its codebase. +3. **Unit**: uses PHPUnit to test some internal logic without running Psalm.