larastan

Discover bugs in your code without running it - phpstan wrapper for Laravel.

Github星跟蹤圖


⚗️ About Larastan

Larastan was created by Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural and Viktor Szépe, and is a phpstan/phpstan wrapper for Laravel. Larastan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.

  • Adds static typing to Laravel to improve developer productivity and code quality
  • Supports most of Laravel's beautiful magic
  • Discovers bugs in your code without running it

✨ Getting Started in 3 Steps

Requires:

1: First, you may use Composer to install Larastan as a development dependency into your Laravel project:

composer require --dev nunomaduro/larastan

Using Larastan for analysing Laravel packages? You may need to install orchestra/testbench.

2: Then, create a phpstan.neon or phpstan.neon.dist file in the root of your application. It might look like this:

includes:
    - ./vendor/nunomaduro/larastan/extension.neon

parameters:

    paths:
        - app

    # The level 8 is the highest level
    level: 5

    ignoreErrors:
        - '#Unsafe usage of new static#'

    excludes_analyse:
        - ./*/*/FileToBeExcluded.php

    checkMissingIterableValueType: false

For all available options, please take a look at the PHPStan documentation: https://github.com/phpstan/phpstan

3: Finally, you may start analyzing your code using the phpstan console command:

./vendor/bin/phpstan analyse

If you are getting the error Allowed memory size exhausted, then you can use the --memory-limit option fix the problem:

./vendor/bin/phpstan analyse --memory-limit=2G

?? Contributing

Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned here.

You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the Twitter account for the latest announcements or just come say hi!: @enunomaduro.

❤️ Support the development

Do you like this project? Support it by donating

? License

Larastan is an open-sourced software licensed under the MIT license.

主要指標

概覽
名稱與所有者larastan/larastan
主編程語言PHP
編程語言PHP (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2018-06-29 20:07:07
推送於2025-04-23 09:40:16
最后一次提交
發布數166
最新版本名稱v3.4.0 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數5.9k
關注者數49
派生數451
提交數1.8k
已啟用問題?
問題數1094
打開的問題數52
拉請求數759
打開的拉請求數25
關閉的拉請求數231
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?