Bug #2558

Property Injection doesn't work with subclasses

Added by Robert Lemke almost 11 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Category:
Object
Start date:
2009-02-04
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

A property flagged for property injection will only be injected in the class it has been defined, not in one of the subclasses:

class Foo {

   /**
    * @var Baz
    * @inject
    */
   protected $baz;
}

class Bar extends Foo {

   public function doSomething() {
      $this->baz->doSomething()
   }
}

... will result in a fatal error because $this->baz is not defined.

History

#1 Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from New to Accepted
  • Assignee changed from Robert Lemke to Karsten Dambekalns

#2 Updated by Karsten Dambekalns almost 11 years ago

  • Status changed from Accepted to Closed
  • % Done changed from 0 to 100

No change required, works as expected.

Also available in: Atom PDF