<commit_before><?php

namespace Progeny\Controller;

use Progeny\Entity\Progeny;
use Zend\Config\Writer\Json;
use Zend\Db\Sql\Ddl\Column\Date;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;

class ProgenyController extends AbstractActionController
{
 protected $facebook = null;
 protected $fb_id = null;
 protected $progeny_table;

 public function indexAction()
 {
  return new ViewModel();
 }

 public function AddProgenyAction()
 {
  $first_name = $this->params()->fromQuery('first_name');
  $birth_date = $this->params()->fromQuery('birth_date');

  $birth_date_validator = Progeny::getBirthDateValidator();
  $first_name_validator = Progeny::getFirstNameValidator();

  if (!$birth_date_validator->isValid($birth_date))
   return new JsonModel(array('success' => false, 'messages' => $birth_date_validator->getMessages()));

  if(!$first_name_validator->isValid($first_name))
   return new JsonModel(array('success' => false, 'messages' => $first_name_validator->getMessages()));

  if (!$this->getProgenyTable()->checkFirstNameUnique($first_name))
   return new JsonModel(array('success' => false, 'message' => 'You have already added a child with this name'));

  $data = array('first_name' => $first_name, 'birth_date' =>  date_create($birth_date));

  $progeny = $this->getProgenyTable()->newProgeny($data);

  return new JsonModel(array('success' => true, $progeny->toArray()));
 }

 public function getProgeniesAction()
 {
  return new JsonModel(array('success' => true, 'progenies' => $this->getProgenyTable()->getProgeniesArray()));
 }

 public function getProgenyAction()
 {
  $id = $this->params()->fromQuery('id');
<commit_msg>updates on the progeny class<commit_after><?php

namespace Progeny\Controller;

use Progeny\Entity\Progeny;
use Zend\Config\Writer\Json;
use Zend\Db\Sql\Ddl\Column\Date;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;

class ProgenyController extends AbstractActionController
{
 protected $facebook = null;
 protected $fb_id = null;
 protected $progeny_table;

 public function indexAction()
 {
  return new ViewModel();
 }

 public function AddProgenyAction()
 {
  $first_name = $this->params()->fromQuery('first_name');
  $birth_date = $this->params()->fromQuery('birth_date');

  $birth_date_validator = Progeny::getBirthDateValidator();
  $first_name_validator = Progeny::getFirstNameValidator();

  if (!$birth_date_validator->isValid($birth_date))
   return new JsonModel(array('success' => false, 'messages' => $birth_date_validator->getMessages()));

  if(!$first_name_validator->isValid($first_name))
   return new JsonModel(array('success' => false, 'messages' => $first_name_validator->getMessages()));

  if (!$this->getProgenyTable()->checkFirstNameUnique($first_name))
   return new JsonModel(array('success' => false, 'message' => 'You have already added a child with this name'));

  $data = array('first_name' => $first_name, 'birth_date' =>  date_create($birth_date));

  $progeny = $this->getProgenyTable()->newProgeny($data);

  return new JsonModel(array('success' => true, 'progeny' => $progeny->toArray()));
 }

 public function getProgeniesAction()
 {
  return new JsonModel(array('success' => true, 'progenies' => $this->getProgenyTable()->getProgeniesArray()));
 }

 public function getProgenyAction()
 {
  $id = $this->params()->fromQuery('id');

{'fraction_non_alphanumeric': 0.15780141843971632, 'fraction_numerical': 0.0, 'mean_word_length': 6.4070021881838075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 60, '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': '2650601', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1061, 'n_words': 203}