mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1025: Please repalce 'Doctrine\XXX\YYY' with '\Doctrine\XXX\YYY' in code and document #1283
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 9, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user wsyb:
It will help us use the namespace and code autocomplete in some IDE.
@doctrinebot commented on GitHub (Apr 8, 2011):
Comment created by matthieu:
Hi, do you have any more information about this ?
I'm confused because the php documentation uses the Doctrine\XXX way, and everywhere I've seen, it is used like that.
Thanks
@doctrinebot commented on GitHub (Apr 11, 2011):
Comment created by k-fish:
The issue is simple and logical. :)
When an IDE (I am using PhpStorm and it does it like this) sees a namespace in a file, upon seeing namespaces afterwards, it sees them as absolute if they have a leading backslash, or relative when it does not. This affects the resolution of classes for type navigation, code inspection, ... The same rules as for actual PHP code should be used within comments.
Here is an example:
The IDE will think $baz is \Foo\Baz and $quux will be seen as being \Quux. Now if you have some reference to Doctrine here, and it was relative, the IDE would assume it's \Foo\Doctrine...
@doctrinebot commented on GitHub (Apr 11, 2011):
Comment created by @beberlei:
Well yes, but since all our code examples have no leading namespace argument this means the code is in the default namespace, making Doctrine\XXX\YY a relative namespace that is actually valid.
@doctrinebot commented on GitHub (Apr 11, 2011):
Comment created by k-fish:
Yes, but the source code docblocks are what is meant here as far as I am concerned.
@doctrinebot commented on GitHub (May 13, 2011):
Comment created by morfi:
Example (Entitymanager.php):
and
Result:
Doctrine\ORM\Doctrine\ORM\Configuration
Should be:
Or
@doctrinebot commented on GitHub (May 27, 2011):
Comment created by mvrhov:
Why don't you take this to the PhpStorm tracker as it surely is a bug in IDE?
@doctrinebot commented on GitHub (May 27, 2011):
Comment created by k-fish:
Miha, what makes you think it's an IDE bug? In a class in namespace Foo another class named Bar is \Foo\Bar, but \Bar is \Bar. Why is it a bug if the IDE follows the namespace resolution rules?
@doctrinebot commented on GitHub (Jul 11, 2011):
Comment created by mridgway:
The issue is that PHPStorm and NetBeans have different class resolution rules. I also use PHPStorm and most of Doctrine does not resolve auto-completion correctly because of this issue.
I'd be willing to work on this if it would be accepted.
@doctrinebot commented on GitHub (Sep 29, 2011):
Comment created by andrewmackrodt:
I've been evaluating PhpStorm and also came across this issue; I believe the problem is due to Doctrine rather than being a bug with the IDE although it would be nice if PhpStorm would assume namespaces are absolute if they're not resolved upon an initial lookup.
I created a quick c# app to append the beginning forward slash to any @var or @return attributes within Doctrine's source. It's working for me with Doctrine 2.1.2 and PhpStorm (IntelliJ): http://pastebin.com/4HxiWvJA - hopefully this will be of use for anyone else using these IDEs;. Note: the application doesn't detect multiple line annotations although the only one I'm aware of is the getAST method in Doctrine\ORM\Query.php.
@doctrinebot commented on GitHub (Dec 13, 2011):
Comment created by @beberlei:
This issue is referenced in Github Pull-Request GH-215
https://github.com/doctrine/doctrine2/pull/215
@doctrinebot commented on GitHub (Dec 13, 2011):
Comment created by @beberlei:
This issue is referenced in Github Pull-Request GH-216
https://github.com/doctrine/doctrine2/pull/216
@doctrinebot commented on GitHub (Apr 1, 2014):
Comment created by @deeky666:
Fixed in commits:
3b259dcb42bda98150c4@doctrinebot commented on GitHub (Apr 1, 2014):
Issue was closed with resolution "Fixed"