LoginSignup
0
0

More than 1 year has passed since last update.

laravel php-cs-fixerで自動整形を実行したらエラーが出た

Posted at

概要

  • php-cs-fixerで構文チェックを実行したらエラーが出たので解決方法をまとめる。

エラーまでの経緯

  1. 下記の方法を参考に旧ローカル開発環境にてlaravelのアプリケーションにphp-cs-fixerを導入した。

  2. 新環境にてコードのクローンとcomposer install(メインとtools/php-cs-fixer直下を指定して実施)

  3. 下記コマンドを実行して自動整形を行おうとした。

    ./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix
    

エラー内容

  • オリジナル
You must call one of in() or append() methods before iterating over a Finder.
  • 和訳

Finder を反復処理する前に、in() または append() メソッドのいずれかを呼び出す必要があります。

原因

  • 本来laravelのアプリケーション構成ファイルにあるはずのphp-cs-fixerの設定ファイル.php-cs-fixer.dist.phpが新環境になかった。(旧ローカル開発環境でgitignoreで何故か.php-cs-fixer.dist.phpを設定していた。)

参考文献

0
0
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
0
0