bundles/BlockManagerBundle/DependencyInjection/CompilerPass/View/DefaultViewTemplatesPass.php
protected function updateRules(ContainerBuilder $container, ?array $allRules): array
    {
        $allRules = is_array($allRules) ? $allRules : [];

        $defaultTemplates = $container->getParameter('netgen_block_manager.default_view_templates');

        foreach ($defaultTemplates as $viewName => $viewTemplates) {
            foreach ($viewTemplates as $context => $template) {
                $rules = [];

                if (isset($allRules[$viewName][$context]) && is_array($allRules[$viewName][$context])) {
                    $rules = $allRules[$viewName][$context];
                }

                $rules = $this->addDefaultRule($viewName, $context, $rules, $template);

                $allRules[$viewName][$context] = $rules;
            }
        }

        return $allRules;
    }
protected function updateRules(ContainerBuilder $container, ?array $allRules): array
    {
        $allRules = is_array($allRules) ? $allRules : [];

        $defaultTemplates = $container->getParameter('netgen_block_manager.default_view_templates');

        foreach ($defaultTemplates as $viewName => $viewTemplates) {
            foreach ($viewTemplates as $context => $template) {
                $rules = [];

                if (isset($allRules[$viewName][$context]) && is_array($allRules[$viewName][$context])) {
                    $rules = $allRules[$viewName][$context];
                }

                $rules = $this->addDefaultRule($viewName, $context, $rules, $template);

                $allRules[$viewName][$context] = $rules;
            }
        }

        return $allRules;
    }
protected function updateRules ( ContainerBuilder $ container , ? array $ allRules ) : array { $ allRules = is_array ( $ allRules ) ? $ allRules : [ ] ; $ defaultTemplates = $ container -> getParameter ( 'netgen_block_manager.default_view_templates' ) ; foreach ( $ defaultTemplates as $ viewName => $ viewTemplates ) { foreach ( $ viewTemplates as $ context => $ template ) { $ rules = [ ] ; if ( isset ( $ allRules [ $ viewName ] [ $ context ] ) && is_array ( $ allRules [ $ viewName ] [ $ context ] ) ) { $ rules = $ allRules [ $ viewName ] [ $ context ] ; } $ rules = $ this -> addDefaultRule ( $ viewName , $ context , $ rules , $ template ) ; $ allRules [ $ viewName ] [ $ context ] = $ rules ; } } return $ allRules ; }
Updates all view rules to add the default template match.
Updates all view rules to add the default template match .