Bug #50909

Dependency injection for imported namespaces fails for abstract classes

Added by Philipp Maier about 8 years ago. Updated about 8 years ago.

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

100%

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

Description

Within abstract classes, the @var annotation still must be fully qualified.

Working:

abstract class SomeClass {

        ...

    /**
     * @var \TYPO3\Flow\Security\Context
     * @Flow\Inject
     */
    protected $securityContext;

Not working:

use TYPO3\Flow\Security\Context;

abstract class SomeClass {

        ...

    /**
     * @var Context
     * @Flow\Inject
     */
    protected $securityContext;


Related issues

Related to TYPO3.Flow - Bug #46008: Reflection should resolve relative namespacesResolvedSebastian Kurfuerst2013-03-04

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

Actions
#1

Updated by Bastian Waidelich about 8 years ago

  • Category set to Reflection
  • Status changed from New to Accepted
  • Priority changed from Must have to Should have
#2

Updated by Bastian Waidelich about 8 years ago

  • Status changed from Accepted to Needs Feedback

Philipp, I can't reproduce this..
I have:

<?php
namespace Some\Package;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Context;

abstract class SomeAbstractClass {

    /**
     * @var Context
     * @Flow\Inject
     */
    protected $securityContext;

    /**
     * @return Context
     */
    public function getSecurityContext() {
        return $this->securityContext;
    }

}
?>

and

<?php
namespace Some\Package;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Context;

class SomeClass extends SomeAbstractClass {

}
?>

and everything works as expected..!?

#3

Updated by Bastian Waidelich about 8 years ago

  • Status changed from Needs Feedback to Accepted

Nevermind, I can reproduce it now

#4

Updated by Bastian Waidelich about 8 years ago

FYI: I'm on it but this is harder than I thought..

#5

Updated by Gerrit Code Review about 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23310

#6

Updated by Gerrit Code Review about 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23310

#7

Updated by Gerrit Code Review about 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23310

#8

Updated by Bastian Waidelich about 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF