Many "Use of unknown class" warnings - references not found
3 posts
• Page 1 of 1
Many "Use of unknown class" warnings - references not found
Hello,
I do a lot of Joomla extension and plugin development using VS 2017 and PHP tools.
The problem that makes development a pain is that PHP tools doesn't find many many references to the Joomla framework class. I always get the above warning "Use of unknown class" for almost all Joomla classes like:
The project includes the complete Joomla source tree with all files and folders. So there are no additional external references which I could include.
Why does PHP tools not find those classes and references?
I didn't have that problem with other PHP IDEs.
Right now PHP tools is almost useless for Joomla development.
Could you please have a look at this.
Thanks.
I do a lot of Joomla extension and plugin development using VS 2017 and PHP tools.
The problem that makes development a pain is that PHP tools doesn't find many many references to the Joomla framework class. I always get the above warning "Use of unknown class" for almost all Joomla classes like:
- JHtml
- JRoute
- JFactory
- JControllerLegacy
- and many more
The project includes the complete Joomla source tree with all files and folders. So there are no additional external references which I could include.
Why does PHP tools not find those classes and references?
I didn't have that problem with other PHP IDEs.
Right now PHP tools is almost useless for Joomla development.
Could you please have a look at this.
Thanks.
- info@dotcompanion.de
- Posts: 4
- Joined: September 17th, 2018, 6:13 pm
Re: Many "Use of unknown class" warnings - references not fo
Hi,
Thanks for the feedback.
It seams all these Joomla classes are "aliased", actually not defined in the code, and PHP Tools does not handle that yet.
For other IDE's it is usually necessary to include a special PHP file that adds dummy declarations of these files (like this one https://github.com/Jensen-Technologies/ ... m.meta.php)
We'll definitely add better support for Joomla (and aliased classes in general) in future. For now I suggest to include the `.phpstorm.meta.php` file above into your project to satisfy the editor's warnings.
Thanks,
Thanks for the feedback.
It seams all these Joomla classes are "aliased", actually not defined in the code, and PHP Tools does not handle that yet.
For other IDE's it is usually necessary to include a special PHP file that adds dummy declarations of these files (like this one https://github.com/Jensen-Technologies/ ... m.meta.php)
We'll definitely add better support for Joomla (and aliased classes in general) in future. For now I suggest to include the `.phpstorm.meta.php` file above into your project to satisfy the editor's warnings.
Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: Many "Use of unknown class" warnings - references not fo
Thank you very much!
This helped a lot.
After including the meta file with the alias information almost all the classes are recognized.
Nevertheless I hope you'll implement the alias feature in the future because otherise those dummy classes have to be maintained and updated potentially after each Joomla update.
This helped a lot.
After including the meta file with the alias information almost all the classes are recognized.
Nevertheless I hope you'll implement the alias feature in the future because otherise those dummy classes have to be maintained and updated potentially after each Joomla update.
- info@dotcompanion.de
- Posts: 4
- Joined: September 17th, 2018, 6:13 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest