1

In PhpStorm 2017.1 version, I get the error - "undefined namespace Phalcon. Referenced namespace is not found". So I tried to include the Phalcon devtools. I included them and the 'External Liabraries' of the project Explorer found the name - Phalcon. Even I can load the project url and get output in browser. But the message still appears.

enter image description here

Another screenshot goes below to show the folder i selected in the include path. notice that under 'ide->Phpstorm', i do not see any other file or directory.

enter image description here

Other answers in SO use a back version of Phalcon devtools.

How can i remove the message and get PhpStorm handle Phalcon smartly ?

Istiaque Ahmed
  • 6,072
  • 24
  • 75
  • 141

1 Answers1

4

From Phalcon 3.1 stubs are available in separated repository - https://github.com/phalcon/ide-stubs

Juri
  • 1,369
  • 10
  • 16
  • And it worked ! BTW where can I find this information in Phalcon documentation or Phpstorm doc or elsewhere ? – Istiaque Ahmed Jun 23 '17 at 06:41
  • @IstiaqueAhmed If it is worked, could you accept answer? – serghei Jun 23 '17 at 07:40
  • 2
    I think it was mentioned in some blog post https://blog.phalconphp.com/post/phalcon-ide-stubs-repository – Juri Jun 23 '17 at 08:14
  • @Juri, How to install the IDE stub globally i.e. for all the projects? The above method applies for a single project . – Istiaque Ahmed Jun 23 '17 at 11:45
  • Well, add it to composer.json and composer install. It will be there. Also you can edit default settings and in new projects it will be there. Idk about current existing ones. – Juri Jun 23 '17 at 18:51
  • If anyone wants to make a PhpStorm plugin out of these stubs please follow the instruction https://github.com/artspb/phpstorm-library-plugin It's pretty simple and should not take much time to build and maintain. – artspb Jun 27 '17 at 18:27
  • 1
    phpstorm plugin already exists, please search in repository: https://plugins.jetbrains.com/plugin/9536-phalcon-auto-complete even better: it's open-sourced with GPL license :) so please contribute. –  Jun 29 '17 at 09:13