-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #1514 replace Bundle with the new AbstractBundle class
* refactor in new generate_final_* params * is github still complaining about a merge conflict * php-cs-fixer it up * minor disclaimer for php-cs-fixer config * move docs to project level dir instead of in src/Resources * remove unused files * add missing extension alias * fix doctrine ns config * fix bundled php-cs-fixer config path
- Loading branch information
Showing
10 changed files
with
54 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ branches: ["main"] | |
|
||
maintained_branches: ["main"] | ||
|
||
doc_dir: "src/Resources/doc" | ||
doc_dir: "docs" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,57 @@ | |
use Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass\MakeCommandRegistrationPass; | ||
use Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass\RemoveMissingParametersPass; | ||
use Symfony\Bundle\MakerBundle\DependencyInjection\CompilerPass\SetDoctrineAnnotatedPrefixesPass; | ||
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator; | ||
use Symfony\Component\DependencyInjection\Compiler\PassConfig; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
use Symfony\Component\HttpKernel\Bundle\AbstractBundle; | ||
|
||
/** | ||
* @author Javier Eguiluz <[email protected]> | ||
* @author Ryan Weaver <[email protected]> | ||
*/ | ||
class MakerBundle extends Bundle | ||
class MakerBundle extends AbstractBundle | ||
{ | ||
protected string $extensionAlias = 'maker'; | ||
|
||
public function configure(DefinitionConfigurator $definition): void | ||
{ | ||
$definition->rootNode() | ||
->children() | ||
->scalarNode('root_namespace')->defaultValue('App')->end() | ||
->booleanNode('generate_final_classes')->defaultTrue()->end() | ||
->booleanNode('generate_final_entities')->defaultFalse()->end() | ||
->end() | ||
; | ||
} | ||
|
||
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void | ||
{ | ||
$container->import('../config/services.xml'); | ||
$container->import('../config/makers.xml'); | ||
|
||
$rootNamespace = trim($config['root_namespace'], '\\'); | ||
|
||
$container->services() | ||
->get('maker.autoloader_finder') | ||
->arg(0, $rootNamespace) | ||
->get('maker.generator') | ||
->arg(1, $rootNamespace) | ||
->get('maker.doctrine_helper') | ||
->arg(0, \sprintf('%s\\Entity', $rootNamespace)) | ||
->get('maker.template_component_generator') | ||
->arg(0, $config['generate_final_classes']) | ||
->arg(1, $config['generate_final_entities']) | ||
->arg(2, $rootNamespace) | ||
; | ||
|
||
$builder | ||
->registerForAutoconfiguration(MakerInterface::class) | ||
->addTag(MakeCommandRegistrationPass::MAKER_TAG) | ||
; | ||
} | ||
|
||
public function build(ContainerBuilder $container): void | ||
{ | ||
// add a priority so we run before the core command pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters