<commit_before>parameters:
    oro_layout.layout_factory_builder.class:    Oro\Component\Layout\LayoutFactoryBuilder
    oro_layout.layout_manager.class:            Oro\Component\Layout\LayoutManager

services:
    oro_layout.extension:
        public: false
        class: Oro\Component\Layout\Extension\DependencyInjection\DependencyInjectionExtension
        arguments:
            - '@service_container'
            - {} # types
            - {} # type extensions
            - {} # layout updates
            - {} # context configurators
            - {} # data providers

    oro_layout.layout_factory_builder:
        public: false
        class: %oro_layout.layout_factory_builder.class%
        arguments:
            - '@oro_layout.processor.expression'
            - "@=parameter('kernel.environment') == 'prod' ? service('oro_layout.cache.block_view_cache') : null"
        calls:
            - [addExtension, ['@oro_layout.extension']]
            - [addExtension, ['@oro_layout.theme_extension']]
            - [setDefaultRenderer, ['%oro_layout.templating.default%']]

    oro_layout.layout_manager:
        class: %oro_layout.layout_manager.class%
        arguments:
            - '@oro_layout.layout_factory_builder'

    oro_layout.text.helper:
        class: Oro\Component\Layout\Templating\TextHelper
        arguments:
            - '@translator'

    oro_layout.layout_context_configurator.application:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ApplicationContextConfigurator
        arguments:
            - '@kernel'
        tags:
            - { name: layout.context_configurator }

    oro_layout.layout_context_configurator.action:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ActionContextConfigurator
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.data:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\DataContextConfigurator
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.route:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\RouteContextConfigurator
        calls:
            - [setRequest, ["@?request="]]
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.expression:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ExpressionContextConfigurator
        tags:
            - { name: layout.context_configurator }

    oro_layout.layout_context_configurator.last_modification_date:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\LastModifiedDateContextConfigurator
        arguments:
            - '@oro_layout.theme_extension.resource_provider.cache'
        tags:
            - { name: layout.context_configurator }

    oro_layout.block_type_extension.data_collector:
        class: Oro\Bundle\LayoutBundle\Layout\Block\Extension\DataCollectorExtension
        arguments:
            - '@oro_layout.profiler.layout_data_collector'
        tags:
            - { name: layout.block_type_extension, alias: block, priority: 300 }

    oro_layout.expression.encoder_registry:
        class: Oro\Component\Layout\ExpressionLanguage\Encoder\ExpressionEncoderRegistry
        arguments:
            - {}

    oro_layout.expression_language.expression_manipulator:
        class: Oro\Component\Layout\ExpressionLanguage\ExpressionManipulator

    oro_layout.expression.json_encoder:
        class: Oro\Component\Layout\ExpressionLanguage\Encoder\JsonExpressionEncoder
        arguments:
            - '@oro_layout.expression_language.expression_manipulator'
        tags:
            - { name: layout.expression.encoder, format: json }

    oro_layout.assetic.layout_formula_loader:
        public: false
        class: Oro\Bundle\LayoutBundle\Assetic\LayoutFormulaLoader
        tags:
            - { name: assetic.formula_loader, alias: layout }

    oro_layout.assetic.layout_resource:
        public: false
        class: Oro\Bundle\LayoutBundle\Assetic\LayoutResource
        arguments:
            - '@oro_layout.theme_manager'
            - '@filesystem'
            - "%kernel.root_dir%/../web/"
        tags:
            - { name: assetic.formula_resource, loader: layout }

    oro_layout.processor.expression:
        class: Oro\Component\Layout\ExpressionLanguage\ExpressionProcessor
        arguments:
            - '@oro_layout.expression_language'
            - '@oro_layout.expression.encoder_registry'

    oro_layout.provider.image_type:
        class: Oro\Bundle\LayoutBundle\Provider\ImageTypeProvider
        arguments:
            - '@oro_layout.theme_manager'

    oro_layout.provider.requirejs_config:
        class: Oro\Bundle\LayoutBundle\Provider\RequireJSConfigProvider
        arguments:
            - '@templating'
            - '@oro_requirejs.cache'
            - '%oro_require_js%'
            - '%kernel.bundles%'
            - '%oro_require_js.web_root%'
        calls:
            - [ setThemeManager, [ '@oro_layout.theme_manager' ] ]
            - [ setContextHolder, [ '@oro_layout.layout_context_holder' ] ]
        tags:
            - { name: requirejs.config_provider, alias: oro_layout_requirejs_config_provider }
        lazy: true

    oro_layout.helper:
        class: Oro\Bundle\LayoutBundle\Request\LayoutHelper
        arguments:
            - '@request_stack'
            - '@oro_config.user'

    oro_layout.imports_storage:
        class: Doctrine\Common\Collections\ArrayCollection
        public: false

    oro_layout.layout_context_holder:
        class: Oro\Bundle\LayoutBundle\Layout\LayoutContextHolder

    oro_layout.expression_language.cache:
        public: false
        parent: oro.cache.abstract
        calls:
            - [ setNamespace, [ 'oro_layout_expression_language' ] ]

    oro_layout.expression_language.parsed_cache:
        class: Symfony\Bridge\Doctrine\ExpressionLanguage\DoctrineParserCache
        arguments:
            - '@oro_layout.expression_language.cache'

    oro_layout.expression_language:
        class: Symfony\Component\ExpressionLanguage\ExpressionLanguage
        arguments:
            - '@oro_layout.expression_language.parsed_cache'
            - []

    oro_layout.data_provider.asset:
        class: Oro\Bundle\LayoutBundle\Layout\DataProvider\AssetProvider
        arguments:
            - '@assets.packages'
        tags:
            - { name: layout.data_provider, alias: asset }

    oro_layout.loader.image_filter:
        class: Oro\Bundle\LayoutBundle\Loader\ImageFilterLoader
        arguments:
            - '@oro_layout.provider.image_type'
            - '@liip_imagine.filter.configuration'
            - '@oro_entity.doctrine_helper'


    oro_layout.request.listener.imagine_filter_config:
        class: Oro\Bundle\LayoutBundle\EventListener\ImagineFilterConfigListener
        arguments:
            - '@oro_layout.loader.image_filter'
        tags:
            - { name: kernel.event_listener, event: kernel.request }

    oro_layout.block_view_serializer:
        class: Symfony\Component\Serializer\Serializer
        arguments: [{}, {'json': '@oro_layout.block_view_serializer.json_encoder'}]

    oro_layout.block_view_serializer.json_encoder:
        class: Symfony\Component\Serializer\Encoder\JsonEncoder

    oro_layout.block_view_serializer.block_view_normalizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\BlockViewNormalizer
        tags:
            - { name: layout.block_view_serializer.normalizer }

    oro_layout.block_view_serializer.expression_normalizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\ExpressionNormalizer
        arguments: [{}, {}]
        tags:
            - { name: layout.block_view_serializer.normalizer }

    oro_layout.option_value_bag_normaizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\OptionValueBagNormalizer
        tags:
            - { name: layout.block_view_serializer.normalizer }
<commit_msg>BB-5778: Layout toolbar tab not working after cache implementation - disable block view cache if debug = true<commit_after>parameters:
    oro_layout.layout_factory_builder.class:    Oro\Component\Layout\LayoutFactoryBuilder
    oro_layout.layout_manager.class:            Oro\Component\Layout\LayoutManager

services:
    oro_layout.extension:
        public: false
        class: Oro\Component\Layout\Extension\DependencyInjection\DependencyInjectionExtension
        arguments:
            - '@service_container'
            - {} # types
            - {} # type extensions
            - {} # layout updates
            - {} # context configurators
            - {} # data providers

    oro_layout.layout_factory_builder:
        public: false
        class: %oro_layout.layout_factory_builder.class%
        arguments:
            - '@oro_layout.processor.expression'
            - "@=!parameter('kernel.debug') ? service('oro_layout.cache.block_view_cache') : null"
        calls:
            - [addExtension, ['@oro_layout.extension']]
            - [addExtension, ['@oro_layout.theme_extension']]
            - [setDefaultRenderer, ['%oro_layout.templating.default%']]

    oro_layout.layout_manager:
        class: %oro_layout.layout_manager.class%
        arguments:
            - '@oro_layout.layout_factory_builder'

    oro_layout.text.helper:
        class: Oro\Component\Layout\Templating\TextHelper
        arguments:
            - '@translator'

    oro_layout.layout_context_configurator.application:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ApplicationContextConfigurator
        arguments:
            - '@kernel'
        tags:
            - { name: layout.context_configurator }

    oro_layout.layout_context_configurator.action:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ActionContextConfigurator
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.data:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\DataContextConfigurator
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.route:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\RouteContextConfigurator
        calls:
            - [setRequest, ["@?request="]]
        tags:
            - { name: layout.context_configurator, priority: -100 }

    oro_layout.layout_context_configurator.expression:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\ExpressionContextConfigurator
        tags:
            - { name: layout.context_configurator }

    oro_layout.layout_context_configurator.last_modification_date:
        class: Oro\Bundle\LayoutBundle\Layout\Extension\LastModifiedDateContextConfigurator
        arguments:
            - '@oro_layout.theme_extension.resource_provider.cache'
        tags:
            - { name: layout.context_configurator }

    oro_layout.block_type_extension.data_collector:
        class: Oro\Bundle\LayoutBundle\Layout\Block\Extension\DataCollectorExtension
        arguments:
            - '@oro_layout.profiler.layout_data_collector'
        tags:
            - { name: layout.block_type_extension, alias: block, priority: 300 }

    oro_layout.expression.encoder_registry:
        class: Oro\Component\Layout\ExpressionLanguage\Encoder\ExpressionEncoderRegistry
        arguments:
            - {}

    oro_layout.expression_language.expression_manipulator:
        class: Oro\Component\Layout\ExpressionLanguage\ExpressionManipulator

    oro_layout.expression.json_encoder:
        class: Oro\Component\Layout\ExpressionLanguage\Encoder\JsonExpressionEncoder
        arguments:
            - '@oro_layout.expression_language.expression_manipulator'
        tags:
            - { name: layout.expression.encoder, format: json }

    oro_layout.assetic.layout_formula_loader:
        public: false
        class: Oro\Bundle\LayoutBundle\Assetic\LayoutFormulaLoader
        tags:
            - { name: assetic.formula_loader, alias: layout }

    oro_layout.assetic.layout_resource:
        public: false
        class: Oro\Bundle\LayoutBundle\Assetic\LayoutResource
        arguments:
            - '@oro_layout.theme_manager'
            - '@filesystem'
            - "%kernel.root_dir%/../web/"
        tags:
            - { name: assetic.formula_resource, loader: layout }

    oro_layout.processor.expression:
        class: Oro\Component\Layout\ExpressionLanguage\ExpressionProcessor
        arguments:
            - '@oro_layout.expression_language'
            - '@oro_layout.expression.encoder_registry'

    oro_layout.provider.image_type:
        class: Oro\Bundle\LayoutBundle\Provider\ImageTypeProvider
        arguments:
            - '@oro_layout.theme_manager'

    oro_layout.provider.requirejs_config:
        class: Oro\Bundle\LayoutBundle\Provider\RequireJSConfigProvider
        arguments:
            - '@templating'
            - '@oro_requirejs.cache'
            - '%oro_require_js%'
            - '%kernel.bundles%'
            - '%oro_require_js.web_root%'
        calls:
            - [ setThemeManager, [ '@oro_layout.theme_manager' ] ]
            - [ setContextHolder, [ '@oro_layout.layout_context_holder' ] ]
        tags:
            - { name: requirejs.config_provider, alias: oro_layout_requirejs_config_provider }
        lazy: true

    oro_layout.helper:
        class: Oro\Bundle\LayoutBundle\Request\LayoutHelper
        arguments:
            - '@request_stack'
            - '@oro_config.user'

    oro_layout.imports_storage:
        class: Doctrine\Common\Collections\ArrayCollection
        public: false

    oro_layout.layout_context_holder:
        class: Oro\Bundle\LayoutBundle\Layout\LayoutContextHolder

    oro_layout.expression_language.cache:
        public: false
        parent: oro.cache.abstract
        calls:
            - [ setNamespace, [ 'oro_layout_expression_language' ] ]

    oro_layout.expression_language.parsed_cache:
        class: Symfony\Bridge\Doctrine\ExpressionLanguage\DoctrineParserCache
        arguments:
            - '@oro_layout.expression_language.cache'

    oro_layout.expression_language:
        class: Symfony\Component\ExpressionLanguage\ExpressionLanguage
        arguments:
            - '@oro_layout.expression_language.parsed_cache'
            - []

    oro_layout.data_provider.asset:
        class: Oro\Bundle\LayoutBundle\Layout\DataProvider\AssetProvider
        arguments:
            - '@assets.packages'
        tags:
            - { name: layout.data_provider, alias: asset }

    oro_layout.loader.image_filter:
        class: Oro\Bundle\LayoutBundle\Loader\ImageFilterLoader
        arguments:
            - '@oro_layout.provider.image_type'
            - '@liip_imagine.filter.configuration'
            - '@oro_entity.doctrine_helper'


    oro_layout.request.listener.imagine_filter_config:
        class: Oro\Bundle\LayoutBundle\EventListener\ImagineFilterConfigListener
        arguments:
            - '@oro_layout.loader.image_filter'
        tags:
            - { name: kernel.event_listener, event: kernel.request }

    oro_layout.block_view_serializer:
        class: Symfony\Component\Serializer\Serializer
        arguments: [{}, {'json': '@oro_layout.block_view_serializer.json_encoder'}]

    oro_layout.block_view_serializer.json_encoder:
        class: Symfony\Component\Serializer\Encoder\JsonEncoder

    oro_layout.block_view_serializer.block_view_normalizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\BlockViewNormalizer
        tags:
            - { name: layout.block_view_serializer.normalizer }

    oro_layout.block_view_serializer.expression_normalizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\ExpressionNormalizer
        arguments: [{}, {}]
        tags:
            - { name: layout.block_view_serializer.normalizer }

    oro_layout.option_value_bag_normaizer:
        class: Oro\Bundle\LayoutBundle\Layout\Serializer\OptionValueBagNormalizer
        tags:
            - { name: layout.block_view_serializer.normalizer }

{'fraction_non_alphanumeric': 0.09116826774093585, 'fraction_numerical': 0.0017353579175704988, 'mean_word_length': 2.5354951796669587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5625980', 'n_tokens_mistral': 4514, 'n_tokens_neox': 4362, 'n_words': 556}