<commit_before><?php

namespace PlaygroundGame\Service;

use Laminas\Stdlib\ErrorHandler;

class Crossword extends Game
{
  protected $crosswordMapper;
  protected $crosswordWordMapper;
  private $locale;
  private $path;
  private $corePath;

  /**
   * @param  array $data
   * @return \PlaygroundGame\Entity\Game
   */
  public function updateWord(array $data, $word)
  {
    $form = $this->serviceLocator->get('playgroundgame_crosswordword_form');
    $crossword = $this->getGameMapper()->findById($data['crossword_id']);
    $word->setGame($crossword);

    $form->bind($word);
    $form->setData($data);

    if (!$form->isValid()) {
        return false;
    }

    // TODO: Solve the error on binding. The following properties are not binded thru the form
    if ($crossword->getGameType() == "crossword") {
      $word->setLayoutColumn($data['layoutColumn']);
      $word->setLayoutRow($data['layoutRow']);
      $word->setPosition($data['position']);
      $word->setOrientation($data['orientation']);
    }
<commit_msg>word_search<commit_after><?php

namespace PlaygroundGame\Service;

use Laminas\Stdlib\ErrorHandler;

class Crossword extends Game
{
  protected $crosswordMapper;
  protected $crosswordWordMapper;
  private $locale;
  private $path;
  private $corePath;

  /**
   * @param  array $data
   * @return \PlaygroundGame\Entity\Game
   */
  public function updateWord(array $data, $word)
  {
    $form = $this->serviceLocator->get('playgroundgame_crosswordword_form');
    $crossword = $this->getGameMapper()->findById($data['crossword_id']);
    $word->setGame($crossword);

    $form->bind($word);
    $form->setData($data);

    if (!$form->isValid()) {
        return false;
    }

    // TODO: Solve the error on binding. The following properties are not binded thru the form
    if ($crossword->getGameType() == "crossword" || $crossword->getGameType() == "word_search") {
      $word->setLayoutColumn($data['layoutColumn']);
      $word->setLayoutRow($data['layoutRow']);
      $word->setPosition($data['position']);
      $word->setOrientation($data['orientation']);
    }

{'fraction_non_alphanumeric': 0.15922053231939162, 'fraction_numerical': 0.0, 'mean_word_length': 4.060096153846154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, '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': '6115764', 'n_tokens_mistral': 652, 'n_tokens_neox': 641, 'n_words': 126}