phpstan

thinkphp 6.0 phpstan配置

牧云@^-^@ 提交于 2020-08-14 17:01:05
首先是composer { "require-dev": { "symfony/var-dumper": "^4.2", "topthink/think-trace": "^1.0", "phpstan/phpstan": "^0.12.33" }, "autoload": { "psr-4": { "app\\": "app" }, "psr-0": { "": "extend/" }, "files": [ "app/common.php", "vendor/topthink/framework/src/helper.php" ] }, "scripts": { "start": "php think run", "analyze": "vendor\\bin\\phpstan analyse --memory-limit 300M -l 0 -c phpstan.neon ./app ./extend", "post-autoload-dump": [ "@php think service:discover", "@php think vendor:publish" ] } } 在require-dev增加了phpstan/phpstan,在autoload下增加了files,在scripts增加了analyze phpstan.neon # Magic behaviour

thinkphp5.1 phpstan配置

限于喜欢 提交于 2020-08-12 08:35:00
参考这篇 https://my.oschina.net/u/2266306/blog/4428395 然后改 ./phpstan.neon # Magic behaviour with __get, __set, __call and __callStatic is not exactly static analyser-friendly :) # Fortunately, You can ingore it by the following config. # # vendor/bin/phpstan analyse application --memory-limit 200M -l 0 # parameters: ignoreErrors: - '#Static call to instance method think\\[a-zA-Z0-9\]::[a-zA-Z0-9\\_]+\(\)#' - '#Result of.+method|function.+\(void\) is used#' scanDirectories: - thinkphp bootstrapFiles: - thinkphp/base.php 来源: oschina 链接: https://my.oschina.net/u/2266306/blog/4365580