vendor/pimcore/pimcore/bundles/CoreBundle/DependencyInjection/Configuration.php line 55

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\CoreBundle\DependencyInjection;
  15. use Pimcore\Bundle\CoreBundle\DependencyInjection\Config\Processor\PlaceholderProcessor;
  16. use Pimcore\Cache\Pool\Redis;
  17. use Pimcore\Storage\Redis\ConnectionFactory;
  18. use Pimcore\Targeting\Storage\CookieStorage;
  19. use Pimcore\Targeting\Storage\TargetingStorageInterface;
  20. use Pimcore\Workflow\EventSubscriber\ChangePublishedStateSubscriber;
  21. use Pimcore\Workflow\EventSubscriber\NotificationSubscriber;
  22. use Pimcore\Workflow\Notification\NotificationEmailService;
  23. use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
  24. use Symfony\Component\Config\Definition\Builder\NodeDefinition;
  25. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  26. use Symfony\Component\Config\Definition\ConfigurationInterface;
  27. class Configuration implements ConfigurationInterface
  28. {
  29.     /**
  30.      * @var PlaceholderProcessor
  31.      */
  32.     private $placeholderProcessor;
  33.     private $placeholders = [];
  34.     public function __construct()
  35.     {
  36.         $this->placeholderProcessor = new PlaceholderProcessor();
  37.         $this->placeholders = [];
  38.     }
  39.     /**
  40.      * Generates the configuration tree builder.
  41.      *
  42.      * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
  43.      */
  44.     public function getConfigTreeBuilder()
  45.     {
  46.         $treeBuilder = new TreeBuilder();
  47.         $rootNode $treeBuilder->root('pimcore');
  48.         $rootNode->addDefaultsIfNotSet();
  49.         $rootNode->ignoreExtraKeys();
  50.         $rootNode
  51.             ->children()
  52.                 ->arrayNode('error_handling')
  53.                     ->addDefaultsIfNotSet()
  54.                     ->children()
  55.                         ->booleanNode('render_error_document')
  56.                             ->info('Render error document in case of an error instead of showing Symfony\'s error page')
  57.                             ->defaultTrue()
  58.                             ->beforeNormalization()
  59.                                 ->ifString()
  60.                                 ->then(function ($v) {
  61.                                     return (bool)$v;
  62.                                 })
  63.                             ->end()
  64.                         ->end()
  65.                     ->end()
  66.                 ->end()
  67.                 ->arrayNode('bundles')
  68.                     ->addDefaultsIfNotSet()
  69.                     ->children()
  70.                         ->arrayNode('search_paths')
  71.                             ->prototype('scalar')->end()
  72.                         ->end()
  73.                         ->booleanNode('handle_composer')
  74.                             ->defaultTrue()
  75.                         ->end()
  76.                     ->end()
  77.                 ->end()
  78.                 ->arrayNode('flags')
  79.                     ->info('Generic map for feature flags')
  80.                     ->prototype('scalar')->end()
  81.                 ->end()
  82.                 ->arrayNode('translations')
  83.                     ->addDefaultsIfNotSet()
  84.                     ->children()
  85.                         ->booleanNode('case_insensitive')
  86.                             ->setDeprecated('The "%node%" option is deprecated and will be removed in Pimcore 10.')
  87.                             ->beforeNormalization()
  88.                                 ->ifString()
  89.                                 ->then(function ($v) {
  90.                                     return (bool)$v;
  91.                                 })
  92.                             ->end()
  93.                             ->info('Force Pimcore translations to NOT be case sensitive. This only applies to translations set via Pimcore\'s translator (e.g. website translations)')
  94.                             ->defaultFalse()
  95.                         ->end()
  96.                         ->arrayNode('admin_translation_mapping')
  97.                             ->useAttributeAsKey('locale')
  98.                             ->prototype('scalar')->end()
  99.                         ->end()
  100.                         ->arrayNode('debugging')
  101.                             ->info('If debugging is enabled, the translator will return the plain translation key instead of the translated message.')
  102.                             ->addDefaultsIfNotSet()
  103.                             ->canBeDisabled()
  104.                             ->children()
  105.                                 ->scalarNode('parameter')
  106.                                     ->defaultValue('pimcore_debug_translations')
  107.                                 ->end()
  108.                             ->end()
  109.                         ->end()
  110.                         ->arrayNode('data_object')
  111.                             ->addDefaultsIfNotSet()
  112.                             ->children()
  113.                                 ->arrayNode('translation_extractor')
  114.                                     ->children()
  115.                                         ->arrayNode('attributes')
  116.                                             ->info('Can be used to restrict the extracted localized fields (e.g. used by XLIFF exporter in the Pimcore backend)')
  117.                                             ->prototype('array')
  118.                                                 ->prototype('scalar')->end()
  119.                                             ->end()
  120.                                             ->example(
  121.                                                 [
  122.                                                     'Product' => ['name''description'],
  123.                                                     'Brand' => ['name'],
  124.                                                 ]
  125.                                             )
  126.                                         ->end()
  127.                                     ->end()
  128.                                 ->end()
  129.                             ->end()
  130.                         ->end()
  131.                     ->end()
  132.                 ->end()
  133.                 ->arrayNode('maps')
  134.                     ->addDefaultsIfNotSet()
  135.                     ->children()
  136.                         ->scalarNode('tile_layer_url_template')
  137.                             ->defaultValue('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png')
  138.                         ->end()
  139.                         ->scalarNode('geocoding_url_template')
  140.                             ->defaultValue('https://nominatim.openstreetmap.org/search?q={q}&addressdetails=1&format=json&limit=1')
  141.                         ->end()
  142.                         ->scalarNode('reverse_geocoding_url_template')
  143.                             ->defaultValue('https://nominatim.openstreetmap.org/reverse?format=json&lat={lat}&lon={lon}&addressdetails=1')
  144.                         ->end()
  145.                     ->end()
  146.                 ->end()
  147.             ->end();
  148.         $this->addGeneralNode($rootNode);
  149.         $this->addMaintenanceNode($rootNode);
  150.         $this->addServicesNode($rootNode);
  151.         $this->addObjectsNode($rootNode);
  152.         $this->addAssetNode($rootNode);
  153.         $this->addDocumentsNode($rootNode);
  154.         $this->addEncryptionNode($rootNode);
  155.         $this->addModelsNode($rootNode);
  156.         $this->addRoutingNode($rootNode);
  157.         $this->addCacheNode($rootNode);
  158.         $this->addContextNode($rootNode);
  159.         $this->addAdminNode($rootNode);
  160.         $this->addWebProfilerNode($rootNode);
  161.         $this->addSecurityNode($rootNode);
  162.         $this->addEmailNode($rootNode);
  163.         $this->addNewsletterNode($rootNode);
  164.         $this->addCustomReportsNode($rootNode);
  165.         $this->addMigrationsNode($rootNode);
  166.         $this->addTargetingNode($rootNode);
  167.         $this->addSitemapsNode($rootNode);
  168.         $this->addMimeNode($rootNode);
  169.         $this->addWorkflowNode($rootNode);
  170.         $this->addHttpClientNode($rootNode);
  171.         $this->addApplicationLogNode($rootNode);
  172.         return $treeBuilder;
  173.     }
  174.     /**
  175.      * Add maintenance config
  176.      *
  177.      * @param ArrayNodeDefinition $rootNode
  178.      */
  179.     private function addMaintenanceNode(ArrayNodeDefinition $rootNode)
  180.     {
  181.         $rootNode
  182.             ->children()
  183.             ->arrayNode('maintenance')
  184.             ->addDefaultsIfNotSet()
  185.             ->children()
  186.                 ->arrayNode('housekeeping')
  187.                 ->addDefaultsIfNotSet()
  188.                 ->children()
  189.                     ->integerNode('cleanup_tmp_files_atime_older_than')
  190.                         ->defaultValue(7776000// 90 days
  191.                     ->end()
  192.                     ->integerNode('cleanup_profiler_files_atime_older_than')
  193.                         ->defaultValue(1800)
  194.                     ->end()
  195.         ;
  196.     }
  197.     /**
  198.      * Add general config
  199.      *
  200.      * @param ArrayNodeDefinition $rootNode
  201.      */
  202.     private function addGeneralNode(ArrayNodeDefinition $rootNode)
  203.     {
  204.         $rootNode
  205.             ->children()
  206.             ->arrayNode('general')
  207.             ->ignoreExtraKeys()
  208.             ->addDefaultsIfNotSet()
  209.             ->children()
  210.                 ->scalarNode('timezone')
  211.                     ->defaultValue('Europe/Berlin')
  212.                 ->end()
  213.                 ->scalarNode('path_variable')
  214.                     ->defaultNull()
  215.                 ->end()
  216.                 ->scalarNode('domain')
  217.                     ->defaultNull()
  218.                 ->end()
  219.                 ->booleanNode('redirect_to_maindomain')
  220.                     ->beforeNormalization()
  221.                         ->ifString()
  222.                         ->then(function ($v) {
  223.                             return (bool)$v;
  224.                         })
  225.                     ->end()
  226.                     ->defaultFalse()
  227.                 ->end()
  228.                 ->scalarNode('language')
  229.                     ->defaultValue('en')
  230.                 ->end()
  231.                 ->scalarNode('valid_languages')
  232.                     ->defaultValue('en')
  233.                 ->end()
  234.                 ->arrayNode('fallback_languages')
  235.                     ->performNoDeepMerging()
  236.                     ->beforeNormalization()
  237.                     ->ifArray()
  238.                         ->then(function ($v) {
  239.                             return $v;
  240.                         })
  241.                     ->end()
  242.                     ->prototype('scalar')
  243.                     ->end()
  244.                 ->end()
  245.                 ->scalarNode('default_language')
  246.                     ->defaultValue('en')
  247.                 ->end()
  248.                 ->booleanNode('disable_usage_statistics')
  249.                     ->beforeNormalization()
  250.                         ->ifString()
  251.                         ->then(function ($v) {
  252.                             return (bool)$v;
  253.                         })
  254.                     ->end()
  255.                     ->defaultFalse()
  256.                 ->end()
  257.                 ->booleanNode('debug_admin_translations')
  258.                     ->beforeNormalization()
  259.                         ->ifString()
  260.                         ->then(function ($v) {
  261.                             return (bool)$v;
  262.                         })
  263.                     ->end()
  264.                     ->defaultFalse()
  265.                 ->end()
  266.                 ->scalarNode('instance_identifier')
  267.                     ->defaultNull()->end()
  268.                 ->booleanNode('show_cookie_notice')
  269.                     ->setDeprecated('The cookie bar will be removed in Pimcore 10')
  270.                     ->beforeNormalization()
  271.                         ->ifString()
  272.                         ->then(function ($v) {
  273.                             return (bool)$v;
  274.                         })
  275.                     ->end()
  276.                     ->defaultFalse()
  277.                 ->end()
  278.             ->end();
  279.     }
  280.     /**
  281.      * @param ArrayNodeDefinition $rootNode
  282.      */
  283.     private function addServicesNode(ArrayNodeDefinition $rootNode)
  284.     {
  285.         $rootNode
  286.             ->children()
  287.             ->arrayNode('services')
  288.                 ->children()
  289.                     ->arrayNode('google')
  290.                     ->children()
  291.                         ->scalarNode('client_id')
  292.                             ->defaultNull()
  293.                         ->end()
  294.                         ->scalarNode('email')
  295.                             ->defaultNull()
  296.                         ->end()
  297.                         ->scalarNode('simple_api_key')
  298.                             ->defaultNull()
  299.                         ->end()
  300.                         ->scalarNode('browser_api_key')
  301.                             ->defaultNull()
  302.                         ->end()
  303.                     ->end()
  304.                     ->end()
  305.                 ->end()
  306.             ->end()
  307.             ->arrayNode('webservice')
  308.                 ->canBeEnabled()
  309.             ->end();
  310.     }
  311.     /**
  312.      * @param ArrayNodeDefinition $rootNode
  313.      */
  314.     private function addModelsNode(ArrayNodeDefinition $rootNode)
  315.     {
  316.         $rootNode
  317.             ->children()
  318.                 ->arrayNode('models')
  319.                     ->addDefaultsIfNotSet()
  320.                     ->children()
  321.                         ->arrayNode('class_overrides')
  322.                             ->useAttributeAsKey('name')
  323.                             ->prototype('scalar');
  324.     }
  325.     /**
  326.      * @param ArrayNodeDefinition $rootNode
  327.      */
  328.     private function addHttpClientNode(ArrayNodeDefinition $rootNode)
  329.     {
  330.         $rootNode
  331.             ->children()
  332.                 ->arrayNode('httpclient')
  333.                 ->addDefaultsIfNotSet()
  334.                     ->children()
  335.                         ->scalarNode('adapter')
  336.                             ->defaultValue('Socket')
  337.                         ->end()
  338.                         ->scalarNode('proxy_host')
  339.                             ->defaultNull()
  340.                         ->end()
  341.                         ->scalarNode('proxy_port')
  342.                             ->defaultNull()
  343.                         ->end()
  344.                         ->scalarNode('proxy_user')
  345.                             ->defaultNull()
  346.                         ->end()
  347.                         ->scalarNode('proxy_pass')
  348.                             ->defaultNull()
  349.                         ->end()
  350.                     ->end()
  351.                 ->end()
  352.             ->end();
  353.     }
  354.     /**
  355.      * @param ArrayNodeDefinition $rootNode
  356.      */
  357.     private function addApplicationLogNode(ArrayNodeDefinition $rootNode)
  358.     {
  359.         $rootNode
  360.             ->children()
  361.                 ->arrayNode('applicationlog')
  362.                 ->addDefaultsIfNotSet()
  363.                     ->children()
  364.                         ->arrayNode('mail_notification')
  365.                             ->children()
  366.                                 ->booleanNode('send_log_summary')
  367.                                     ->beforeNormalization()
  368.                                         ->ifString()
  369.                                         ->then(function ($v) {
  370.                                             return (bool)$v;
  371.                                         })
  372.                                     ->end()
  373.                                     ->defaultFalse()
  374.                                 ->end()
  375.                                 ->scalarNode('filter_priority')
  376.                                     ->defaultNull()
  377.                                 ->end()
  378.                                 ->scalarNode('mail_receiver')
  379.                                 ->end()
  380.                             ->end()
  381.                         ->end()
  382.                         ->scalarNode('archive_treshold')
  383.                             ->defaultValue('')
  384.                         ->end()
  385.                         ->scalarNode('archive_alternative_database')
  386.                             ->defaultValue('')
  387.                         ->end()
  388.                     ->end()
  389.             ->end();
  390.     }
  391.     /**
  392.      * Add asset specific extension config
  393.      *
  394.      * @param ArrayNodeDefinition $rootNode
  395.      */
  396.     private function addAssetNode(ArrayNodeDefinition $rootNode)
  397.     {
  398.         $assetsNode $rootNode
  399.             ->children()
  400.                 ->arrayNode('assets')
  401.                 ->ignoreExtraKeys()
  402.                 ->addDefaultsIfNotSet()
  403.                 ->children()
  404.                     ->scalarNode('preview_image_thumbnail')
  405.                         ->defaultNull()
  406.                         ->end()
  407.                     ->scalarNode('default_upload_path')
  408.                         ->defaultValue('_default_upload_bucket')
  409.                         ->end()
  410.                     ->integerNode('tree_paging_limit')
  411.                         ->defaultValue(100)
  412.                         ->end()
  413.                     ->arrayNode('image')
  414.                         ->addDefaultsIfNotSet()
  415.                         ->children()
  416.                             ->arrayNode('low_quality_image_preview')
  417.                                 ->addDefaultsIfNotSet()
  418.                                 ->canBeDisabled()
  419.                                 ->children()
  420.                                     ->scalarNode('generator')
  421.                                     ->defaultNull()
  422.                                     ->end()
  423.                                 ->end()
  424.                             ->end()
  425.                             ->arrayNode('focal_point_detection')
  426.                                 ->addDefaultsIfNotSet()
  427.                                 ->canBeDisabled()
  428.                             ->end()
  429.                             ->arrayNode('thumbnails')
  430.                                 ->addDefaultsIfNotSet()
  431.                                 ->children()
  432.                                     ->booleanNode('webp_auto_support')
  433.                                         ->setDeprecated('The "%node%" option is deprecated and will be removed in Pimcore 10.')
  434.                                         ->beforeNormalization()
  435.                                             ->ifString()
  436.                                             ->then(function ($v) {
  437.                                                 return (bool)$v;
  438.                                             })
  439.                                         ->end()
  440.                                         ->defaultTrue()
  441.                                     ->end()
  442.                                     ->booleanNode('clip_auto_support')
  443.                                         ->beforeNormalization()
  444.                                             ->ifString()
  445.                                             ->then(function ($v) {
  446.                                                 return (bool)$v;
  447.                                             })
  448.                                         ->end()
  449.                                         ->defaultTrue()
  450.                                     ->end()
  451.                                     ->booleanNode('auto_clear_temp_files')
  452.                                         ->beforeNormalization()
  453.                                             ->ifString()
  454.                                             ->then(function ($v) {
  455.                                                 return (bool)$v;
  456.                                             })
  457.                                         ->end()
  458.                                         ->defaultTrue()
  459.                                     ->end()
  460.                                 ->end()
  461.                             ->end()
  462.                         ->end()
  463.                     ->end()
  464.                     ->arrayNode('video')
  465.                         ->addDefaultsIfNotSet()
  466.                         ->children()
  467.                             ->arrayNode('thumbnails')
  468.                                 ->addDefaultsIfNotSet()
  469.                                 ->children()
  470.                                     ->booleanNode('auto_clear_temp_files')
  471.                                     ->defaultTrue()
  472.                                     ->end()
  473.                                 ->end()
  474.                             ->end()
  475.                         ->end()
  476.                     ->end()
  477.                     ->arrayNode('versions')
  478.                         ->addDefaultsIfNotSet()
  479.                         ->children()
  480.                             ->scalarNode('days')
  481.                                 ->defaultNull()
  482.                             ->end()
  483.                             ->scalarNode('steps')
  484.                                 ->defaultNull()
  485.                             ->end()
  486.                             ->booleanNode('use_hardlinks')
  487.                                 ->beforeNormalization()
  488.                                     ->ifString()
  489.                                     ->then(function ($v) {
  490.                                         return (bool)$v;
  491.                                     })
  492.                                 ->end()
  493.                                 ->defaultTrue()
  494.                             ->end()
  495.                             ->booleanNode('disable_stack_trace')
  496.                                 ->beforeNormalization()
  497.                                     ->ifString()
  498.                                     ->then(function ($v) {
  499.                                         return (bool)$v;
  500.                                     })
  501.                                 ->end()
  502.                                 ->defaultFalse()
  503.                             ->end()
  504.                         ->end()
  505.                     ->end()
  506.                     ->scalarNode('icc_rgb_profile')
  507.                         ->defaultNull()
  508.                     ->end()
  509.                     ->scalarNode('icc_cmyk_profile')
  510.                         ->defaultNull()
  511.                     ->end()
  512.                     ->booleanNode('hide_edit_image')
  513.                         ->defaultFalse()
  514.                     ->end()
  515.                     ->booleanNode('disable_tree_preview')
  516.                         ->defaultTrue()
  517.                     ->end()
  518.                 ->end();
  519.         $assetsNode
  520.             ->children()
  521.                 ->arrayNode('metadata')
  522.                 ->addDefaultsIfNotSet()
  523.                     ->children()
  524.                         ->arrayNode('class_definitions')
  525.                             ->children()
  526.                                 ->arrayNode('data')
  527.                                     ->children()
  528.                                         ->arrayNode('map')
  529.                                             ->useAttributeAsKey('name')
  530.                                             ->prototype('scalar')->end()
  531.                                         ->end()
  532.                                         ->arrayNode('prefixes')
  533.                                             ->prototype('scalar')->end()
  534.                                         ->end()
  535.                                     ->end()
  536.                                 ->end()
  537.                             ->end()
  538.                         ->end();
  539.     }
  540.     /**
  541.      * Add object specific extension config
  542.      *
  543.      * @param ArrayNodeDefinition $rootNode
  544.      */
  545.     private function addObjectsNode(ArrayNodeDefinition $rootNode)
  546.     {
  547.         $objectsNode $rootNode
  548.             ->children()
  549.                 ->arrayNode('objects')
  550.                     ->ignoreExtraKeys()
  551.                     ->addDefaultsIfNotSet()
  552.                     ->children()
  553.                         ->integerNode('tree_paging_limit')
  554.                             ->defaultValue(30)
  555.                         ->end()
  556.                         ->arrayNode('versions')
  557.                             ->children()
  558.                                 ->scalarNode('days')->defaultNull()->end()
  559.                                 ->scalarNode('steps')->defaultNull()->end()
  560.                                 ->booleanNode('disable_stack_trace')
  561.                                     ->beforeNormalization()
  562.                                     ->ifString()
  563.                                         ->then(function ($v) {
  564.                                             return (bool)$v;
  565.                                         })
  566.                                     ->end()
  567.                                     ->defaultFalse()
  568.                                 ->end()
  569.                             ->end()
  570.                         ->end()
  571.                     ->end();
  572.         $classDefinitionsNode $objectsNode
  573.             ->children()
  574.                 ->arrayNode('class_definitions')
  575.                     ->addDefaultsIfNotSet();
  576.         $this->addImplementationLoaderNode($classDefinitionsNode'data');
  577.         $this->addImplementationLoaderNode($classDefinitionsNode'layout');
  578.     }
  579.     /**
  580.      * Add encryption specific extension config
  581.      *
  582.      * @param ArrayNodeDefinition $rootNode
  583.      */
  584.     private function addEncryptionNode(ArrayNodeDefinition $rootNode)
  585.     {
  586.         $encryptionNode $rootNode
  587.             ->children()
  588.             ->arrayNode('encryption')->addDefaultsIfNotSet();
  589.         $encryptionNode
  590.             ->children()
  591.             ->scalarNode('secret')->defaultNull();
  592.     }
  593.     /**
  594.      * Add document specific extension config
  595.      *
  596.      * @param ArrayNodeDefinition $rootNode
  597.      */
  598.     private function addDocumentsNode(ArrayNodeDefinition $rootNode)
  599.     {
  600.         $documentsNode $rootNode
  601.             ->children()
  602.                 ->arrayNode('documents')
  603.                     ->ignoreExtraKeys()
  604.                     ->addDefaultsIfNotSet();
  605.         $documentsNode
  606.             ->children()
  607.                 ->arrayNode('tags')
  608.                     ->setDeprecated('The "%node%" option is deprecated. Use "editables" instead.')
  609.                     ->addDefaultsIfNotSet()
  610.                     ->children()
  611.                         ->arrayNode('map')
  612.                             ->useAttributeAsKey('name')
  613.                             ->prototype('scalar')->end()
  614.                         ->end()
  615.                         ->arrayNode('prefixes')
  616.                             ->prototype('scalar')->end()
  617.                         ->end()
  618.                     ->end()
  619.                 ->end()
  620.                 ->arrayNode('versions')
  621.                     ->children()
  622.                         ->scalarNode('days')
  623.                             ->defaultNull()
  624.                         ->end()
  625.                         ->scalarNode('steps')
  626.                             ->defaultNull()
  627.                         ->end()
  628.                         ->booleanNode('disable_stack_trace')
  629.                             ->beforeNormalization()
  630.                             ->ifString()
  631.                                 ->then(function ($v) {
  632.                                     return (bool)$v;
  633.                                 })
  634.                             ->end()
  635.                             ->defaultFalse()
  636.                         ->end()
  637.                     ->end()
  638.                 ->end()
  639.                 ->scalarNode('default_controller')
  640.                     ->defaultValue('AppBundle\\Controller\\DefaultController::defaultAction')
  641.                 ->end()
  642.                 ->arrayNode('error_pages')
  643.                     ->children()
  644.                         ->scalarNode('default')
  645.                             ->defaultNull()
  646.                         ->end()
  647.                     ->end()
  648.                 ->end()
  649.                 ->booleanNode('create_redirect_when_moved')
  650.                     ->setDeprecated('The "%node%" option is deprecated and not used anymore, it is just there for compatibility.')
  651.                     ->beforeNormalization()
  652.                         ->ifString()
  653.                         ->then(function ($v) {
  654.                             return (bool)$v;
  655.                         })
  656.                     ->end()
  657.                     ->defaultFalse()
  658.                 ->end()
  659.                 ->scalarNode('allow_trailing_slash')
  660.                     ->defaultValue('no')
  661.                 ->end()
  662.                 ->booleanNode('generate_preview')
  663.                     ->beforeNormalization()
  664.                         ->ifString()
  665.                         ->then(function ($v) {
  666.                             return (bool)$v;
  667.                         })
  668.                     ->end()
  669.                     ->defaultFalse()
  670.                 ->end()
  671.                 ->integerNode('tree_paging_limit')
  672.                     ->defaultValue(50)
  673.                 ->end()
  674.                 ->arrayNode('editables')
  675.                     ->addDefaultsIfNotSet()
  676.                     ->children()
  677.                         ->arrayNode('map')
  678.                             ->useAttributeAsKey('name')
  679.                             ->prototype('scalar')->end()
  680.                         ->end()
  681.                         ->arrayNode('prefixes')
  682.                             ->prototype('scalar')->end()
  683.                         ->end()
  684.                         ->enumNode('naming_strategy')
  685.                             ->info('Sets naming strategy used to build editable names')
  686.                             ->values(['legacy''nested'])
  687.                             ->defaultValue('nested')
  688.                             ->setDeprecated('The "%node%" option is deprecated. Migrate to the new editable naming scheme!')
  689.                         ->end()
  690.                     ->end()
  691.                 ->end()
  692.                 ->arrayNode('areas')
  693.                     ->addDefaultsIfNotSet()
  694.                     ->children()
  695.                         ->booleanNode('autoload')
  696.                             ->beforeNormalization()
  697.                                 ->ifString()
  698.                                 ->then(function ($v) {
  699.                                     return (bool)$v;
  700.                                 })
  701.                             ->end()
  702.                             ->defaultTrue()
  703.                         ->end()
  704.                     ->end()
  705.                 ->end()
  706.                 ->arrayNode('newsletter')
  707.                     ->addDefaultsIfNotSet()
  708.                     ->children()
  709.                         ->scalarNode('defaultUrlPrefix')
  710.                             ->defaultNull()
  711.                         ->end()
  712.                     ->end()
  713.                 ->end()
  714.                 ->arrayNode('web_to_print')
  715.                     ->addDefaultsIfNotSet()
  716.                         ->children()
  717.                             ->scalarNode('pdf_creation_php_memory_limit')
  718.                             ->defaultValue('2048M')
  719.                         ->end()
  720.                     ->end()
  721.                 ->end()
  722.             ->end();
  723.     }
  724.     /**
  725.      * Add implementation node config (map, prefixes)
  726.      *
  727.      * @param ArrayNodeDefinition $node
  728.      * @param string $name
  729.      */
  730.     private function addImplementationLoaderNode(ArrayNodeDefinition $node$name)
  731.     {
  732.         $node
  733.             ->children()
  734.                 ->arrayNode($name)
  735.                     ->addDefaultsIfNotSet()
  736.                     ->children()
  737.                         ->arrayNode('map')
  738.                             ->useAttributeAsKey('name')
  739.                             ->prototype('scalar')->end()
  740.                         ->end()
  741.                         ->arrayNode('prefixes')
  742.                             ->prototype('scalar')->end()
  743.                         ->end()
  744.                     ->end()
  745.                 ->end()
  746.             ->end();
  747.     }
  748.     private function addRoutingNode(ArrayNodeDefinition $rootNode)
  749.     {
  750.         $rootNode
  751.             ->children()
  752.                 ->arrayNode('routing')
  753.                     ->addDefaultsIfNotSet()
  754.                     ->children()
  755.                         ->arrayNode('defaults')
  756.                             ->addDefaultsIfNotSet()
  757.                             ->setDeprecated('The "%node%" option is deprecated. Use pimcore.documents.default_controller instead.')
  758.                             ->children()
  759.                                 ->scalarNode('bundle')
  760.                                     ->defaultValue('AppBundle')
  761.                                 ->end()
  762.                                 ->scalarNode('controller')
  763.                                     ->defaultValue('Default')
  764.                                 ->end()
  765.                                 ->scalarNode('action')
  766.                                     ->defaultValue('default')
  767.                                 ->end()
  768.                             ->end()
  769.                         ->end()
  770.                         ->arrayNode('static')
  771.                             ->addDefaultsIfNotSet()
  772.                             ->children()
  773.                                 ->arrayNode('locale_params')
  774.                                     ->info('Route params from this list will be mapped to _locale if _locale is not set explicitely')
  775.                                     ->prototype('scalar')
  776.                                     ->defaultValue([])
  777.                                 ->end()
  778.                             ->end()
  779.                         ->end()
  780.                     ->end()
  781.                 ->end();
  782.     }
  783.     /**
  784.      * Add context config
  785.      *
  786.      * @param ArrayNodeDefinition $rootNode
  787.      */
  788.     private function addContextNode(ArrayNodeDefinition $rootNode)
  789.     {
  790.         $contextNode $rootNode->children()
  791.             ->arrayNode('context')
  792.             ->useAttributeAsKey('name');
  793.         /** @var ArrayNodeDefinition|NodeDefinition $prototype */
  794.         $prototype $contextNode->prototype('array');
  795.         // define routes child on each context entry
  796.         $this->addRoutesChild($prototype'routes');
  797.     }
  798.     /**
  799.      * Add admin config
  800.      *
  801.      * @param ArrayNodeDefinition $rootNode
  802.      */
  803.     private function addAdminNode(ArrayNodeDefinition $rootNode)
  804.     {
  805.         $adminNode $rootNode->children()
  806.             ->arrayNode('admin')
  807.             ->ignoreExtraKeys()
  808.             ->addDefaultsIfNotSet();
  809.         // add session attribute bag config
  810.         $this->addAdminSessionAttributeBags($adminNode);
  811.         // unauthenticated routes won't be double checked for authentication in AdminControllerListener
  812.         $this->addRoutesChild($adminNode'unauthenticated_routes');
  813.         $adminNode
  814.             ->children()
  815.                 ->arrayNode('translations')
  816.                     ->addDefaultsIfNotSet()
  817.                     ->children()
  818.                         ->scalarNode('path')->defaultNull()->end()
  819.                     ->end()
  820.                 ->end()
  821.             ->end();
  822.     }
  823.     /**
  824.      * @param ArrayNodeDefinition $adminNode
  825.      */
  826.     private function addAdminSessionAttributeBags(ArrayNodeDefinition $adminNode)
  827.     {
  828.         // Normalizes session bag config. Allows the following formats (all formats will be
  829.         // normalized to the third format.
  830.         //
  831.         // attribute_bags:
  832.         //      - foo
  833.         //      - bar
  834.         //
  835.         // attribute_bags:
  836.         //      foo: _foo
  837.         //      bar: _bar
  838.         //
  839.         // attribute_bags:
  840.         //      foo:
  841.         //          storage_key: _foo
  842.         //      bar:
  843.         //          storage_key: _bar
  844.         $normalizers = [
  845.             'assoc' => function (array $array) {
  846.                 $result = [];
  847.                 foreach ($array as $name => $value) {
  848.                     if (null === $value) {
  849.                         $value = [
  850.                             'storage_key' => '_' $name,
  851.                         ];
  852.                     }
  853.                     if (is_string($value)) {
  854.                         $value = [
  855.                             'storage_key' => $value,
  856.                         ];
  857.                     }
  858.                     $result[$name] = $value;
  859.                 }
  860.                 return $result;
  861.             },
  862.             'sequential' => function (array $array) {
  863.                 $result = [];
  864.                 foreach ($array as $name) {
  865.                     $result[$name] = [
  866.                         'storage_key' => '_' $name,
  867.                     ];
  868.                 }
  869.                 return $result;
  870.             },
  871.         ];
  872.         $adminNode
  873.             ->children()
  874.                 ->arrayNode('session')
  875.                     ->addDefaultsIfNotSet()
  876.                     ->children()
  877.                         ->arrayNode('attribute_bags')
  878.                             ->useAttributeAsKey('name')
  879.                             ->beforeNormalization()
  880.                                 ->ifArray()->then(function ($v) use ($normalizers) {
  881.                                     if (isAssocArray($v)) {
  882.                                         return $normalizers['assoc']($v);
  883.                                     } else {
  884.                                         return $normalizers['sequential']($v);
  885.                                     }
  886.                                 })
  887.                             ->end()
  888.                             ->example([
  889.                                 ['foo''bar'],
  890.                                 [
  891.                                     'foo' => '_foo',
  892.                                     'bar' => '_bar',
  893.                                 ],
  894.                                 [
  895.                                     'foo' => [
  896.                                         'storage_key' => '_foo',
  897.                                     ],
  898.                                     'bar' => [
  899.                                         'storage_key' => '_bar',
  900.                                     ],
  901.                                 ],
  902.                             ])
  903.                             ->prototype('array')
  904.                                 ->children()
  905.                                     ->scalarNode('storage_key')
  906.                                         ->defaultNull()
  907.                                     ->end()
  908.                                 ->end()
  909.                             ->end()
  910.                         ->end()
  911.                     ->end()
  912.                 ->end()
  913.             ->end();
  914.     }
  915.     private function addSecurityNode(ArrayNodeDefinition $rootNode)
  916.     {
  917.         $rootNode
  918.             ->children()
  919.                 ->arrayNode('security')
  920.                     ->addDefaultsIfNotSet()
  921.                     ->children()
  922.                         ->arrayNode('encoder_factories')
  923.                             ->info('Encoder factories to use as className => factory service ID mapping')
  924.                             ->example([
  925.                                 'AppBundle\Model\DataObject\User1' => [
  926.                                     'id' => 'website_demo.security.encoder_factory2',
  927.                                 ],
  928.                                 'AppBundle\Model\DataObject\User2' => 'website_demo.security.encoder_factory2',
  929.                             ])
  930.                             ->useAttributeAsKey('class')
  931.                             ->prototype('array')
  932.                             ->beforeNormalization()->ifString()->then(function ($v) {
  933.                                 return ['id' => $v];
  934.                             })->end()
  935.                             ->children()
  936.                                 ->scalarNode('id')->end()
  937.                             ->end()
  938.                         ->end()
  939.                     ->end()
  940.                 ->end()
  941.             ->end()
  942.         ;
  943.     }
  944.     /**
  945.      * Configure exclude paths for web profiler toolbar
  946.      *
  947.      * @param ArrayNodeDefinition $rootNode
  948.      */
  949.     private function addWebProfilerNode(ArrayNodeDefinition $rootNode)
  950.     {
  951.         $webProfilerNode $rootNode->children()
  952.             ->arrayNode('web_profiler')
  953.                 ->example([
  954.                     'toolbar' => [
  955.                         'excluded_routes' => [
  956.                             ['path' => '^/test/path'],
  957.                         ],
  958.                     ],
  959.                 ])
  960.                 ->addDefaultsIfNotSet();
  961.         $toolbarNode $webProfilerNode->children()
  962.             ->arrayNode('toolbar')
  963.                 ->addDefaultsIfNotSet();
  964.         $this->addRoutesChild($toolbarNode'excluded_routes');
  965.     }
  966.     /**
  967.      * Add a route prototype child
  968.      *
  969.      * @param ArrayNodeDefinition $parent
  970.      * @param string $name
  971.      */
  972.     private function addRoutesChild(ArrayNodeDefinition $parent$name)
  973.     {
  974.         $node $parent->children()->arrayNode($name);
  975.         /** @var ArrayNodeDefinition|NodeDefinition $prototype */
  976.         $prototype $node->prototype('array');
  977.         $prototype
  978.             ->beforeNormalization()
  979.                 ->ifNull()->then(function () {
  980.                     return [];
  981.                 })
  982.             ->end()
  983.             ->children()
  984.                 ->scalarNode('path')->defaultFalse()->end()
  985.                 ->scalarNode('route')->defaultFalse()->end()
  986.                 ->scalarNode('host')->defaultFalse()->end()
  987.                 ->arrayNode('methods')
  988.                     ->prototype('scalar')->end()
  989.                 ->end()
  990.             ->end();
  991.     }
  992.     /**
  993.      * Add cache config
  994.      *
  995.      * @param ArrayNodeDefinition $rootNode
  996.      */
  997.     private function addCacheNode(ArrayNodeDefinition $rootNode)
  998.     {
  999.         $defaultOptions ConnectionFactory::getDefaultOptions();
  1000.         $rootNode->children()
  1001.             ->arrayNode('full_page_cache')
  1002.                 ->ignoreExtraKeys()
  1003.                 ->canBeDisabled()
  1004.                 ->addDefaultsIfNotSet()
  1005.                 ->children()
  1006.                     ->scalarNode('lifetime')
  1007.                         ->defaultNull()
  1008.                     ->end()
  1009.                     ->scalarNode('exclude_patterns')->end()
  1010.                     ->scalarNode('exclude_cookie')->end()
  1011.                 ->end()
  1012.             ->end()
  1013.             ->arrayNode('cache')
  1014.                 ->ignoreExtraKeys()
  1015.                 ->addDefaultsIfNotSet()
  1016.                 ->children()
  1017.                     ->scalarNode('pool_service_id')
  1018.                         ->defaultValue(null)
  1019.                     ->end()
  1020.                     ->integerNode('default_lifetime')
  1021.                         ->defaultValue(2419200// 28 days
  1022.                     ->end()
  1023.                     ->arrayNode('pools')
  1024.                         ->addDefaultsIfNotSet()
  1025.                         ->children()
  1026.                             ->arrayNode('doctrine')
  1027.                                 ->canBeDisabled()
  1028.                                 ->children()
  1029.                                     ->scalarNode('connection')
  1030.                                         ->defaultValue('default')
  1031.                                     ->end()
  1032.                                 ->end()
  1033.                             ->end()
  1034.                             ->arrayNode('redis')
  1035.                                 ->canBeEnabled()
  1036.                                 ->children()
  1037.                                     ->arrayNode('connection')
  1038.                                         ->info('Redis connection options. See ' ConnectionFactory::class)
  1039.                                         ->children()
  1040.                                             ->scalarNode('server')->end()
  1041.                                             ->integerNode('port')
  1042.                                                 ->defaultValue($defaultOptions['port'])
  1043.                                             ->end()
  1044.                                             ->scalarNode('database')
  1045.                                                 ->defaultValue($defaultOptions['database'])
  1046.                                             ->end()
  1047.                                             ->scalarNode('password')
  1048.                                                 ->defaultValue($defaultOptions['password'])
  1049.                                             ->end()
  1050.                                             ->scalarNode('persistent')
  1051.                                                 ->defaultValue($defaultOptions['persistent'])
  1052.                                             ->end()
  1053.                                             ->booleanNode('force_standalone')
  1054.                                                 ->defaultValue($defaultOptions['force_standalone'])
  1055.                                             ->end()
  1056.                                             ->integerNode('connect_retries')
  1057.                                                 ->defaultValue($defaultOptions['connect_retries'])
  1058.                                             ->end()
  1059.                                             ->floatNode('timeout')
  1060.                                                 ->defaultValue($defaultOptions['timeout'])
  1061.                                             ->end()
  1062.                                             ->floatNode('read_timeout')
  1063.                                                 ->defaultValue($defaultOptions['read_timeout'])
  1064.                                             ->end()
  1065.                                         ->end()
  1066.                                     ->end()
  1067.                                     ->arrayNode('options')
  1068.                                         ->info('Redis cache pool options. See ' Redis::class)
  1069.                                         ->children()
  1070.                                             ->booleanNode('notMatchingTags')->end()
  1071.                                             ->integerNode('compress_tags')->end()
  1072.                                             ->integerNode('compress_data')->end()
  1073.                                             ->integerNode('compress_threshold')->end()
  1074.                                             ->scalarNode('compression_lib')->end()
  1075.                                             ->booleanNode('use_lua')->end()
  1076.                                             ->integerNode('lua_max_c_stack')->end()
  1077.                                         ->end()
  1078.                                     ->end()
  1079.                                 ->end()
  1080.                             ->end()
  1081.                         ->end()
  1082.                     ->end()
  1083.                 ->end();
  1084.     }
  1085.     /**
  1086.      * Adds configuration for email source adapters
  1087.      *
  1088.      * @param ArrayNodeDefinition $rootNode
  1089.      */
  1090.     private function addEmailNode(ArrayNodeDefinition $rootNode)
  1091.     {
  1092.         $rootNode
  1093.             ->children()
  1094.                 ->arrayNode('email')
  1095.                 ->addDefaultsIfNotSet()
  1096.                     ->children()
  1097.                         ->arrayNode('sender')
  1098.                             ->children()
  1099.                                 ->scalarNode('name')->end()
  1100.                                 ->scalarNode('email')->end()
  1101.                             ->end()
  1102.                         ->end()
  1103.                         ->arrayNode('return')
  1104.                             ->children()
  1105.                                 ->scalarNode('name')->end()
  1106.                                 ->scalarNode('email')->end()
  1107.                             ->end()
  1108.                         ->end()
  1109.                         ->scalarNode('method')
  1110.                             ->defaultNull()
  1111.                         ->end()
  1112.                         ->arrayNode('debug')
  1113.                             ->children()
  1114.                                 ->scalarNode('email_addresses')
  1115.                                     ->defaultValue('')
  1116.                                 ->end()
  1117.                             ->end()
  1118.                         ->end()
  1119.                         ->scalarNode('usespecific')
  1120.                         ->end()
  1121.                     ->end()
  1122.                 ->end()
  1123.             ->end();
  1124.     }
  1125.     /**
  1126.      * Adds configuration tree for newsletter source adapters
  1127.      *
  1128.      * @param ArrayNodeDefinition $rootNode
  1129.      */
  1130.     private function addNewsletterNode(ArrayNodeDefinition $rootNode)
  1131.     {
  1132.         $rootNode
  1133.             ->children()
  1134.                 ->arrayNode('newsletter')
  1135.                     ->addDefaultsIfNotSet()
  1136.                     ->children()
  1137.                         ->arrayNode('sender')
  1138.                             ->children()
  1139.                                 ->scalarNode('name')->end()
  1140.                                 ->scalarNode('email')->end()
  1141.                             ->end()
  1142.                         ->end()
  1143.                         ->arrayNode('return')
  1144.                             ->children()
  1145.                                 ->scalarNode('name')->end()
  1146.                                 ->scalarNode('email')->end()
  1147.                             ->end()
  1148.                         ->end()
  1149.                         ->scalarNode('method')
  1150.                             ->defaultNull()
  1151.                         ->end()
  1152.                         ->arrayNode('debug')
  1153.                             ->children()
  1154.                                 ->scalarNode('email_addresses')
  1155.                                     ->defaultValue('')
  1156.                                 ->end()
  1157.                             ->end()
  1158.                         ->end()
  1159.                         ->booleanNode('use_specific')
  1160.                             ->beforeNormalization()
  1161.                                 ->ifString()
  1162.                                 ->then(function ($v) {
  1163.                                     return (bool)$v;
  1164.                                 })
  1165.                             ->end()
  1166.                         ->end()
  1167.                         ->arrayNode('source_adapters')
  1168.                             ->useAttributeAsKey('name')
  1169.                                 ->prototype('scalar')
  1170.                             ->end()
  1171.                         ->end()
  1172.                     ->end()
  1173.                 ->end()
  1174.             ->end();
  1175.     }
  1176.     /**
  1177.      * Adds configuration tree for custom report adapters
  1178.      *
  1179.      * @param ArrayNodeDefinition $rootNode
  1180.      */
  1181.     private function addCustomReportsNode(ArrayNodeDefinition $rootNode)
  1182.     {
  1183.         $rootNode
  1184.             ->children()
  1185.                 ->arrayNode('custom_report')
  1186.                     ->addDefaultsIfNotSet()
  1187.                     ->children()
  1188.                         ->arrayNode('adapters')
  1189.                             ->useAttributeAsKey('name')
  1190.                                 ->prototype('scalar')
  1191.                             ->end()
  1192.                         ->end()
  1193.                     ->end()
  1194.                 ->end()
  1195.             ->end();
  1196.     }
  1197.     /**
  1198.      * Adds configuration tree node for migrations
  1199.      *
  1200.      * @param ArrayNodeDefinition $rootNode
  1201.      */
  1202.     private function addMigrationsNode(ArrayNodeDefinition $rootNode)
  1203.     {
  1204.         $rootNode
  1205.             ->children()
  1206.                 ->arrayNode('migrations')
  1207.                     ->setDeprecated('The "%node%" option is deprecated and will be removed in Pimcore 10')
  1208.                     ->addDefaultsIfNotSet()
  1209.                     ->children()
  1210.                         ->arrayNode('sets')
  1211.                             ->useAttributeAsKey('identifier')
  1212.                             ->defaultValue([])
  1213.                             ->info('Migration sets which can be used apart from bundle migrations. Use the -s option in migration commands to select a specific set.')
  1214.                             ->example([
  1215.                                 [
  1216.                                     'custom_set' => [
  1217.                                         'name' => 'Custom Migrations',
  1218.                                         'namespace' => 'App\\Migrations\\Custom',
  1219.                                         'directory' => 'src/App/Migrations/Custom',
  1220.                                     ],
  1221.                                     'custom_set_2' => [
  1222.                                         'name' => 'Custom Migrations 2',
  1223.                                         'namespace' => 'App\\Migrations\\Custom2',
  1224.                                         'directory' => 'src/App/Migrations/Custom2',
  1225.                                         'connection' => 'custom_connection',
  1226.                                     ],
  1227.                                 ],
  1228.                             ])
  1229.                             ->prototype('array')
  1230.                                 ->children()
  1231.                                     ->scalarNode('identifier')->end()
  1232.                                     ->scalarNode('name')
  1233.                                         ->isRequired()
  1234.                                         ->cannotBeEmpty()
  1235.                                     ->end()
  1236.                                     ->scalarNode('namespace')
  1237.                                         ->isRequired()
  1238.                                         ->cannotBeEmpty()
  1239.                                     ->end()
  1240.                                     ->scalarNode('directory')
  1241.                                         ->isRequired()
  1242.                                         ->cannotBeEmpty()
  1243.                                     ->end()
  1244.                                     ->scalarNode('connection')
  1245.                                         ->info('If defined, the DBAL connection defined here will be used')
  1246.                                         ->defaultNull()
  1247.                                         ->beforeNormalization()
  1248.                                             ->ifTrue(function ($v) {
  1249.                                                 return empty(trim($v));
  1250.                                             })
  1251.                                             ->then(function () {
  1252.                                                 return null;
  1253.                                             })
  1254.                                         ->end()
  1255.                                     ->end()
  1256.                                 ->end()
  1257.                             ->end()
  1258.                         ->end()
  1259.                     ->end()
  1260.                 ->end()
  1261.             ->end();
  1262.     }
  1263.     private function addTargetingNode(ArrayNodeDefinition $rootNode)
  1264.     {
  1265.         $rootNode
  1266.             ->children()
  1267.                 ->arrayNode('targeting')
  1268.                     ->canBeDisabled()
  1269.                     ->addDefaultsIfNotSet()
  1270.                     ->children()
  1271.                         ->scalarNode('storage_id')
  1272.                             ->info('Service ID of the targeting storage which should be used. This ID will be aliased to ' TargetingStorageInterface::class)
  1273.                             ->defaultValue(CookieStorage::class)
  1274.                             ->cannotBeEmpty()
  1275.                         ->end()
  1276.                         ->arrayNode('session')
  1277.                             ->info('Enables HTTP session support by configuring session bags and the full page cache')
  1278.                             ->canBeEnabled()
  1279.                         ->end()
  1280.                         ->arrayNode('data_providers')
  1281.                             ->useAttributeAsKey('key')
  1282.                                 ->prototype('scalar')
  1283.                             ->end()
  1284.                         ->end()
  1285.                         ->arrayNode('conditions')
  1286.                             ->useAttributeAsKey('key')
  1287.                                 ->prototype('scalar')
  1288.                             ->end()
  1289.                         ->end()
  1290.                         ->arrayNode('action_handlers')
  1291.                             ->useAttributeAsKey('name')
  1292.                                 ->prototype('scalar')
  1293.                             ->end()
  1294.                         ->end()
  1295.                     ->end()
  1296.                 ->end()
  1297.             ->end();
  1298.     }
  1299.     private function addSitemapsNode(ArrayNodeDefinition $rootNode)
  1300.     {
  1301.         $rootNode
  1302.             ->children()
  1303.                 ->arrayNode('sitemaps')
  1304.                     ->addDefaultsIfNotSet()
  1305.                     ->children()
  1306.                         ->arrayNode('generators')
  1307.                             ->useAttributeAsKey('name')
  1308.                             ->prototype('array')
  1309.                                 ->beforeNormalization()
  1310.                                     ->ifString()
  1311.                                     ->then(function ($v) {
  1312.                                         return [
  1313.                                             'enabled' => true,
  1314.                                             'generator_id' => $v,
  1315.                                             'priority' => 0,
  1316.                                         ];
  1317.                                     })
  1318.                                 ->end()
  1319.                                 ->addDefaultsIfNotSet()
  1320.                                 ->canBeDisabled()
  1321.                                 ->children()
  1322.                                     ->scalarNode('generator_id')
  1323.                                         ->cannotBeEmpty()
  1324.                                     ->end()
  1325.                                     ->integerNode('priority')
  1326.                                         ->defaultValue(0)
  1327.                                     ->end()
  1328.                                 ->end()
  1329.                             ->end()
  1330.                         ->end()
  1331.                     ->end()
  1332.                 ->end()
  1333.             ->end()
  1334.         ->end();
  1335.     }
  1336.     /**
  1337.      * @deprecated
  1338.      *
  1339.      * @param ArrayNodeDefinition $rootNode
  1340.      */
  1341.     private function addMimeNode(ArrayNodeDefinition $rootNode)
  1342.     {
  1343.         $rootNode
  1344.             ->children()
  1345.                 ->arrayNode('mime')
  1346.                     ->addDefaultsIfNotSet()
  1347.                     ->setDeprecated('The "%node%" option is deprecated and will be removed in Pimcore 10.')
  1348.                     ->children()
  1349.                         ->arrayNode('extensions')
  1350.                             ->useAttributeAsKey('name')
  1351.                             ->prototype('scalar')
  1352.                         ->end()
  1353.                     ->end()
  1354.                 ->end()
  1355.             ->end()
  1356.         ->end();
  1357.     }
  1358.     private function addWorkflowNode(ArrayNodeDefinition $rootNode)
  1359.     {
  1360.         $rootNode
  1361.             ->children()
  1362.                  ->arrayNode('workflows')
  1363.                         ->useAttributeAsKey('name')
  1364.                         ->prototype('array')
  1365.                             ->children()
  1366.                                 ->arrayNode('placeholders')
  1367.                                     ->info('Placeholder values in this workflow configuration (locale: "%%locale%%") will be replaced by the given placeholder value (eg. "de_AT")')
  1368.                                     ->example([
  1369.                                         'placeholders' => [
  1370.                                             '%%locale%%' => 'de_AT',
  1371.                                         ],
  1372.                                     ])
  1373.                                     ->defaultValue([])
  1374.                                     ->beforeNormalization()
  1375.                                         ->castToArray()
  1376.                                         ->always()
  1377.                                         ->then(function ($placeholders) {
  1378.                                             $this->placeholders $placeholders;
  1379.                                             return $placeholders;
  1380.                                         })
  1381.                                     ->end()
  1382.                                     ->prototype('scalar')->end()
  1383.                                 ->end()
  1384.                                 ->booleanNode('enabled')
  1385.                                     ->defaultTrue()
  1386.                                     ->info('Can be used to enable or disable the workflow.')
  1387.                                 ->end()
  1388.                                 ->integerNode('priority')
  1389.                                     ->defaultValue(0)
  1390.                                     ->info('When multiple custom view or permission settings from different places in different workflows are valid, the workflow with the highest priority will be used.')
  1391.                                 ->end()
  1392.                                 ->scalarNode('label')
  1393.                                     ->info('Will be used in the backend interface as nice name for the workflow. If not set the technical workflow name will be used as label too.')
  1394.                                 ->end()
  1395.                                 ->arrayNode('audit_trail')
  1396.                                     ->canBeEnabled()
  1397.                                     ->info('Enable default audit trail feature provided by Symfony. Take a look at the Symfony docs for more details.')
  1398.                                 ->end()
  1399.                                 ->enumNode('type')
  1400.                                     ->values(['workflow''state_machine'])
  1401.                                     ->info('A workflow with type "workflow" can handle multiple places at one time whereas a state_machine provides a finite state_machine (only one place at one time). Take a look at the Symfony docs for more details.')
  1402.                                 ->end()
  1403.                                 ->arrayNode('marking_store')
  1404.                                     ->fixXmlConfig('argument')
  1405.                                     ->children()
  1406.                                         ->enumNode('type')
  1407.                                             ->values(['multiple_state''single_state''state_table''data_object_multiple_state''data_object_splitted_state'])
  1408.                                         ->end()
  1409.                                         ->arrayNode('arguments')
  1410.                                             ->beforeNormalization()
  1411.                                                 ->always()
  1412.                                                 ->then(function ($arguments) {
  1413.                                                     if (is_string($arguments)) {
  1414.                                                         $arguments = [$arguments];
  1415.                                                     }
  1416.                                                     if (!empty($this->placeholders)) {
  1417.                                                         $arguments $this->placeholderProcessor->mergePlaceholders($arguments$this->placeholders);
  1418.                                                     }
  1419.                                                     return $arguments;
  1420.                                                 })
  1421.                                             ->end()
  1422.                                             ->requiresAtLeastOneElement()
  1423.                                             ->prototype('variable')
  1424.                                             ->end()
  1425.                                         ->end()
  1426.                                         ->scalarNode('service')
  1427.                                             ->cannotBeEmpty()
  1428.                                         ->end()
  1429.                                     ->end()
  1430.                                     ->info('Handles the way how the state/place is stored. If not defined "state_table" will be used as default. Take a look at @TODO for a description of the different types.')
  1431.                                     ->validate()
  1432.                                         ->ifTrue(function ($v) {
  1433.                                             return isset($v['type']) && isset($v['service']);
  1434.                                         })
  1435.                                         ->thenInvalid('"type" and "service" cannot be used together.')
  1436.                                     ->end()
  1437.                                     ->validate()
  1438.                                         ->ifTrue(function ($v) {
  1439.                                             return !empty($v['arguments']) && isset($v['service']);
  1440.                                         })
  1441.                                         ->thenInvalid('"arguments" and "service" cannot be used together.')
  1442.                                     ->end()
  1443.                                 ->end()
  1444.                                 ->arrayNode('supports')
  1445.                                     ->beforeNormalization()
  1446.                                         ->ifString()
  1447.                                         ->then(function ($v) {
  1448.                                             return [$v];
  1449.                                         })
  1450.                                     ->end()
  1451.                                     ->prototype('scalar')
  1452.                                         ->cannotBeEmpty()
  1453.                                     ->end()
  1454.                                     ->info('List of supported entity classes. Take a look at the Symfony docs for more details.')
  1455.                                     ->example(['\Pimcore\Model\DataObject\Product'])
  1456.                                 ->end()
  1457.                                 ->arrayNode('support_strategy')
  1458.                                     ->fixXmlConfig('argument')
  1459.                                     ->children()
  1460.                                         ->enumNode('type')
  1461.                                             ->values(['expression'])
  1462.                                             ->info('Type "expression": a symfony expression to define a criteria.')
  1463.                                         ->end()
  1464.                                         ->arrayNode('arguments')
  1465.                                             ->beforeNormalization()
  1466.                                                 ->ifString()
  1467.                                                 ->then(function ($v) {
  1468.                                                     return [$v];
  1469.                                                 })
  1470.                                             ->end()
  1471.                                             ->requiresAtLeastOneElement()
  1472.                                             ->prototype('variable')
  1473.                                             ->end()
  1474.                                         ->end()
  1475.                                         ->scalarNode('service')
  1476.                                             ->cannotBeEmpty()
  1477.                                             ->info('Define a custom service to handle the logic. Take a look at the Symfony docs for more details.')
  1478.                                         ->end()
  1479.                                     ->end()
  1480.                                     ->validate()
  1481.                                         ->ifTrue(function ($v) {
  1482.                                             return isset($v['type']) && isset($v['service']);
  1483.                                         })
  1484.                                         ->thenInvalid('"type" and "service" cannot be used together.')
  1485.                                     ->end()
  1486.                                     ->validate()
  1487.                                         ->ifTrue(function ($v) {
  1488.                                             return !empty($v['arguments']) && isset($v['service']);
  1489.                                         })
  1490.                                         ->thenInvalid('"arguments" and "service" cannot be used together.')
  1491.                                     ->end()
  1492.                                     ->info('Can be used to implement a special logic which subjects are supported by the workflow. For example only products matching certain criteria.')
  1493.                                     ->example([
  1494.                                         'type' => 'expression',
  1495.                                         'arguments' => [
  1496.                                             '\Pimcore\Model\DataObject\Product',
  1497.                                             'subject.getProductType() == "article" and is_fully_authenticated() and "ROLE_PIMCORE_ADMIN" in roles',
  1498.                                         ],
  1499.                                     ])
  1500.                                 ->end()
  1501.                                 ->scalarNode('initial_place')
  1502.                                     ->defaultNull()
  1503.                                     ->setDeprecated('The "%node%" option is deprecated. Use "initial_markings" instead.')
  1504.                                     ->info('Will be applied when the current place is empty.')
  1505.                                 ->end()
  1506.                                 ->arrayNode('initial_markings')
  1507.                                     ->info('Can be used to set the initial places (markings) for a workflow. Note that this option is Symfony 4.3+ only')
  1508.                                     ->beforeNormalization()
  1509.                                         ->ifString()
  1510.                                             ->then(function ($v) {
  1511.                                                 return [$v];
  1512.                                             })
  1513.                                         ->end()
  1514.                                         ->requiresAtLeastOneElement()
  1515.                                         ->prototype('scalar')
  1516.                                         ->cannotBeEmpty()
  1517.                                     ->end()
  1518.                                 ->end()
  1519.                                 ->arrayNode('places')
  1520.                                     ->prototype('array')
  1521.                                         ->children()
  1522.                                             ->scalarNode('label')->info('Nice name which will be used in the Pimcore backend.')->end()
  1523.                                             ->scalarNode('title')->info('Title/tooltip for this place when it is displayed in the header of the Pimcore element detail view in the backend.')->defaultValue('')->end()
  1524.                                             ->scalarNode('color')->info('Color of the place which will be used in the Pimcore backend.')->defaultValue('#bfdadc')->end()
  1525.                                             ->booleanNode('colorInverted')->info('If set to true the color will be used as border and font color otherwise as background color.')->defaultFalse()->end()
  1526.                                             ->booleanNode('visibleInHeader')->info('If set to false, the place will be hidden in the header of the Pimcore element detail view in the backend.')->defaultTrue()->end()
  1527.                                             ->arrayNode('permissions')
  1528.                                                 ->prototype('array')
  1529.                                                     ->children()
  1530.                                                         ->scalarNode('condition')->info('A symfony expression can be configured here. The first set of permissions which are matching the condition will be used.')->end()
  1531.                                                         ->booleanNode('save')->info('save permission as it can be configured in Pimcore workplaces')->end()
  1532.                                                         ->booleanNode('publish')->info('publish permission as it can be configured in Pimcore workplaces')->end()
  1533.                                                         ->booleanNode('unpublish')->info('unpublish permission as it can be configured in Pimcore workplaces')->end()
  1534.                                                         ->booleanNode('delete')->info('delete permission as it can be configured in Pimcore workplaces')->end()
  1535.                                                         ->booleanNode('rename')->info('rename permission as it can be configured in Pimcore workplaces')->end()
  1536.                                                         ->booleanNode('view')->info('view permission as it can be configured in Pimcore workplaces')->end()
  1537.                                                         ->booleanNode('settings')->info('settings permission as it can be configured in Pimcore workplaces')->end()
  1538.                                                         ->booleanNode('versions')->info('versions permission as it can be configured in Pimcore workplaces')->end()
  1539.                                                         ->booleanNode('properties')->info('properties permission as it can be configured in Pimcore workplaces')->end()
  1540.                                                         ->booleanNode('modify')->info('a short hand for save, publish, unpublish, delete + rename')->end()
  1541.                                                         ->scalarNode('objectLayout')->info('if set, the user will see the configured custom data object layout')->end()
  1542.                                                     ->end()
  1543.                                                 ->end()
  1544.                                             ->end()
  1545.                                         ->end()
  1546.                                     ->end()
  1547.                                     ->beforeNormalization()
  1548.                                         ->always()
  1549.                                         ->then(function ($places) {
  1550.                                             if (!empty($this->placeholders)) {
  1551.                                                 foreach ($places as $name => $place) {
  1552.                                                     $places[$name] = $this->placeholderProcessor->mergePlaceholders($place$this->placeholders);
  1553.                                                 }
  1554.                                             }
  1555.                                             return $places;
  1556.                                         })
  1557.                                     ->end()
  1558.                                     ->example([
  1559.                                         'places' => [
  1560.                                             'closed' => [
  1561.                                                 'label' => 'close product',
  1562.                                                 'permissions' => [
  1563.                                                     [
  1564.                                                         'condition' => "is_fully_authenticated() and 'ROLE_PIMCORE_ADMIN' in roles",
  1565.                                                         'modify' => false,
  1566.                                                     ],
  1567.                                                     [
  1568.                                                         'modify' => false,
  1569.                                                         'objectLayout' => 2,
  1570.                                                     ],
  1571.                                                 ],
  1572.                                             ],
  1573.                                         ],
  1574.                                     ])
  1575.                                 ->end()
  1576.                                 ->arrayNode('transitions')
  1577.                                     ->beforeNormalization()
  1578.                                         ->always()
  1579.                                         ->then(function ($transitions) {
  1580.                                             // It's an indexed array, we let the validation occurs
  1581.                                             if (isset($transitions[0])) {
  1582.                                                 return $transitions;
  1583.                                             }
  1584.                                             foreach ($transitions as $name => $transition) {
  1585.                                                 if (array_key_exists('name', (array) $transition)) {
  1586.                                                     continue;
  1587.                                                 }
  1588.                                                 $transition['name'] = $name;
  1589.                                                 $transitions[$name] = $transition;
  1590.                                             }
  1591.                                             return $transitions;
  1592.                                         })
  1593.                                     ->end()
  1594.                                     ->isRequired()
  1595.                                     ->requiresAtLeastOneElement()
  1596.                                     ->prototype('array')
  1597.                                         ->children()
  1598.                                             ->scalarNode('name')
  1599.                                                 ->isRequired()
  1600.                                                 ->cannotBeEmpty()
  1601.                                             ->end()
  1602.                                             ->scalarNode('guard')
  1603.                                                 ->cannotBeEmpty()
  1604.                                                 ->info('An expression to block the transition')
  1605.                                                 ->example('is_fully_authenticated() and has_role(\'ROLE_JOURNALIST\') and subject.getTitle() == \'My first article\'')
  1606.                                             ->end()
  1607.                                             ->arrayNode('from')
  1608.                                                 ->beforeNormalization()
  1609.                                                     ->ifString()
  1610.                                                     ->then(function ($v) {
  1611.                                                         return [$v];
  1612.                                                     })
  1613.                                                 ->end()
  1614.                                                 ->requiresAtLeastOneElement()
  1615.                                                 ->prototype('scalar')
  1616.                                                     ->cannotBeEmpty()
  1617.                                                 ->end()
  1618.                                             ->end()
  1619.                                             ->arrayNode('to')
  1620.                                                 ->beforeNormalization()
  1621.                                                     ->ifString()
  1622.                                                     ->then(function ($v) {
  1623.                                                         return [$v];
  1624.                                                     })
  1625.                                                 ->end()
  1626.                                                 ->requiresAtLeastOneElement()
  1627.                                                 ->prototype('scalar')
  1628.                                                     ->cannotBeEmpty()
  1629.                                                 ->end()
  1630.                                             ->end()
  1631.                                             ->arrayNode('options')
  1632.                                                 ->children()
  1633.                                                     ->scalarNode('label')->info('Nice name for the Pimcore backend.')->end()
  1634.                                                     ->arrayNode('notes')
  1635.                                                         ->children()
  1636.                                                             ->booleanNode('commentEnabled')->defaultFalse()->info('If enabled a detail window will open when the user executes the transition. In this detail view the user be asked to enter a "comment". This comment then will be used as comment for the notes/events feature.')->end()
  1637.                                                             ->booleanNode('commentRequired')->defaultFalse()->info('Set this to true if the comment should be a required field.')->end()
  1638.                                                             ->scalarNode('commentSetterFn')->info('Can be used for data objects. The comment will be saved to the data object additionally to the notes/events through this setter function.')->end()
  1639.                                                             ->scalarNode('commentGetterFn')->info('Can be used for data objects to prefill the comment field with data from the data object.')->end()
  1640.                                                             ->scalarNode('type')->defaultValue('Status update')->info('Set\'s the type string in the saved note.')->end()
  1641.                                                             ->scalarNode('title')->info('An optional alternative "title" for the note, if blank the actions transition result is used.')->end()
  1642.                                                             ->arrayNode('additionalFields')
  1643.                                                                 ->prototype('array')
  1644.                                                                     ->children()
  1645.                                                                         ->scalarNode('name')->isRequired()->info('The technical name used in the input form.')->end()
  1646.                                                                         ->enumNode('fieldType')
  1647.                                                                             ->isRequired()
  1648.                                                                             ->values(['input''textarea''select''datetime''date''user''checkbox'])
  1649.                                                                             ->info('The data component name/field type.')
  1650.                                                                         ->end()
  1651.                                                                         ->scalarNode('title')->info('The label used by the field')->end()
  1652.                                                                         ->booleanNode('required')->defaultFalse()->info('Whether or not the field is required.')->end()
  1653.                                                                         ->scalarNode('setterFn')->info('Optional setter function (available in the element, for example in the updated object), if not specified, data will be added to notes. The Workflow manager will call the function with the whole field data.')->end()
  1654.                                                                         ->arrayNode('fieldTypeSettings')
  1655.                                                                              ->prototype('variable')->end()
  1656.                                                                              ->info('Will be passed to the underlying Pimcore data object field type. Can be used to configure the options of a select box for example.')
  1657.                                                                         ->end()
  1658.                                                                     ->end()
  1659.                                                                 ->end()
  1660.                                                                 ->info('Add additional field to the transition detail window.')
  1661.                                                             ->end()
  1662.                                                         ->end()
  1663.                                                     ->end()
  1664.                                                     ->scalarNode('iconClass')->info('Css class to define the icon which will be used in the actions button in the backend.')->end()
  1665.                                                     ->scalarNode('objectLayout')->defaultValue(false)->info('Forces an object layout after the transition was performed. This objectLayout setting overrules all objectLayout settings within the places configs.')->end()
  1666.                                                     ->arrayNode('notificationSettings')
  1667.                                                         ->prototype('array')
  1668.                                                             ->children()
  1669.                                                                 ->scalarNode('condition')->info('A symfony expression can be configured here. All sets of notification which are matching the condition will be used.')->end()
  1670.                                                                 ->arrayNode('notifyUsers')
  1671.                                                                     ->prototype('scalar')
  1672.                                                                         ->cannotBeEmpty()
  1673.                                                                     ->end()
  1674.                                                                     ->info('Send an email notification to a list of users (user names) when the transition get\'s applied')
  1675.                                                                 ->end()
  1676.                                                                 ->arrayNode('notifyRoles')
  1677.                                                                     ->prototype('scalar')
  1678.                                                                         ->cannotBeEmpty()
  1679.                                                                     ->end()
  1680.                                                                     ->info('Send an email notification to a list of user roles (role names) when the transition get\'s applied')
  1681.                                                                 ->end()
  1682.                                                                 ->arrayNode('channelType')
  1683.                                                                     ->requiresAtLeastOneElement()
  1684.                                                                     ->enumPrototype()
  1685.                                                                         ->values([NotificationSubscriber::NOTIFICATION_CHANNEL_MAILNotificationSubscriber::NOTIFICATION_CHANNEL_PIMCORE_NOTIFICATION])
  1686.                                                                         ->cannotBeEmpty()
  1687.                                                                         ->defaultValue(NotificationSubscriber::NOTIFICATION_CHANNEL_MAIL)
  1688.                                                                     ->end()
  1689.                                                                     ->info('Define which channel notification should be sent to, possible values "' NotificationSubscriber::NOTIFICATION_CHANNEL_MAIL '" and "' NotificationSubscriber::NOTIFICATION_CHANNEL_PIMCORE_NOTIFICATION '", default value is "' NotificationSubscriber::NOTIFICATION_CHANNEL_MAIL '".')
  1690.                                                                     ->addDefaultChildrenIfNoneSet()
  1691.                                                                 ->end()
  1692.                                                                 ->enumNode('mailType')
  1693.                                                                     ->values([NotificationSubscriber::MAIL_TYPE_TEMPLATENotificationSubscriber::MAIL_TYPE_DOCUMENT])
  1694.                                                                     ->defaultValue(NotificationSubscriber::MAIL_TYPE_TEMPLATE)
  1695.                                                                     ->info('Type of mail source.')
  1696.                                                                 ->end()
  1697.                                                                 ->scalarNode('mailPath')
  1698.                                                                     ->defaultValue(NotificationSubscriber::DEFAULT_MAIL_TEMPLATE_PATH)
  1699.                                                                     ->info('Path to mail source - either Symfony path to template or fullpath to Pimcore document. Optional use ' NotificationEmailService::MAIL_PATH_LANGUAGE_PLACEHOLDER ' as placeholder for language.')
  1700.                                                                 ->end()
  1701.                                                             ->end()
  1702.                                                         ->end()
  1703.                                                     ->end()
  1704.                                                     ->enumNode('changePublishedState')
  1705.                                                         ->values([ChangePublishedStateSubscriber::NO_CHANGEChangePublishedStateSubscriber::FORCE_UNPUBLISHEDChangePublishedStateSubscriber::FORCE_PUBLISHEDChangePublishedStateSubscriber::SAVE_VERSION])
  1706.                                                         ->defaultValue(ChangePublishedStateSubscriber::NO_CHANGE)
  1707.                                                         ->info('Change published state of element while transition (only available for documents and data objects).')
  1708.                                                     ->end()
  1709.                                                 ->end()
  1710.                                             ->end()
  1711.                                         ->end()
  1712.                                     ->end()
  1713.                                     ->example([
  1714.                                         'close_product' => [
  1715.                                             'from' => 'open',
  1716.                                             'to' => 'closed',
  1717.                                             'options' => [
  1718.                                                 'label' => 'close product',
  1719.                                                 'notes' => [
  1720.                                                     'commentEnabled' => true,
  1721.                                                     'commentRequired' => true,
  1722.                                                     'additionalFields' => [
  1723.                                                         [
  1724.                                                             'name' => 'accept',
  1725.                                                             'title' => 'accept terms',
  1726.                                                             'required' => true,
  1727.                                                             'fieldType' => 'checkbox',
  1728.                                                         ],
  1729.                                                         [
  1730.                                                             'name' => 'select',
  1731.                                                             'title' => 'please select a type',
  1732.                                                             'setterFn' => 'setSpecialWorkflowType',
  1733.                                                             'fieldType' => 'select',
  1734.                                                             'fieldTypeSettings' => [
  1735.                                                                 'options' => [
  1736.                                                                     ['key' => 'Option A''value' => 'a'],
  1737.                                                                     ['key' => 'Option B''value' => 'b'],
  1738.                                                                     ['key' => 'Option C''value' => 'c'],
  1739.                                                                 ],
  1740.                                                             ],
  1741.                                                         ],
  1742.                                                     ],
  1743.                                                 ],
  1744.                                             ],
  1745.                                         ],
  1746.                                     ])
  1747.                                 ->end()
  1748.                                 ->arrayNode('globalActions')
  1749.                                     ->prototype('array')
  1750.                                         ->children()
  1751.                                             ->scalarNode('label')->info('Nice name for the Pimcore backend.')->end()
  1752.                                             ->scalarNode('iconClass')->info('Css class to define the icon which will be used in the actions button in the backend.')->end()
  1753.                                             ->scalarNode('objectLayout')->defaultValue(false)->info('Forces an object layout after the global action was performed. This objectLayout setting overrules all objectLayout settings within the places configs.')->end()
  1754.                                             ->scalarNode('guard')
  1755.                                                 ->cannotBeEmpty()
  1756.                                                 ->info('An expression to block the action')
  1757.                                                 ->example('is_fully_authenticated() and has_role(\'ROLE_JOURNALIST\') and subject.getTitle() == \'My first article\'')
  1758.                                             ->end()
  1759.                                             ->arrayNode('to')
  1760.                                                 ->beforeNormalization()
  1761.                                                     ->ifString()
  1762.                                                     ->then(function ($v) {
  1763.                                                         return [$v];
  1764.                                                     })
  1765.                                                 ->end()
  1766.                                                 ->requiresAtLeastOneElement()
  1767.                                                 ->prototype('scalar')
  1768.                                                     ->cannotBeEmpty()
  1769.                                                 ->end()
  1770.                                                 ->info('Optionally set the current place of the workflow. Can be used for example to reset the workflow to the initial place.')
  1771.                                             ->end()
  1772.                                             ->arrayNode('notes')
  1773.                                                 ->children()
  1774.                                                     ->booleanNode('commentEnabled')->defaultFalse()->end()
  1775.                                                     ->booleanNode('commentRequired')->defaultFalse()->end()
  1776.                                                     ->scalarNode('commentSetterFn')->end()
  1777.                                                     ->scalarNode('commentGetterFn')->end()
  1778.                                                     ->scalarNode('type')->defaultValue('Status update')->end()
  1779.                                                     ->scalarNode('title')->end()
  1780.                                                     ->arrayNode('additionalFields')
  1781.                                                         ->prototype('array')
  1782.                                                             ->children()
  1783.                                                                 ->scalarNode('name')->isRequired()->end()
  1784.                                                                 ->enumNode('fieldType')
  1785.                                                                     ->isRequired()
  1786.                                                                     ->values(['input''textarea''select''datetime''date''user''checkbox'])
  1787.                                                                 ->end()
  1788.                                                                 ->scalarNode('title')->end()
  1789.                                                                 ->booleanNode('required')->defaultFalse()->end()
  1790.                                                                 ->scalarNode('setterFn')->end()
  1791.                                                                 ->arrayNode('fieldTypeSettings')
  1792.                                                                      ->prototype('variable')->end()
  1793.                                                                 ->end()
  1794.                                                             ->end()
  1795.                                                         ->end()
  1796.                                                     ->end()
  1797.                                                 ->end()
  1798.                                                 ->info('See notes section of transitions. It works exactly the same way.')
  1799.                                             ->end()
  1800.                                         ->end()
  1801.                                     ->end()
  1802.                                     ->info('Actions which will be added to actions button independently of the current workflow place.')
  1803.                                 ->end()
  1804.                             ->end()
  1805.                             ->validate()
  1806.                                 ->ifTrue(function ($v) {
  1807.                                     return $v['supports'] && isset($v['support_strategy']);
  1808.                                 })
  1809.                                 ->thenInvalid('"supports" and "support_strategy" cannot be used together.')
  1810.                             ->end()
  1811.                             ->validate()
  1812.                                 ->ifTrue(function ($v) {
  1813.                                     return !$v['supports'] && !isset($v['support_strategy']);
  1814.                                 })
  1815.                                 ->thenInvalid('"supports" or "support_strategy" should be configured.')
  1816.                             ->end()
  1817.                         ->end()
  1818.                     ->end()
  1819.                 ->end()
  1820.                 ->addDefaultsIfNotSet()
  1821.             ->end();
  1822.     }
  1823. }