diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39b1580..04be47d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,17 +3,16 @@ version: 2 updates: - - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "monthly" labels: - "dependencies" - package-ecosystem: "composer" directory: "/" schedule: - interval: "weekly" + interval: "monthly" labels: - "dependencies" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 70d8e7b..056063f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -14,7 +14,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index cd4239c..56d54d3 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.3.1 + uses: aglipanci/laravel-pint-action@2.4 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index af21e45..8ec322f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -5,7 +5,6 @@ on: paths: - '**.php' - 'phpstan.neon.dist' - - '.github/workflows/phpstan.yml' jobs: phpstan: @@ -22,7 +21,7 @@ jobs: coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHPStan run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f7492c5..d578a3d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,14 +16,14 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest] - php: [8.3, 8.2, 8.1] - laravel: [10.*] - stability: [prefer-lowest, prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - carbon: ^2.63 + os: [ ubuntu-latest, macos-latest ] + stability: [ prefer-stable ] + php: [ 8.1, 8.2, 8.3 ] + laravel: [ 10.*, 11.* ] + carbon: [ '^2.67' ] + exclude: + - php: 8.1 + laravel: 11.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -45,7 +45,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.laravel == '11.*' && '9.*' || '8.*' }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 39de30d..5f593b5 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -2,7 +2,7 @@ name: "Update Changelog" on: release: - types: [released] + types: [ released ] permissions: contents: write diff --git a/.gitignore b/.gitignore index 6ac545f..08fa528 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ composer.lock coverage docs phpunit.xml -phpstan.neon testbench.yaml vendor node_modules diff --git a/composer.json b/composer.json index 98a70b8..a270705 100644 --- a/composer.json +++ b/composer.json @@ -17,21 +17,20 @@ ], "require": { "php": "^8.1", - "spatie/laravel-package-tools": "^1.14.0", - "illuminate/contracts": "^10.0" + "spatie/laravel-package-tools": "^1.14.0" }, "require-dev": { - "roave/security-advisories": "dev-latest", - "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.8", "larastan/larastan": "^2.0.1", - "orchestra/testbench": "^8.8", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.0|^8.0", + "orchestra/testbench": "^8.0|^9.0", "pestphp/pest": "^2.20", "pestphp/pest-plugin-arch": "^2.0", "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", + "roave/security-advisories": "dev-latest", "spatie/laravel-ray": "^1.26" }, "autoload": { diff --git a/config/maker.php b/config/maker.php index 0c59eae..1551844 100644 --- a/config/maker.php +++ b/config/maker.php @@ -4,10 +4,11 @@ return [ 'action' => [ 'namespace' => 'App\Actions', - 'stub' => __DIR__.'/../stubs/action.stub', + 'stub' => __DIR__.'/../src/Stubs/action.stub', ], 'service' => [ 'namespace' => 'App\Services', - 'stub' => __DIR__.'/../stubs/service.stub', + 'stub' => __DIR__.'/../src/Stubs/service.stub', + // 'stub' => __DIR__.'/../Stubs/service.stub', ], ]; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index e69de29..0000000 diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..ef64d30 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 5 + paths: + - src + - config + tmpDir: build/phpstan + checkOctaneCompatibility: true + checkModelProperties: true + checkMissingIterableValueType: false diff --git a/tests/MakeTest.php b/tests/MakeTest.php index 05d42fe..a06b896 100644 --- a/tests/MakeTest.php +++ b/tests/MakeTest.php @@ -1,28 +1,13 @@ 'SampleAction'])->assertExitCode(0); + expect(file_exists(app_path('Actions/SampleAction.php')))->toBeTrue(); +}); -class MakeTest extends Orchestra -{ - protected function getPackageProviders($app): array - { - return [ - MakerServiceProvider::class, - ]; - } - - public function test_artisan_make_action_command(): void - { - $this->artisan('make:action SampleAction')->assertSuccessful(); - $this->assertFileExists(app_path('Actions/SampleAction.php')); - } - - public function test_artisan_make_service_command(): void - { - $this->artisan('make:service SampleService')->assertSuccessful(); - $this->assertFileExists(app_path('Services/SampleService.php')); - } -} +it('executed artisan make:service command', function () { + artisan('make:service', ['name' => 'SampleService'])->assertExitCode(0); + expect(file_exists(app_path('Services/SampleService.php')))->toBeTrue(); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..9500729 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,5 @@ +in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..fb98ffd --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,16 @@ +