zendframework / zend-di

Di component from Zend Framework
BSD 3-Clause "New" or "Revised" License
46 stars 29 forks source link

Feature: Create service factories for AoT #30

Closed tux-rampage closed 6 years ago

tux-rampage commented 6 years ago

Zend\Di should provide service factories for the AoT code generators, to minimize repetetive Tasks when using AoT.

The factory should utilize the config service to obtain information such as target namespace and output directory.

Code to reproduce the issue

A developer using Zend Mvc or Expressive should be able to obtain the AoT generator like this, without additional Implementations:

/** @var \Zend\ServiceManager\ServiceManager */
$generator = $serviceManager->get(\Zend\Di\GodeGenerator\InjectorGenerator::class);

Expected results

$generator should be a ready to use generator instance.

Actual results

Service manager throws an exception.