Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DI] Enable factory attribute in service defaults #22189

Copy link
Copy link
Closed
@curry684

Description

@curry684
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version master

Following up on #22143, the lack of proper error is solved now in #22185, but the use case for factory still seems valid:

services:
    _defaults:
        factory:        [ "@doctrine", getRepository ]

    AppBundle\RoleRepository:
        arguments:      [ "AppBundle:Role" ]
    AppBundle\UserRepository:
        arguments:      [ "AppBundle:User" ]

It was decided in #21071 (comment) to consider the factory attribute a detector flag for real services, but this has become obsolete, and the use case for default factory settings is there.

Therefore I propose to reallow factory in _defaults sections.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.