<commit_before><?php
/**
 * @author <NAME> <<EMAIL>>
 * @copyright Zicht Online <http://zicht.nl>
 */

namespace Zicht\Bundle\PageBundle\Url;

use \Symfony\Component\Routing\RouterInterface;
use \Zicht\Bundle\UrlBundle\Url\SuggestableProvider;
use \Zicht\Bundle\PageBundle\Manager\PageManager;
use \Zicht\Bundle\UrlBundle\Url\AbstractRoutingProvider;

/**
 * Provides urls for page objects.
 */
class PageUrlProvider extends AbstractRoutingProvider implements SuggestableProvider
{
    /**
     * Constructs the provider
     *
     * @param \Symfony\Component\Routing\RouterInterface $router
     * @param \Zicht\Bundle\PageBundle\Manager\PageManager $pageManager
     */
    public function __construct(RouterInterface $router, PageManager $pageManager)
    {
        parent::__construct($router);
        $this->pageManager = $pageManager;
    }


    /**
     * @{inheritDoc}
     */
    public function supports($object)
    {
        $pageClassName = $this->pageManager->getPageClass();
        return ($object instanceof $pageClassName);
    }


    /**
     * @{inheritDoc}
     */
    public function routing($page)
    {
        if ($page->getLanguage()) {
            return array(
                'zicht_page_page_view',
                array(
                    'id' => $page->getId(),
                    '_locale' => $page->getLanguage()
                )
            );
        } else {
            return array(
                'zicht_page_page_view',
                array(
                    'id' => $page->getId()
                )
            );
        }
    }

    /**
     * @{inheritDoc}
     */<commit_msg>added options to routing() impl<commit_after><?php
/**
 * @author <NAME> <<EMAIL>>
 * @copyright Zicht Online <http://zicht.nl>
 */

namespace Zicht\Bundle\PageBundle\Url;

use \Symfony\Component\Routing\RouterInterface;
use \Zicht\Bundle\UrlBundle\Url\SuggestableProvider;
use \Zicht\Bundle\PageBundle\Manager\PageManager;
use \Zicht\Bundle\UrlBundle\Url\AbstractRoutingProvider;

/**
 * Provides urls for page objects.
 */
class PageUrlProvider extends AbstractRoutingProvider implements SuggestableProvider
{
    /**
     * Constructs the provider
     *
     * @param \Symfony\Component\Routing\RouterInterface $router
     * @param \Zicht\Bundle\PageBundle\Manager\PageManager $pageManager
     */
    public function __construct(RouterInterface $router, PageManager $pageManager)
    {
        parent::__construct($router);
        $this->pageManager = $pageManager;
    }


    /**
     * @{inheritDoc}
     */
    public function supports($object)
    {
        $pageClassName = $this->pageManager->getPageClass();
        return ($object instanceof $pageClassName);
    }


    /**
     * @{inheritDoc}
     */
    public function routing($page, array $options = array())
    {
        if ($page->getLanguage()) {
            return array(
                'zicht_page_page_view',
                array(
                    'id' => $page->getId(),
                    '_locale' => $page->getLanguage()
                )
            );
        } else {
            return array(
                'zicht_page_page_view',
                array(
                    'id' => $page->getId()
                )
            );
        }
    }

    /**
     * @{inheritDoc}
     */
{'fraction_non_alphanumeric': 0.12832125603864733, 'fraction_numerical': 0.0, 'mean_word_length': 1.9659803043867503, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, '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': '4664297', 'n_tokens_mistral': 941, 'n_tokens_neox': 921, 'n_words': 165}