3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PHPInsightsをLaravel5.5でも起動する

Last updated at Posted at 2020-12-23

こんにちは。M2です。
Laravel Advent Calendar 2020の12日目を代打で担当させていただきます。

概要

PHP Insights公式によると
PHP7.2以上あれば入れられるとのことだが、

symfony/consoleの依存関係でどうしても入れられない時があります。

そういう時に Support lower Laravel version then 5.7を見つけたので、共有がてらに。

対処法

  • phpinsight.shをLaravelのルートディレクトリに設置
phpinsight.sh
#!/bin/sh
composer global require nunomaduro/phpinsights
cp ~/.composer/vendor/nunomaduro/phpinsights/stubs/laravel.php phpinsights.php
php -d memory_limit=-1 ~/.composer/vendor/bin/phpinsights --config-path=phpinsights.php

あとは

$ bash phpinsight.sh

を実行するだけ。

実行結果の例

Image from Gyazo

参考

Support lower Laravel version then 5.7

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?