<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 25.01.14
 * Time: 0:10
 */

namespace Strokit\CoreBundle\Menu;

use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;

class BreadcrumbBuilder
{

//    private $breadcrumbBuilders;
    /**
     * @var \Knp\Menu\FactoryInterface
     */
    private $factory;
    /**
     * @var
     */
    private $homeRoute;
    private $container;

    public function __construct(
        Container $container,
//        $breadcrumbBuilders,
        FactoryInterface $factory,
        $homeRoute)
    {

//        $this->breadcrumbBuilders = $breadcrumbBuilders;
        $this->factory = $factory;
        $this->homeRoute = $homeRoute;
        $this->container = $container;
    }

    public function createBreadcrumbMenu(Request $request)
    {
        $menu = $this->factory->createItem('root');
        // this item will always be displayed
        $menu->addChild('home', array('route' => $this->homeRoute))
            ->setExtra('translation_domain', 'InfoElsomBundle');

        // - [@infofaq_breadcrumb, @infomap_breadcrumb, @infopage_breadcrumb, @sonata.news.breadcrumb, @infofeedback_breadcrumb]

        if ($this->container->get('infofaq_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        if ($this->container->get('infopage_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        if ($this->container->get('infomap_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        if ($this->container->get('sonata.news.breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        if ($this->container->get('infofeedback_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        return $menu;
        //throw new \InvalidArgumentException('breadcrumb.route.not_found');
    }

} <commit_msg>ELS-36 Генерация бредкрамбов... На серваке что-то не хочет работать<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 25.01.14
 * Time: 0:10
 */

namespace Strokit\CoreBundle\Menu;

use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;

class BreadcrumbBuilder
{

//    private $breadcrumbBuilders;
    /**
     * @var \Knp\Menu\FactoryInterface
     */
    private $factory;
    /**
     * @var
     */
    private $homeRoute;
    private $container;

    public function __construct(
        Container $container,
//        $breadcrumbBuilders,
        FactoryInterface $factory,
        $homeRoute)
    {

//        $this->breadcrumbBuilders = $breadcrumbBuilders;
        $this->factory = $factory;
        $this->homeRoute = $homeRoute;
        $this->container = $container;
    }

    public function createBreadcrumbMenu(Request $request)
    {
        $menu = $this->factory->createItem('root');
        // this item will always be displayed
        $menu->addChild('home', array('route' => $this->homeRoute))
            ->setExtra('translation_domain', 'InfoElsomBundle');

        echo 'test1';

        // - [@infofaq_breadcrumb, @infomap_breadcrumb, @infopage_breadcrumb, @sonata.news.breadcrumb, @infofeedback_breadcrumb]

        if ($this->container->get('infofaq_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        echo 'test2';
        if ($this->container->get('infopage_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        echo 'test3';
        if ($this->container->get('infomap_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        echo 'test4';
        if ($this->container->get('sonata.news.breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        echo 'test5';
        if ($this->container->get('infofeedback_breadcrumb')->createBreadcrumbMenu($request, $menu))
            return $menu;
        return $menu;
        //throw new \InvalidArgumentException('breadcrumb.route.not_found');
    }

} 
{'fraction_non_alphanumeric': 0.13971476915639353, 'fraction_numerical': 0.006043026347594876, 'mean_word_length': 2.885446009389671, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '2973761', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1258, 'n_words': 218}