We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon 2 in PHPStorm

Hello. I have just installed the latest Phalcon2 library using composer in PHPStorm. Now when I use the ide 1.3.4 setup my intellisense is fine but as soon as I try use 2.0.0 I loose my intellisense. Has anyone else experienced this if so please tell me how I can solve it. I am on a windows 8 machine using PHPStorm 7



4.7k

I've got the same Problem. I set the External Library to "~/devtools/ide/2.0.0/Phalcon" and it seems that there are most parts missing.

Before the upgrade i could write this in a controller

$this->request

And PhpStorm suggested me the available Methods. After the upgrade to 2.0.0 and the implementation of the new devtools i get no suggestion. PhpStorm tells me "Field accessed via magic methods".

How do i get the full auto completion like in 1.3.4?

edited Apr '15

@Mikel you're setting the path wrong. It should be only "~/devtools/ide/2.0.0"

edited Apr '15

Yes that is exactly how I did it. However still no intellisense



4.7k
edited Apr '15

I've changed the path to "~/devtools/ide/2.0.0" and it still doesn't work. Before with version 1.3.4 i had the path set to "~/devtools/ide/1.3.4/Phalcon" and it works.

edited Apr '15

@Mikel you're setting the path wrong. It should be only "~/devtools/ide/2.0.0"

@Stefan, do you have intellisense working with devtools v2.0.0? Because I have not been able to make it work. I tried to set the suggested include path as "x/2.0.0" and "x/2.0.0/phalcon", nothing works with the 2.0.0 branch. Both "x/1.3.4" and "x/1.3.4/phalcon" work.

I would be happy if you can explain in detail how you got it working.

I'm using Intellij 14 and ubuntu 15.04 and for me works the same with 1.3.x and 2.0.0. Indeed there is no intellisense on magic methods, but I didn't had it before, so maybe that's why I thought is working as intended. When I have time maybe I'll take a look over the devtools and hopefully I spot something.

@stefan make sure that you are using 2.0.0 as I thought I had it working by pointing to 2.0.0 but as soon as I removed the 1.3.4 folder it stopped working. Keep in my mind that I am working on Windows



16.0k
Accepted
answer
edited Apr '15

Problem fixed. Get the latest devtools and should work. If there is something else that's not working please let me know.

Problem fixed. Get the latest devtools and should work. If there is something else that's not working please let me know.

Wow! That was quick. I just did a copy/paste for now and it works perfectly as far as I can see, only did a few quick tests but apparently all methods/properties and such pop up as expected.

Great job! Thanks!



4.7k

Works for me. Thanks :)

Working my side to. Thanks



165
edited Jul '16

I suggest to try Codelobster. It has special support for Phalcon.

edited Jul '16

I suggest to try Codelobster. It has special support for Phalcon.

Thanks. Checked it out on their website, unfortunately it appears to be windows only. Not sure how successful that software strategy is today. There is also a phpstorm plugin for phalcon.

But what I found is that it is more important to set your code up so you get the full inheritance exposed.

I do that by creating "master-classes" that inherit from Controller, Form, Component respectively. and then let everything else inherit from them instead. Then I can add new services to their docblocks and have full code completion etc. for my own additions.



83
edited Jul '16

Hello, i have the sam question. i git clone the latest phalcon-devtools 2.0.13 and can't find the file [/phalcon-devtools/ide/phpstorm/2.0.13] the phpsotrm folder only have two file is

  • phalcon.bat
  • phalcon.sh*

How should i do? Thank you

[update]

i set the path 'phalcon-devtools/ide/stubs/Phalcon' ,it workable

I confirm that phalcon-devtools-3.0.1/ide/stubs/Phalcon as a path in 'External libraries' works excellent with PHP Storm 2016.2.x