arkecosystem / stan
Static Analysis & Testing for Laravel. Powered by PHPStan and Pest.
Installs: 75 492
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 1
Open Issues: 0
Requires
- ergebnis/phpstan-rules: ^0.15.3
- fakerphp/faker: ^1.15
- friendsofphp/php-cs-fixer: ^v3.1.0
- graham-campbell/analyzer: ^3.0
- jasonmccreary/laravel-test-assertions: ^1.1
- johnkary/phpunit-speedtrap: ^4.0
- mockery/mockery: ^1.4
- nunomaduro/collision: ^5.5
- nunomaduro/larastan: ^0.7.11
- nunomaduro/laravel-mojito: ^0.2.8
- orchestra/testbench: ^6.19
- pestphp/pest: ^1.11
- pestphp/pest-plugin-faker: ^1.0
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^0.12.6
- phpstan/phpstan-strict-rules: ^0.12.10
- phpunit/phpunit: ^9.5
- rector/rector: ^0.11.38
- spatie/pest-plugin-snapshots: ^1.1
README
Static Analysis & Testing for Laravel. Powered by PHPStan and Pest.
Installation
- Require with composer:
composer require arkecosystem/stan --dev
- Publish all configurations with
php artisan vendor:publish --provider="ARKEcosystem\Stan\StanServiceProvider" --tag=config
. - Publish all workflows with
php artisan vendor:publish --provider="ARKEcosystem\Stan\StanServiceProvider" --tag=workflows
. - Start tweaking the configurations as needed for your project.
File Analysis
When working on larger projects it can happen that you move files on a regular basis and forget to update a reference. We use graham-campbell/analyzer to avoid this. Create the file tests/Analysis/AnalysisTest.php
and the test suite will fail if any references don't match a file.
<?php declare(strict_types=1); namespace Tests\Analysis; use GrahamCampbell\Analyzer\AnalysisTrait; use PHPUnit\Framework\TestCase; final class AnalysisTest extends TestCase { use AnalysisTrait; public function getPaths(): array { return [ __DIR__.'/../../app', ]; } public function getIgnored(): array { return ['Laravel\Scout\Builder']; } }