Skip to content

Standardize factory context #184

Closed

Description

@ro0NL

Given

class X {
  public function __construct($fooBar) { }
}

We can factorize it in 3 ways

  • create(X::class, ['fooBarValue'])
  • create(X::class, ['foo_bar' => 'fooBarValue'])
  • create(X::class, ['fooBar' => 'fooBarValue'])

It's hard to anticipate on when working with a customized/decorated factory.

Idea is do dispatch an event, e.g. PRE_CREATE_OBJECT & POST_CREATE_OBJECT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions