Created
September 22, 2015 17:36
-
-
Save SpacefulSpecies/419cc138355769773087 to your computer and use it in GitHub Desktop.
Phpstorm 9.0.2 bug reproduction: Namespaced functions not detected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo; | |
/** | |
* @return \DateTime | |
*/ | |
function getDateTime() { | |
return new \DateTime(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include __DIR__ . '/functions.php'; | |
echo \Foo\getDateTime()->format('U'); // Warning: Method 'format' not found in class | |
# When I place the function in the root namespace, the function got recognised | |
# and I can autocomplete chain on its return value without a problem. | |
# But when the function is namespaced, PhpStorm 9 will not detect it anymore | |
# and it will throw an inspection error. | |
# (I'm sure this worked in PhpStorm 8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://youtrack.jetbrains.com/issue/WI-28993