<commit_before><?php

namespace Stfalcon\Bundle\PortfolioBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

/**
 * Redirect controller
 */
class RedirectController extends Controller
{
    /**
     * @param string $categorySlug
     * @param string $projectSlug
     *
     * @return array
     * @Route("/portfolio/{categorySlug}/{projectSlug}",
     *  requirements={"projectSlug" = "uaroads|meinfernbus-de",
     *                "categorySlug" = "web-development|web-design"})
     */
    public function redirectOldLinksAction($categorySlug, $projectSlug)
    {
        switch (true) {
            case ($categorySlug == 'web-development' && $projectSlug == 'uaroads'):
                $redirectUrl = $this->generateUrl(
                    'portfolio_project_view',
                    [
                        'categorySlug' => $categorySlug,
                        'projectSlug'  => 'uaroads-com'
                    ]
                );
                break;
            case ($categorySlug == 'web-design' && $projectSlug == 'meinfernbus-de'):
                $redirectUrl = $this->generateUrl(
                    'portfolio_project_view',
                    [
                        'categorySlug' => 'web-development',
                        'projectSlug'  => $projectSlug
                    ]
                );
                break;

        }

        return $this->redirect($redirectUrl, 301);
    }
}<commit_msg>Added default view for pages in redirect controller<commit_after><?php

namespace Stfalcon\Bundle\PortfolioBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

/**
 * Redirect controller
 */
class RedirectController extends Controller
{
    /**
     * @param string $categorySlug
     * @param string $projectSlug
     *
     * @return array
     * @Route("/portfolio/{categorySlug}/{projectSlug}",
     *  requirements={"projectSlug" = "uaroads|meinfernbus-de",
     *                "categorySlug" = "web-development|web-design"})
     */
    public function redirectOldLinksAction($categorySlug, $projectSlug)
    {
        switch (true) {
            case ($categorySlug == 'web-development' && $projectSlug == 'uaroads'):
                $redirectUrl = $this->generateUrl(
                    'portfolio_project_view',
                    [
                        'categorySlug' => $categorySlug,
                        'projectSlug'  => 'uaroads-com'
                    ]
                );
                break;
            case ($categorySlug == 'web-design' && $projectSlug == 'meinfernbus-de'):
                $redirectUrl = $this->generateUrl(
                    'portfolio_project_view',
                    [
                        'categorySlug' => 'web-development',
                        'projectSlug'  => $projectSlug
                    ]
                );
                break;
            default:
                return $this->forward('StfalconPortfolioBundle:Project:view', [
                    'categorySlug' => $categorySlug,
                    'projectSlug'  => $projectSlug
                ]);

        }

        return $this->redirect($redirectUrl, 301);
    }
}
{'fraction_non_alphanumeric': 0.11734539969834087, 'fraction_numerical': 0.0018099547511312218, 'mean_word_length': 1.6720386784850927, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '6542120', 'n_tokens_mistral': 913, 'n_tokens_neox': 853, 'n_words': 136}