Bug #10595

ObjectManager should not allow injection of prototypes

Added by Bastian Waidelich almost 11 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
Object
Start date:
2010-11-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

Currently it is possible to inject prototypes like:

public function injectTagBuilder(\F3\Fluid\Core\ViewHelper\TagBuilder $tagBuilder) {
    $this->tagBuilder = $tagBuilder;
}

This leads to some unexpected side effects especially when used in singletons.
IMO we should prevent this and throw a meaningful exception stating that you need to inject the object manager in order to create prototype instances.


Related issues

Related to TYPO3.Flow - Bug #25448: Use of undefined constant 'X' during prototype injectionClosedRobert Lemke2011-03-30

Actions
Related to TYPO3.Flow - Bug #25908: ProxyClassBuilder produces invalid code for prototype argumentsResolvedRobert Lemke2011-04-12

Actions
#1

Updated by Karsten Dambekalns over 10 years ago

  • Status changed from New to Accepted
  • Assignee set to Robert Lemke
  • Target version set to 1.0 beta 1

As discussed a few times in the past weeks, prototype injection should be possible, but it needs to

  • have everything needed to costruct configured
  • or have a factory configured

Currently it is possible to have prototypes injected.

Robert Lemke: if this is done, please resolve/close, if not, give feedback.

#2

Updated by Sebastian Kurfuerst about 10 years ago

  • Status changed from Accepted to Rejected

Also available in: Atom PDF