[Solved] autoloader, class mapping, and phpStorm

is there a way to tell phpStorm what is the class mapping of a project?

In a project I am using, a very special autoloader is used, allowing (with other things) to call new \MyLib\Class() instead of new \MyLib\Class\Class()

The problem is that it seems to break

  • code completion
  • Syntax validation
  • PHPDoc


Is there something to do?

Marked as solved

0

There's no proper way to "explain" this mapping to IDE ATM.

The clunky workaround you may try is to create a file containing "bridge definitions" for all autoloaded classes:
class \MyLib\Class extends \MyLib\Class\Class {}
and drop it into anywhere within project folder.

Related: http://youtrack.jetbrains.com/issue/WI-381

0
Avatar
Permanently deleted user

thanks, I'll work on building this IDE_helps.php file.

Since it will tend to become a recurrent problem (add to this the massive adoption of PSR-0), I was wondering if an internal format wouldn't be more efficient than putting this mapping next to other source files…

Matthieu

0

Well, both IDE and its users are already fluent in PHP & @phpdoc.

0

请先登录再写评论。