Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Static Analysis & Testing for Laravel. Powered by PHPStan, Psalm and Pest.

Notifications You must be signed in to change notification settings

ArkEcosystemArchive/laravel-stan

Folders and files

NameName
Last commit message
Last commit date
Jul 23, 2021
Sep 23, 2021
Sep 23, 2021
Sep 23, 2021
Oct 21, 2020
Feb 4, 2021
Oct 21, 2020
Sep 23, 2021
Sep 23, 2021
Jul 21, 2021
Oct 21, 2020
Oct 21, 2020

Repository files navigation

Laravel Stan

Static Analysis & Testing for Laravel. Powered by PHPStan and Pest.

Installation

  1. Require with composer: composer require arkecosystem/stan --dev
  2. Publish all configurations with php artisan vendor:publish --provider="ARKEcosystem\Stan\StanServiceProvider" --tag=config.
  3. Publish all workflows with php artisan vendor:publish --provider="ARKEcosystem\Stan\StanServiceProvider" --tag=workflows.
  4. 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'];
    }
}