<commit_before><?php
/**
 * @author JKetelaar
 */
namespace Parabot\BDN\UserBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use Parabot\BDN\UserBundle\Entity\OAuth\Client;
use Parabot\BDN\UserBundle\Repository\ClientRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

class RestController extends FOSRestController{

    /**
     * @Route("/account/oauth/v2/token", name="create_token")
     */
    public function createTokenAction(Request $request){
        if ($this->getUser() == null){
            return $this->redirect("/api/users/login");
        }

        /**
         * @var $clientRepository ClientRepository
         * @var $client Client
         */
        $clientManager = $this->get('fos_oauth_server.client_manager.default');
        $clientRepository = $this->getDoctrine()->getRepository('UserBundle:OAuth\\Client');<commit_msg>[CLEANUP] Removed useless redirect<commit_after><?php
/**
 * @author JKetelaar
 */
namespace Parabot\BDN\UserBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use Parabot\BDN\UserBundle\Entity\OAuth\Client;
use Parabot\BDN\UserBundle\Repository\ClientRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

class RestController extends FOSRestController{

    /**
     * @Route("/account/oauth/v2/token", name="create_token")
     */
    public function createTokenAction(Request $request){
        /**
         * @var $clientRepository ClientRepository
         * @var $client Client
         */
        $clientManager = $this->get('fos_oauth_server.client_manager.default');
        $clientRepository = $this->getDoctrine()->getRepository('UserBundle:OAuth\\Client');
{'fraction_non_alphanumeric': 0.12431626056688215, 'fraction_numerical': 0.000994530084535057, 'mean_word_length': 4.225974025974026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4040541', 'n_tokens_mistral': 579, 'n_tokens_neox': 576, 'n_words': 85}