libpostal/php-postal not being seen within IDE
I'm trying to use php-postal extension which is a phpized wrapper of libpostal. The library is not being seen in phpStorm. The php-postal code works, and the library shows up in the php information in the phpStorm's php information, but the extension is not visible in the extension list.
Is there something I'm missing about registering a php extension?
php-postal code actually does run in the webserver, and the 30-postal.ini load is showing up in the IDE's list, but the code is red in the IDE indicating that the IDE is not recognizing the extension.
Any help would be welcomed...
Please sign in to leave a comment.
here's the php wrapper https://github.com/openvenues/php-postal
Hi there,
You can create a stub file that PhpStorm will understand. All stuff from PHP core that is known to PhpStorm is done this way (see for yourself: https://github.com/JetBrains/phpstorm-stubs)
Stub file is basically a PHP file with class/functions/constants/variables/etc definitions (with proper PHPDoc comment blocks) but all function/method bodies are empty.
You may check Google and/or GitHub -- maybe somebody have created them for your library already.
Feel free to submit the feature request to our tracking system here: http://youtrack.jetbrains.com/issues/WI#newissue=yes .
You can also create a stub and we (and other users) would be glad to to accept your contribution! Please follow instructions at https://github.com/JetBrains/phpstorm-stubs/blob/master/CONTRIBUTING.md .
Thanks for link and advice Andriy and Vladimir! I'll build a stub and post it here when I get it working correctly...
running as a stub gave me the expected result:
and
validate correctly in the IDE and also the code runs correctly.
I'm not sure if that is the way I'm supposed to code a stub though...
>I'm not sure if that is the way I'm supposed to code a stub though...
Overall it's all good -- you are going in the right direction.
The rest is just a matter of making it better/more practical in PHPDoc aspect: make it a bit easier to read (for others) and write (for yourself) as well as quality of the description itself.
My version (shows different things from the list above):
The main point is: there will be some stub (so IDE is happy) and some documentation to it (so user can look up at least something -- to get some basic idea of what this method does and what the params are for).
There is no need to make it perfect if you do not wish to share it etc. For your own usage even a version with no description parts at all will do (since you know what this or that method does).