vendor/mewesk/twig-spreadsheet-bundle/src/DependencyInjection/Configuration.php line 21

Open in your IDE?
  1. <?php
  2. namespace MewesK\TwigSpreadsheetBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * Class Configuration.
  7.  */
  8. class Configuration implements ConfigurationInterface
  9. {
  10.     /**
  11.      * {@inheritdoc}
  12.      *
  13.      * @throws \RuntimeException
  14.      */
  15.     public function getConfigTreeBuilder()
  16.     {
  17.         $treeBuilder = new TreeBuilder();
  18.         $rootNode $treeBuilder->root('mewes_k_twig_spreadsheet');
  19.         $rootNode
  20.             ->children()
  21.                 ->booleanNode('pre_calculate_formulas')
  22.                     ->defaultTrue()
  23.                     ->info('Disabling formula calculations can improve the performance but the resulting documents won\'t immediately show formula results in external programs.')
  24.                 ->end()
  25.                 ->arrayNode('cache')
  26.                     ->addDefaultsIfNotSet()
  27.                     ->children()
  28.                         ->scalarNode('bitmap')
  29.                             ->defaultValue('%kernel.cache_dir%/spreadsheet/bitmap')
  30.                             ->cannotBeEmpty()
  31.                             ->info('Using a bitmap cache is necessary, PhpSpreadsheet supports only local files.')
  32.                         ->end()
  33.                         ->scalarNode('xml')
  34.                             ->defaultFalse()
  35.                             ->example('"%kernel.cache_dir%/spreadsheet/xml"')
  36.                             ->info('Using XML caching can improve memory consumption by writing data to disk. Works only for .xlsx and .ods documents.')
  37.                         ->end()
  38.                     ->end()
  39.                 ->end()
  40.                 ->arrayNode('csv_writer')
  41.                     ->addDefaultsIfNotSet()
  42.                     ->info('See PhpOffice\PhpSpreadsheet\Writer\Csv.php for more information.')
  43.                     ->children()
  44.                         ->scalarNode('delimiter')
  45.                             ->defaultValue(',')
  46.                         ->end()
  47.                         ->scalarNode('enclosure')
  48.                             ->defaultValue('"')
  49.                         ->end()
  50.                         ->booleanNode('excel_compatibility')
  51.                             ->defaultFalse()
  52.                         ->end()
  53.                         ->booleanNode('include_separator_line')
  54.                             ->defaultFalse()
  55.                         ->end()
  56.                         ->scalarNode('line_ending')
  57.                             ->defaultValue(PHP_EOL)
  58.                         ->end()
  59.                         ->integerNode('sheet_index')
  60.                             ->defaultValue(0)
  61.                         ->end()
  62.                         ->booleanNode('use_bom')
  63.                             ->defaultFalse()
  64.                         ->end()
  65.                     ->end()
  66.                 ->end()
  67.             ->end();
  68.         return $treeBuilder;
  69.     }
  70. }