Bug #46008

Reflection should resolve relative namespaces

Added by Christopher Hlubek over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Should have
Category:
Reflection
Target version:
-
Start date:
2013-03-04
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

Annotations (e.g. @var) with relative class names are not resolved correctly under the namespace of the given class.
To have a correct handling of namespaces in PHP we should support the usage of relative class names in these places.

namespace MyVendor\MyPackage\Domain\Model;

class Foo {

    /**
     * @var Bar
     */
    protected $bar;

}
namespace MyVendor\MyPackage\Domain\Model;

class Bar {

}

Since this is a problem for some people (e.g. also PhpStorm uses relative class names when auto-completing) I consider this a bug we should solve in the framework.


Related issues

Related to TYPO3.Flow - Bug #50909: Dependency injection for imported namespaces fails for abstract classesResolvedBastian Waidelich2013-08-08

Actions
Related to TYPO3.Flow - Bug #57034: Dependency injection for imported namespaces fails for collection classesResolvedBastian Waidelich2014-03-18

Actions
Related to TYPO3 Core - Bug #57856: @inject does not work relative to current namespaceClosed2014-04-12

Actions
Related to TYPO3 Core - Bug #85932: Incorrect annotation for property "message" in class "Error".Closed2018-08-23

Actions

Also available in: Atom PDF