Feature #44157

Object configuration should imply annotated object name

Added by Adrian Föder over 8 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Object
Target version:
-
Start date:
2012-12-20
Due date:
% Done:

100%

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

Description

consider the following use case:

/**
 * @Flow\Scope("singleton")
 */
class FooService {

    /**
     * @var \TYPO3\Flow\Monitor\FileMonitor
     */
    protected $fileMonitor;
}

Acme\Acme\FooService: properties: fileMonitor: object: # name: TYPO3\Flow\Monitor\FileMonitor arguments: 1: value: 'MyPackage_MonitorIdentifier'

When running this way, Flow complains

  Uncaught Exception
    Object configuration for property "fileMonitor" contains neither
    object name nor factory object name in configuration of package ...

So, the commented line in the yaml above becomes necessary, however I think the default object name in this case should still be the annotated one.

Do you agree on this?

#1

Updated by Rafael Kähm over 8 years ago

good idea, minus one "source of error" for developers by multiple definition of the same property.
But be carefully with interfaces and abstract classes, so row 5 in your yaml should be optional.

#2

Updated by Adrian Föder over 8 years ago

  • Status changed from New to Under Review
  • Assignee set to Adrian Föder
#3

Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/17255

#4

Updated by Gerrit Code Review over 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/17255

#5

Updated by Gerrit Code Review over 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.Flow has been pushed to the review server.
It is available at http://review.typo3.org/17255

#6

Updated by Adrian Föder over 6 years ago

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

Also available in: Atom PDF