LoginSignup
12
13

More than 5 years have passed since last update.

PhpStormでSilexのコード補完

Posted at

silex-idea-pluginを入れると、silexの$app['orm.em']とか、配列のキーでもコード補完が効くようになります。

環境

PhpStorm ver 9.0 を使ってます。

silex-idea-pluginのインストール

Settings>Plugins>「Browse repositories」で、「silex plugin」で検索するとでてきます。
選択してインストールしましょう。

もし出てこない場合は、以下からダウンロードすることもできます。
https://plugins.jetbrains.com/plugin/7809?pr=idea

その場合は、Settings>Plugins>「Install Plugin from disk」で、ダウンロードしたzipファイルを選択します。

Silex Pimple Dumperのインストール

silex-idea-pluginは、silex-pimple-dumperで生成するpimple.jsonを利用してコード補完を行います。

composer require sorien/silex-pimple-dumper:1.0.* --dev

とかでインストールして、

$app->register(new \Sorien\Provider\PimpleDumpProvider());

で、Containerに登録すればOK。

['debug'] = trueであれば、projectのルートにpimple.jsonを吐き出してくれます。

もしくは、http://your_project/_dumpにアクセスしてもOKです。

参考

https://youtrack.jetbrains.com/issue/WI-17116
https://github.com/Sorien/silex-idea-plugin
https://github.com/Sorien/silex-pimple-dumper

12
13
1

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
12
13