<commit_before><?php
abstract class SLIRImage
{
  /**
   * @var string Path to file
   */
  protected $path;

  /**
   * @var string Path to original file
   */
  protected $originalPath;

  /**
   * @var integer quality to render image at
   */
  protected $quality;

  /**
   * @var string background color in hex
   */
  protected $background;

  /**
   * @var float amount to sharpen
   */
  protected $sharpeningFactor;

  /**
   * @var boolean
   */
  protected $progressive;

  /**
   * @var string specified cropper to use
   */
  protected $cropper;

  /**
   * @var array information about the image
   */
  protected $info;

  /**
   * Mime types
   * @var array
   * @since 2.0
   */
  private $mimeTypes  = array(
    'JPEG'  => array(
      'image/jpeg'  => 1,
    ),
    'GIF' => array(
      'image/gif'   => 1,
    ),
    'PNG' => array(
      'image/png'   => 1,
      'image/x-png' => 1,
    ),
    'BMP' => array(
      'image/bmp'       => 1,
      'image/x-ms-bmp'  => 1,
    ),
  );

  /**
   * @param string $path
   * @return void
   */
  public function __construct($path = null)
  {
    if ($path !== null) {
      $this->setPath($path);
      $this->setOriginalPath($path);
    }
  }

  /**
   * @return void
   */
  public function __destruct()
  {
    unset(
        $this->path,
        $this->originalPath,
        $this->info
    );
  }

  /**
   * Gets a hash that represents the properties of the image.
   * 
   * Used for caching.
   * 
   * @param $infosToInclude
   * @return string
   * @since 2.0
   */
  public function getHash(array $infosToInclude = array())
  {
    $infos  = array(
      $this->getOriginalPath(),
      $this->getBackground(),
      $this->getSharpeningFactor(),
      $this->getProgressive(),
      $this->getInfo(),
      $this->getCropper(),
    );

    $infos = array_merge($infos, $infosToInclude);

    return hash('md4', serialize($infos));
  }

  /**
   * Sets the path of the file
   * @param string $path
   * @return SLIRImageLibrary
   * @since 2.0
   */
  final public function setPath($path)<commit_msg>Added quality to hash parameters<commit_after><?php
abstract class SLIRImage
{
  /**
   * @var string Path to file
   */
  protected $path;

  /**
   * @var string Path to original file
   */
  protected $originalPath;

  /**
   * @var integer quality to render image at
   */
  protected $quality;

  /**
   * @var string background color in hex
   */
  protected $background;

  /**
   * @var float amount to sharpen
   */
  protected $sharpeningFactor;

  /**
   * @var boolean
   */
  protected $progressive;

  /**
   * @var string specified cropper to use
   */
  protected $cropper;

  /**
   * @var array information about the image
   */
  protected $info;

  /**
   * Mime types
   * @var array
   * @since 2.0
   */
  private $mimeTypes  = array(
    'JPEG'  => array(
      'image/jpeg'  => 1,
    ),
    'GIF' => array(
      'image/gif'   => 1,
    ),
    'PNG' => array(
      'image/png'   => 1,
      'image/x-png' => 1,
    ),
    'BMP' => array(
      'image/bmp'       => 1,
      'image/x-ms-bmp'  => 1,
    ),
  );

  /**
   * @param string $path
   * @return void
   */
  public function __construct($path = null)
  {
    if ($path !== null) {
      $this->setPath($path);
      $this->setOriginalPath($path);
    }
  }

  /**
   * @return void
   */
  public function __destruct()
  {
    unset(
        $this->path,
        $this->originalPath,
        $this->info
    );
  }

  /**
   * Gets a hash that represents the properties of the image.
   * 
   * Used for caching.
   * 
   * @param $infosToInclude
   * @return string
   * @since 2.0
   */
  public function getHash(array $infosToInclude = array())
  {
    $infos  = array(
      $this->getOriginalPath(),
      $this->getBackground(),
      $this->getSharpeningFactor(),
      $this->getProgressive(),
      $this->getInfo(),
      $this->getCropper(),
      $this->getQuality()
    );

    $infos = array_merge($infos, $infosToInclude);

    return hash('md4', serialize($infos));
  }

  /**
   * Sets the path of the file
   * @param string $path
   * @return SLIRImageLibrary
   * @since 2.0
   */
  final public function setPath($path)
{'fraction_non_alphanumeric': 0.15624256837098693, 'fraction_numerical': 0.006183115338882283, 'mean_word_length': 2.036823104693141, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, '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': '1657998', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1427, 'n_words': 344}