erichard / SublimePHPCompanion

A Sublime Text plugin that provides cool stuff for PHP 5.3+ coding session.
MIT License
932 stars 115 forks source link

Support for importing pre-defined interfaces from the global namespace. #103

Closed ezzatron closed 6 years ago

ezzatron commented 7 years ago

This PR adds interfaces to the list of types that can be imported from the global namespace.

You might remember me from 4 years ago (😮) when I raised #13/#14, and I can't believe it's taken me so long to submit a PR to fix this!

Basically, when #13 was addressed, you ended up using get_declared_classes(), which covers classes, but not interfaces. To include interfaces you also need get_declared_interfaces().

Note that ever since PHP 5.4, there is also get_declared_traits(), but there are currently no traits in the PHP standard library, and since it would require some tricks to continue 5.3 support, I decided not to add that in this PR.

erichard commented 6 years ago

Hey ! Welcome back @ezzatron !

I can't believe it took me so long to merge your work ! Sorry for that and thank for the PR !