<commit_before><?php

namespace Annex\TenantBundle\Controller;

use Postmark\PostmarkClient;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        return $this->render('AnnexTenantBundle::dash.html.twig');
    }

    /**
     * @Route("/plans", name="plans")
     */
    public function plansAction(Request $request)
    {
        /** @var \Annex\TenantBundle\Services\TenantService $tenantService */
        $tenantService = $this->get('annex_tenant.tenant_information');

        /** @var \Annex\TenantBundle\Entity\Tenant $tenant */
        $tenant = $tenantService->getTenant($this->get('session')->get('tenantId'));

        if ($tenant->getBrightpearlDataCentre() == 'ws-eu1') {
            $currencyCode = 'gbp';
        } else {
            $currencyCode = 'usd';
        }
        $plans = $tenantService->getPlans(['currency' => $currencyCode]);

        return $this->render('AnnexTenantBundle::plans.html.twig', [
            'plans' => $plans,
            'tenant' => $tenant
        ]);
    }

    /**
     * @Route("/account/not_installed", name="not_installed")
     */
    public function notInstalledAction(Request $request)
    {
        return $this->render('AnnexTenantBundle::not_installed.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..')
        ]);
    }

    /**
     * @Route("logout", name="logout", defaults={"_locale"="en"}, requirements = {"_locale" = "fr|en|nl"})
     */
    public function logoutAction()
    {
        return $this->redirect($this->generateUrl('homepage'));
    }
<commit_msg>Support no tenant for plans page<commit_after><?php

namespace Annex\TenantBundle\Controller;

use Postmark\PostmarkClient;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        return $this->render('AnnexTenantBundle::dash.html.twig');
    }

    /**
     * @Route("/plans", name="plans")
     */
    public function plansAction(Request $request)
    {

        $currencyCode = 'gbp';
        $tenant       = null;

        /** @var \Annex\TenantBundle\Services\TenantService $tenantService */
        $tenantService = $this->get('annex_tenant.tenant_information');

        /** @var \Annex\TenantBundle\Entity\Tenant $tenant */
        if ($this->get('session')->get('tenantId')) {
            $tenant = $tenantService->getTenant($this->get('session')->get('tenantId'));

            if ($tenant->getBrightpearlDataCentre() == 'ws-eu1') {
                $currencyCode = 'gbp';
            } else {
                $currencyCode = 'usd';
            }
        }

        $plans = $tenantService->getPlans(['currency' => $currencyCode]);

        return $this->render('AnnexTenantBundle::plans.html.twig', [
            'plans' => $plans,
            'tenant' => $tenant
        ]);
    }

    /**
     * @Route("/account/not_installed", name="not_installed")
     */
    public function notInstalledAction(Request $request)
    {
        return $this->render('AnnexTenantBundle::not_installed.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..')
        ]);
    }

    /**
     * @Route("logout", name="logout", defaults={"_locale"="en"}, requirements = {"_locale" = "fr|en|nl"})
     */
    public function logoutAction()
    {
        return $this->redirect($this->generateUrl('homepage'));
    }

{'fraction_non_alphanumeric': 0.16662347758486654, 'fraction_numerical': 0.0005182689816014512, 'mean_word_length': 2.7732160312805476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '3375072', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1160, 'n_words': 165}