Skip to content

Commit

Permalink
wip - use the new bundle structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Apr 17, 2024
1 parent c4f8d2c commit 80aafec
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 84 deletions.
3 changes: 3 additions & 0 deletions src/Resources/config/makers.xml → config/makers.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" ?>




<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
Expand Down
File renamed without changes.
File renamed without changes.
32 changes: 0 additions & 32 deletions src/DependencyInjection/Configuration.php

This file was deleted.

51 changes: 0 additions & 51 deletions src/DependencyInjection/MakerExtension.php

This file was deleted.

38 changes: 37 additions & 1 deletion src/MakerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,52 @@
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\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @author Javier Eguiluz <[email protected]>
* @author Ryan Weaver <[email protected]>
*/
class MakerBundle extends Bundle
class MakerBundle extends AbstractBundle
{
public function configure(DefinitionConfigurator $definition): void
{
$definition->rootNode()
->children()
->scalarNode('root_namespace')
->defaultValue('App')
->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, $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
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/maker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is the old maker.xml... why is github complaining abaout a merge conflict....

0 comments on commit 80aafec

Please sign in to comment.