vendor/theofidry/alice-data-fixtures/src/Bridge/Symfony/DependencyInjection/Configuration.php line 35

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Fidry\AliceDataFixtures package.
  4.  *
  5.  * (c) Théo FIDRY <theo.fidry@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace Fidry\AliceDataFixtures\Bridge\Symfony\DependencyInjection;
  12. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  13. use Symfony\Component\Config\Definition\ConfigurationInterface;
  14. /**
  15.  * @private
  16.  */
  17. final class Configuration implements ConfigurationInterface
  18. {
  19.     public const DOCTRINE_ORM_DRIVER 'doctrine_orm';
  20.     public const DOCTRINE_MONGODB_ODM_DRIVER 'doctrine_mongodb_odm';
  21.     public const DOCTRINE_PHPCR_ODM_DRIVER 'doctrine_phpcr_odm';
  22.     public const ELOQUENT_ORM_DRIVER 'eloquent_orm';
  23.     /**
  24.      * @inheritdoc
  25.      */
  26.     public function getConfigTreeBuilder()
  27.     {
  28.         $treeBuilder = new TreeBuilder();
  29.         $rootNode $treeBuilder->root('fidry_alice_data_fixtures');
  30.         $rootNode
  31.             ->children()
  32.                 ->scalarNode('default_purge_mode')
  33.                     ->defaultValue('delete')
  34.                     ->validate()
  35.                     ->ifNotInArray(['delete''truncate''no_purge'])
  36.                         ->thenInvalid('Invalid purge mode %s. Choose either "delete", "truncate" or "no_purge".')
  37.                     ->end()
  38.                 ->end()
  39.                 ->arrayNode('db_drivers')
  40.                     ->info('The list of enabled drivers.')
  41.                     ->addDefaultsIfNotSet()
  42.                     ->cannotBeOverwritten()
  43.                     ->children()
  44.                         ->booleanNode(self::DOCTRINE_ORM_DRIVER)
  45.                             ->defaultValue(null)
  46.                         ->end()
  47.                         ->booleanNode(self::DOCTRINE_MONGODB_ODM_DRIVER)
  48.                             ->defaultValue(null)
  49.                         ->end()
  50.                         ->booleanNode(self::DOCTRINE_PHPCR_ODM_DRIVER)
  51.                             ->defaultValue(null)
  52.                         ->end()
  53.                         ->booleanNode(self::ELOQUENT_ORM_DRIVER)
  54.                             ->defaultValue(null)
  55.                         ->end()
  56.                     ->end()
  57.                 ->end()
  58.             ->end()
  59.         ;
  60.         return $treeBuilder;
  61.     }
  62. }