# PHPStorm support?

**URL:** <https://forum.getkirby.com/t/phpstorm-support/7874>\
**Category:** Questions\
**Tags:** v2\
**Created:** [July 4, 2017, 6:08pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874 "2017-07-04T18:08:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stolenbows](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Stolenbows](https://forum.getkirby.com/u/Stolenbows)\
**Post date:** [July 4, 2017, 6:08pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/1 "2017-07-04T18:08:48Z")

</div>

Hey does anyone use PHPStorm with Kirby and have you gotten the functions and variables working?

For example “$kirby” gives an undefined variable error while “snippet” is an undefined function.

Is it possible to get kirby variables defined in someway?

I know how to disable them but i’d like to get them working 😛

---

<div class="post-metadata">

**Author:** ![Svnt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/svnt/32/620_2.png) [@Svnt](https://forum.getkirby.com/u/Svnt)\
**Post date:** [July 4, 2017, 6:29pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/2 "2017-07-04T18:29:05Z")

</div>

How do the code reflection headers of php classes in PHPstorm looks like?

It seems kirby toolkit classes already do include eclipse (ZendStudio,…) style reflection headers.

I’ll ask a workmate (PHPstorm fanboy) tomorrow.

Svnt.

---

<div class="post-metadata">

**Author:** ![Stolenbows](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Stolenbows](https://forum.getkirby.com/u/Stolenbows)\
**Post date:** [July 4, 2017, 6:35pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/3 "2017-07-04T18:35:51Z")

</div>

I’ve figured out how to get the variables like snippet working (my own fault by marking the directory as excluded), however $kirby is still undefined; [this](http://imgur.com/a/WIp4y) is the error i get from phpstorm.

---

<div class="post-metadata">

**Author:** ![fvsch](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/fvsch/32/15908_2.png) [@fvsch](https://forum.getkirby.com/u/fvsch)\
**Post date:** [July 4, 2017, 7:27pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/4 "2017-07-04T19:27:43Z")

</div>

This warning sounds sensible. Using a variable only defined in a if/else block can result in bugs.

But if this inspection in PhpStorm is not useful for you, you can disable it. There are a few inspections I tend to disable because they’re not relevant to a project, my coding style, or because they have too many false positives for my taste.

---

<div class="post-metadata">

**Author:** ![seb](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/seb/32/3296_2.png) [@seb](https://forum.getkirby.com/u/seb)\
**Post date:** [December 30, 2017, 2:12pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/5 "2017-12-30T14:12:39Z")

</div>

I started to use PHPStorm and Laravel for work, so when I returned to my Kirby projects this holiday, I was missing PHPStorm, and I noticed… PHPStorm has a hard time understanding Kirby.

So I made this IDE-helper-generator, after the Laravel IDE-helper by barryvdh. Hope it’s useful to someone. 🙂

Just put it in your project root and run `php _ide_helper_generator.php` from the command line. Don’t add the generated files to your Kirby, just leave them for PHPStorm to inspect.

> <https://gist.github.com/sebsel/3dce47c53ea9785f6ffb07aaa51c35ce>

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:30pm UTC](https://forum.getkirby.com/t/phpstorm-support/7874/6 "2025-02-06T17:30:15Z")

</div>


