<commit_before><?php

/*
 * This file is part of the CSMenuBundle package.
 *
 * (c) <NAME> <<EMAIL>> / CustomScripts
 *
 * @author <NAME> <<EMAIL>>
 * @link(https://www.github.com/CustomScripts/MenuBundle)
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CS\MenuBundle\Menu;

use Symfony\Component\DependencyInjection\ContainerAware;

use JMS\DiExtraBundle\Annotation as DI;

/**
 * @DI\Service("cs_menu.builder")
 */
class Builder extends ContainerAware
{

	protected $builders = array();

	public function addBuilder($builder)
	{
		$this->builders[] = $builder;
	}

    /**
     * @DI\Inject("service_container");
     */
    public $container;

    public function getFactory()
    {
        $factory = $this->container->get('knp_menu.factory');

        return $factory;
    }

    public function has($mehtod)
    {
    	if(empty($this->builders))
    	{
    		throw new \Exception("No menu builders defined! perhaps you forgot to create a service and tag it with 'cs_menu.builder'?");
    	}

    	foreach($this->builders as $builder)
    	{
    		if(method_exists($builder, $method))
    		{
    			return $builder;
    		}
    	}

    	return false;
    }
<commit_msg>Fixed variable name type<commit_after><?php

/*
 * This file is part of the CSMenuBundle package.
 *
 * (c) <NAME> <<EMAIL>> / CustomScripts
 *
 * @author <NAME> <<EMAIL>>
 * @link(https://www.github.com/CustomScripts/MenuBundle)
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CS\MenuBundle\Menu;

use Symfony\Component\DependencyInjection\ContainerAware;

use JMS\DiExtraBundle\Annotation as DI;

/**
 * @DI\Service("cs_menu.builder")
 */
class Builder extends ContainerAware
{

	protected $builders = array();

	public function addBuilder($builder)
	{
		$this->builders[] = $builder;
	}

    /**
     * @DI\Inject("service_container");
     */
    public $container;

    public function getFactory()
    {
        $factory = $this->container->get('knp_menu.factory');

        return $factory;
    }

    public function has($method)
    {
    	if(empty($this->builders))
    	{
    		throw new \Exception("No menu builders defined! perhaps you forgot to create a service and tag it with 'cs_menu.builder'?");
    	}

    	foreach($this->builders as $builder)
    	{
    		if(method_exists($builder, $method))
    		{
    			return $builder;
    		}
    	}

    	return false;
    }

{'fraction_non_alphanumeric': 0.13140398904966757, 'fraction_numerical': 0.0, 'mean_word_length': 2.972049689440994, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6563848', 'n_tokens_mistral': 826, 'n_tokens_neox': 807, 'n_words': 199}