<commit_before><?php

namespace NordUa\VocabularyBundle\Controller;

use NordUa\VocabularyBundle\Document\Vocabulary;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use NordUa\VocabularyBundle\Form\Type\VocabularyType;


/**
 * @Route("/manage/vocabulary")
 */
class ManageController extends Controller
{

  /**
   * @Route("/{type}/{lang}", name="vocabulary_manage_index")
   */
  public function indexValues($type, $lang, Request $request)
  {
    $query = $this->getDocumentManager()
      ->getRepository('VocabularyBundle:Vocabulary')->createQueryBuilder()
      ->field('type')->equals($type)
      ->field('lang')->equals($lang)
      ->sort('slug', 'DESC')->getQuery();

    $paginator = $this->get('knp_paginator');
    $pagination = $paginator->paginate($query, $request->get('page', 1), 2);
    $pagination->setUsedRoute('vocabulary_manage_index');
    $pagination->setPageRange(10);

    return $this->render('VocabularyBundle:Manage:index.html.twig', [
      'docs' => $pagination, 'type' => $type, 'lang' => $lang
    ]);
  }

  /**
   * @Route("/{type}/{lang}/new", name="vocabulary_manage_new")
   * @Template("VocabularyBundle:Manage:edit.html.twig")
   */
  public function newAction($type, $lang, Request $request)
  {
    $object = new Vocabulary();
    $object->setLang($lang)
      ->setType($type);

    $this->getDocumentManager()->persist($object);

    return $this->processForm($object, $type, $lang);
  }

  /**
   * @Route("/{type}/{lang}/{id}/edit", name="vocabulary_manage_edit")
   * @Template("VocabularyBundle:Manage:edit.html.twig")
   */
  public function editAction($type, $lang, $id)<commit_msg>Items on page count fix<commit_after><?php

namespace NordUa\VocabularyBundle\Controller;

use NordUa\VocabularyBundle\Document\Vocabulary;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use NordUa\VocabularyBundle\Form\Type\VocabularyType;


/**
 * @Route("/manage/vocabulary")
 */
class ManageController extends Controller
{

  /**
   * @Route("/{type}/{lang}", name="vocabulary_manage_index")
   */
  public function indexValues($type, $lang, Request $request)
  {
    $query = $this->getDocumentManager()
      ->getRepository('VocabularyBundle:Vocabulary')->createQueryBuilder()
      ->field('type')->equals($type)
      ->field('lang')->equals($lang)
      ->sort('slug', 'DESC')->getQuery();

    $paginator = $this->get('knp_paginator');
    $pagination = $paginator->paginate($query, $request->get('page', 1), 20);
    $pagination->setUsedRoute('vocabulary_manage_index');
    $pagination->setPageRange(10);

    return $this->render('VocabularyBundle:Manage:index.html.twig', [
      'docs' => $pagination, 'type' => $type, 'lang' => $lang
    ]);
  }

  /**
   * @Route("/{type}/{lang}/new", name="vocabulary_manage_new")
   * @Template("VocabularyBundle:Manage:edit.html.twig")
   */
  public function newAction($type, $lang, Request $request)
  {
    $object = new Vocabulary();
    $object->setLang($lang)
      ->setType($type);

    $this->getDocumentManager()->persist($object);

    return $this->processForm($object, $type, $lang);
  }

  /**
   * @Route("/{type}/{lang}/{id}/edit", name="vocabulary_manage_edit")
   * @Template("VocabularyBundle:Manage:edit.html.twig")
   */
  public function editAction($type, $lang, $id)
{'fraction_non_alphanumeric': 0.18201814682430575, 'fraction_numerical': 0.002474566950783613, 'mean_word_length': 4.783783783783784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '2111761', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1175, 'n_words': 161}