Skip to content

Commit

Permalink
feature: introduce ahead-of-time factory compiler
Browse files Browse the repository at this point in the history
There are projects out there which do want to have "autowiring". Since the service manager is not build with that kind of autowiring compatibility, some developers started to use `ReflectionBasedAbstractFactory` so that they can prevent themselves from writing factories.

Since this project does already provide a CLI command to generate factories, having another CLI command which scans the project configuration for services registered via `ReflectionBasedAbstractFactory` should work.

With this change, both `ReflectionBasedAbstractFactory` and `FactoryCreator`-Command do use the same constructor parameter resolving logic. Due to this, we can safely assume that all services registered with a `ReflectionBasedAbstractFactory` can also be generated during CI.

Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Apr 5, 2023
1 parent 4a9c01b commit aa86639
Show file tree
Hide file tree
Showing 23 changed files with 948 additions and 284 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"brick/varexporter": "^0.3.8",
"laminas/laminas-stdlib": "^3.2.1",
"psr/container": "^1.0"
},
Expand All @@ -49,6 +50,7 @@
"laminas/laminas-coding-standard": "~2.5.0",
"laminas/laminas-container-config-test": "^0.8",
"laminas/laminas-dependency-plugin": "^2.2",
"lctrs/psalm-psr-container-plugin": "^1.9",
"mikey179/vfsstream": "^1.6.11@alpha",
"ocramius/proxy-manager": "^2.14.1",
"phpbench/phpbench": "^1.2.7",
Expand Down
241 changes: 184 additions & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
<pluginClass class="Boesing\PsalmPluginStringf\Plugin"/>
<pluginClass class="Lctrs\PsalmPsrContainerPlugin\Plugin"/>
</plugins>
</psalm>
Loading

0 comments on commit aa86639

Please sign in to comment.