<commit_before><?php

Namespace DesignPatterns\Behavioral\Specification\Specification;

class LengthSpecification extends AbstractSpecification
{
  /** @var int $min */
  protected $min;
  /** @var int $max */
  protected $max;

  /**
   * Check if specification satisfied by given value
   * @param string $value
   * @return bool
   */
  public function isSatisfiedBy($value)
  {
    if ($this->isEmpty($value)) {
      // if value is empty, don't validate it
      return true;
    }
    if (!is_string($value)) {
      return false;
    }
    $strlen = strlen($value);
    $result = true;
    if (isset($this->min)) {
      $result = $strlen >= $this->min;
    }
    if ($result && isset($this->max)) {
      $result = $strlen <= $this->max;
    }
    return $result;
  }

  /**
   * Setup specification params
   * @param array $params
   */
  public function setParams($params)
  {
    $this->min = isset($params['min']) ? (int)$params['min'] : null;
    $this->max = isset($params['max']) ? (int)$params['max'] : null;
  }

}<commit_msg>typos fixes<commit_after><?php

Namespace DesignPatterns\Behavioral\Specification\Specification;

class LengthSpecification extends AbstractSpecification
{
  /** @var int $min */
  protected $min;
  /** @var int $max */
  protected $max;

  /**
   * Check if specification satisfied by given value
   * @param string $value
   * @return bool
   */
  public function isSatisfiedBy($value)
  {
    if ($this->isEmpty($value)) {
      // if value is empty, don't validate it
      return true;
    }
    if (!is_string($value)) {
      return false;
    }
    $strLen = strlen($value);
    $result = true;
    if (isset($this->min)) {
      $result = $strLen >= $this->min;
    }
    if ($result && isset($this->max)) {
      $result = $strLen <= $this->max;
    }
    return $result;
  }

  /**
   * Setup specification params
   * @param array $params
   */
  public function setParams($params)
  {
    $this->min = isset($params['min']) ? (int)$params['min'] : null;
    $this->max = isset($params['max']) ? (int)$params['max'] : null;
  }

}
{'fraction_non_alphanumeric': 0.16778523489932887, 'fraction_numerical': 0.0, 'mean_word_length': 2.8083941605839415, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '4042905', 'n_tokens_mistral': 675, 'n_tokens_neox': 671, 'n_words': 163}