跳转到正文
Backend

PHP PHPStan 的使用

崔哥1 分钟2,922
文章目录

安装

composer require --dev phpstan/phpstan

修改composer.json


    "scripts": {
        ...
        "stan": [
            " php -d memory_limit=-1 vendor/bin/phpstan analyse app routes database config tests"
        ]
    },

在项目根目录添加phpstan.neon配置文件

root@php-fpm:/var/www/laravel-demo# vi phpstan.neon

内容可参考 https://phpstan.org/user-guide/getting-started

使用

root@php-fpm:/var/www/laravel-demo# composer stan