<commit_before><?php

namespace SpotOnLive\Navigation\Services;

use SpotOnLive\Navigation\Exceptions\ContainerException;
use SpotOnLive\Navigation\Navigation\Container;

class NavigationService implements NavigationServiceInterface
{
    /** @var array */
    protected $config;

    /**
     * @param array $config
     */
    public function __construct(array $config)
    {
        $this->config = $config;
    }

    public function render($name)
    {
        $container = $this->getContainer($name);
        return $container->render();
    }

    /**
     * Get container from name
     *
     * @param $name
     * @return Container
     * @throws ContainerException
     */
    public function getContainer($name)
    {
        foreach ($this->config['containers'] as $containerName => $container) {
            if ($name == $containerName) {
                return new Container($container);
            }
        }

        throw new ContainerException('The container \'%s\' does not exist');
    }
}<commit_msg>ContainerException message<commit_after><?php

namespace SpotOnLive\Navigation\Services;

use SpotOnLive\Navigation\Exceptions\ContainerException;
use SpotOnLive\Navigation\Navigation\Container;

class NavigationService implements NavigationServiceInterface
{
    /** @var array */
    protected $config;

    /**
     * @param array $config
     */
    public function __construct(array $config)
    {
        $this->config = $config;
    }

    public function render($name)
    {
        $container = $this->getContainer($name);
        return $container->render();
    }

    /**
     * Get container from name
     *
     * @param $name
     * @return Container
     * @throws ContainerException
     */
    public function getContainer($name)
    {
        foreach ($this->config['containers'] as $containerName => $container) {
            if ($name == $containerName) {
                return new Container($container);
            }
        }

        throw new ContainerException(sprintf('The container \'%s\' does not exist', $name));
    }
}
{'fraction_non_alphanumeric': 0.11844005777563794, 'fraction_numerical': 0.0, 'mean_word_length': 2.4807370184254607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5828299', 'n_tokens_mistral': 548, 'n_tokens_neox': 533, 'n_words': 128}