Skip to content

factory suggestions - use PimpleInterop#7

Open
dragoonis wants to merge 1 commit intodelboy1978uk:masterfrom
dragoonis:factory-suggestions
Open

factory suggestions - use PimpleInterop#7
dragoonis wants to merge 1 commit intodelboy1978uk:masterfrom
dragoonis:factory-suggestions

Conversation

@dragoonis
Copy link
Copy Markdown

https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php

for factories
https://github.com/moufmouf/pimple-interop/blob/master/src/Interop/Container/Pimple/PimpleInterop.php#L120

each app package should return an array of factory classes, similar to factories.php in this PR.

See Zend\ModuleManager
See Zend "getServiceConfig()"

Example:

class PackageManager {
    public function registerPackageFactories(PackageCollection $packages) {
      foreach($packages as $package) {
          $packageFactories = $package->getFactories();
          foreach($packageFactories as $key => $val) {
               $container[$key] = $val;
          }
      }
    }
}

class PackageCollection {
  public function addPackage(PackageInterface $package);
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant