Skip to content

Lazy load interface definitions for generated factories #129

@JanTvrdik

Description

@JanTvrdik

Currently calling $configurator->loadContainer() triggers autoloading for all interfaces implemented by generated factories (which because of parameter and return types cause loading their dependencies…)

The solution is to either move implementation of generated factories to different file or to move it to runtime (possible utilizing anonymous classes in PHP 7)

/**  * @return App\Components\MyComponent  */ public function createService__248() { return new class($this) implements App\Components\IMyComponentFactory { private $container; public function __construct(Container_7bc42fd40e $container) { $this->container = $container; } public function create(): App\Components\MyComponent { return new App\Components\MyComponent(); } }; }

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