Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Expected ConfigAbstractFactory configuration per service manager #212

Open
@roelvanduijnhoven

Description

@roelvanduijnhoven

I find the new Config Abstract Factory very handy. That saves a lot of typing. So thanks for that 👏.

One thing that keeps bothering me however is that there seems to be only a single configuration array that determinates how services in all service manager are to be instantiated. You can mix plain services, controllers and view helpers!

IMO that:

  • Introduces some possible problems if service names are identical.
  • Disallows one to properly split the configuration per service manager. When you have a lot of services it really helps to categorize them.

Another way of tackling this would be to add the config key directly as one of the components of the service manager config. But there are obviously other options.

return [
    'factories => [],
    \Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory::class => []
];

I am curious what other people think; or how they tackle this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions