vendor/sylius/invoicing-plugin/src/DependencyInjection/Configuration.php line 27

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sylius\InvoicingPlugin\DependencyInjection;
  4. use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
  5. use Sylius\Component\Resource\Factory\Factory;
  6. use Sylius\InvoicingPlugin\Entity\BillingData;
  7. use Sylius\InvoicingPlugin\Entity\BillingDataInterface;
  8. use Sylius\InvoicingPlugin\Entity\Invoice;
  9. use Sylius\InvoicingPlugin\Entity\InvoiceInterface;
  10. use Sylius\InvoicingPlugin\Entity\InvoiceSequence;
  11. use Sylius\InvoicingPlugin\Entity\InvoiceSequenceInterface;
  12. use Sylius\InvoicingPlugin\Entity\LineItem;
  13. use Sylius\InvoicingPlugin\Entity\LineItemInterface;
  14. use Sylius\InvoicingPlugin\Entity\TaxItem;
  15. use Sylius\InvoicingPlugin\Entity\TaxItemInterface;
  16. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  17. use Symfony\Component\Config\Definition\ConfigurationInterface;
  18. final class Configuration implements ConfigurationInterface
  19. {
  20.     public function getConfigTreeBuilder(): TreeBuilder
  21.     {
  22.         $treeBuilder = new TreeBuilder();
  23.         $rootNode $treeBuilder->root('sylius_invoicing_plugin');
  24.         $rootNode
  25.             ->children()
  26.                 ->arrayNode('resources')
  27.                     ->addDefaultsIfNotSet()
  28.                     ->children()
  29.                         ->arrayNode('invoice')
  30.                             ->addDefaultsIfNotSet()
  31.                             ->children()
  32.                                 ->variableNode('options')->end()
  33.                                 ->arrayNode('classes')
  34.                                     ->addDefaultsIfNotSet()
  35.                                     ->children()
  36.                                         ->scalarNode('model')->defaultValue(Invoice::class)->cannotBeEmpty()->end()
  37.                                         ->scalarNode('interface')->defaultValue(InvoiceInterface::class)->cannotBeEmpty()->end()
  38.                                         ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
  39.                                         ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
  40.                                         ->scalarNode('repository')->cannotBeEmpty()->end()
  41.                                     ->end()
  42.                                 ->end()
  43.                             ->end()
  44.                         ->end()
  45.                         ->arrayNode('billing_data')
  46.                             ->addDefaultsIfNotSet()
  47.                             ->children()
  48.                                 ->variableNode('options')->end()
  49.                                 ->arrayNode('classes')
  50.                                     ->addDefaultsIfNotSet()
  51.                                     ->children()
  52.                                         ->scalarNode('model')->defaultValue(BillingData::class)->cannotBeEmpty()->end()
  53.                                         ->scalarNode('interface')->defaultValue(BillingDataInterface::class)->cannotBeEmpty()->end()
  54.                                         ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
  55.                                         ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
  56.                                         ->scalarNode('repository')->cannotBeEmpty()->end()
  57.                                     ->end()
  58.                                 ->end()
  59.                             ->end()
  60.                         ->end()
  61.                         ->arrayNode('line_item')
  62.                             ->addDefaultsIfNotSet()
  63.                             ->children()
  64.                                 ->variableNode('options')->end()
  65.                                 ->arrayNode('classes')
  66.                                     ->addDefaultsIfNotSet()
  67.                                     ->children()
  68.                                         ->scalarNode('model')->defaultValue(LineItem::class)->cannotBeEmpty()->end()
  69.                                         ->scalarNode('interface')->defaultValue(LineItemInterface::class)->cannotBeEmpty()->end()
  70.                                         ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
  71.                                         ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
  72.                                         ->scalarNode('repository')->cannotBeEmpty()->end()
  73.                                     ->end()
  74.                                 ->end()
  75.                             ->end()
  76.                         ->end()
  77.                         ->arrayNode('tax_item')
  78.                             ->addDefaultsIfNotSet()
  79.                             ->children()
  80.                                 ->variableNode('options')->end()
  81.                                 ->arrayNode('classes')
  82.                                     ->addDefaultsIfNotSet()
  83.                                     ->children()
  84.                                         ->scalarNode('model')->defaultValue(TaxItem::class)->cannotBeEmpty()->end()
  85.                                         ->scalarNode('interface')->defaultValue(TaxItemInterface::class)->cannotBeEmpty()->end()
  86.                                         ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
  87.                                         ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
  88.                                         ->scalarNode('repository')->cannotBeEmpty()->end()
  89.                                     ->end()
  90.                                 ->end()
  91.                             ->end()
  92.                         ->end()
  93.                         ->arrayNode('invoice_sequence')
  94.                             ->addDefaultsIfNotSet()
  95.                             ->children()
  96.                                 ->variableNode('options')->end()
  97.                                 ->arrayNode('classes')
  98.                                     ->addDefaultsIfNotSet()
  99.                                     ->children()
  100.                                         ->scalarNode('model')->defaultValue(InvoiceSequence::class)->cannotBeEmpty()->end()
  101.                                         ->scalarNode('interface')->defaultValue(InvoiceSequenceInterface::class)->cannotBeEmpty()->end()
  102.                                         ->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end()
  103.                                         ->scalarNode('factory')->defaultValue(Factory::class)->cannotBeEmpty()->end()
  104.                                         ->scalarNode('repository')->cannotBeEmpty()->end()
  105.                                     ->end()
  106.                                 ->end()
  107.                             ->end()
  108.                         ->end()
  109.                     ->end()
  110.                 ->end()
  111.             ->end()
  112.         ;
  113.         return $treeBuilder;
  114.     }
  115. }