Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint by phpmd #22

Closed
shaunthegeek opened this issue Nov 16, 2021 · 1 comment · Fixed by #30
Closed

lint by phpmd #22

shaunthegeek opened this issue Nov 16, 2021 · 1 comment · Fixed by #30

Comments

@shaunthegeek
Copy link
Member

刚测试 #21 ,执行

php artisan lint:code database/

发现没效果,看代码发现只执行了 phpcs,而没执行 phpmd:

$bin = $this->option('fix') ? 'phpcbf' : 'phpcs';

@shaunthegeek
Copy link
Member Author

error: Cannot add a required argument "format" after an array argument "files".

    protected $signature = 'lint:pmd
        {files?*}
        {format=text}
        {ruleset=phpmd.xml}';

麻烦了,laravel 不允许在数组参数后面使用必填参数(这样做的确很奇怪),但 phpmd 的确支持,有点离谱……

phpmd 是这样的:

./vendor/bin/phpmd foo.php bar.php text phpmd.xml

@shaunthegeek shaunthegeek changed the title lint:code 未执行 phpmd lint by phpmd Nov 17, 2024
shaunthegeek added a commit that referenced this issue Nov 17, 2024
@shaunthegeek shaunthegeek linked a pull request Nov 17, 2024 that will close this issue
shaunthegeek added a commit that referenced this issue Nov 17, 2024
shaunthegeek added a commit that referenced this issue Nov 17, 2024
shaunthegeek added a commit that referenced this issue Nov 17, 2024
shaunthegeek added a commit that referenced this issue Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant