Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kix/generator-bundle
Rethinking of Symfony2 generators
https://github.com/kix/generator-bundle
bundle symfony symfony-bundle
Last synced: about 1 month ago
JSON representation
Rethinking of Symfony2 generators
- Host: GitHub
- URL: https://github.com/kix/generator-bundle
- Owner: kix
- Created: 2014-12-11T18:29:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-24T10:50:41.000Z (almost 10 years ago)
- Last Synced: 2024-10-01T15:27:52.834Z (about 2 months ago)
- Topics: bundle, symfony, symfony-bundle
- Language: PHP
- Size: 203 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Code generators
===============This is a collection of Symfony 2 code generators based on nikic's PHP-Parser.
These generators can be way more flexible than the ones provided by SensioGeneratorBundle
due to their event-based nature.First, all generators utilize an event dispatcher to notify others of the changes. This allows
automatic tests/specs generation once a base generator has fired.[Here the `ControllerGenerator` dispatches a `ControllerGenerated` event](https://github.com/kix/generator-bundle/blob/master/src/Generator/ControllerGenerator.php#L56)
which then triggers [TwigViewGenerator](https://github.com/kix/generator-bundle/blob/master/src/Generator/TwigViewGenerator.php#L20) and
[UnitTestGenerator](https://github.com/kix/generator-bundle/blob/master/src/Generator/UnitTestGenerator.php#L36)
to generate tests and Twig templates.Second, an AST processor dispatcher is built in. You can hook up your own `ProcessorInterface`
implementations that would modify the syntax tree before it's dumped into a file.Currently, the implementation is lacking some things:
- ~~PHPParser does not yet allow dumping comment blocks, so there's no way to generate
annotations yet.~~
- The ControllerGenerator is mostly just proof-of-concept.
- AST processors have not really been tested yet.
- Everything needs way more flexibility.