<commit_before><?php
/**
 * This file is part of the ImageTransform package.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ImageTransform;

use ImageTransform\Image;

/**
 * Transformation class.
 *
 * @author <NAME> <<EMAIL>>
 */
class Transformation
{
  /**
   * @var array $transformations transformations that are available for callback
   * @static
   */
  protected static $transformations = array();

  /**
   * @var array $stack Program stack of called transformations
   */
  protected $stack = array();

  /**
   * Get a list of currently called transformations
   *
   * @return array List of currently called transformation
   */
  public function getStack()
  {
    return $this->stack;
  }

  /**
   * Process the stack of transformation on the given Image instance
   *
   * @param \ImageTransform\Image $image Image instance to be processed
   */
  public function process(\ImageTransform\Image $image)
  {
    foreach ($this->stack as $entry)
    {
      extract($entry);

      array_unshift($arguments, $image);

      call_user_func_array($callback, $arguments);
    }
  }

  /**
   * Shortcut for \ImageTransform\Transformation::process()
   *
   * @param \ImageTransform\Image $image Image instance to be processed
   */
  public function __invoke(Image $image)
  {
    $this->process($image);
  }<commit_msg>Avoided the use of extract()<commit_after><?php
/**
 * This file is part of the ImageTransform package.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ImageTransform;

use ImageTransform\Image;

/**
 * Transformation class.
 *
 * @author <NAME> <<EMAIL>>
 */
class Transformation
{
  /**
   * @var array $transformations transformations that are available for callback
   * @static
   */
  protected static $transformations = array();

  /**
   * @var array $stack Program stack of called transformations
   */
  protected $stack = array();

  /**
   * Get a list of currently called transformations
   *
   * @return array List of currently called transformation
   */
  public function getStack()
  {
    return $this->stack;
  }

  /**
   * Process the stack of transformation on the given Image instance
   *
   * @param \ImageTransform\Image $image Image instance to be processed
   */
  public function process(\ImageTransform\Image $image)
  {
    foreach ($this->stack as $entry)
    {
      $callback = $entry['callback'];
      $arguments = $entry['arguments'];

      array_unshift($arguments, $image);

      call_user_func_array($callback, $arguments);
    }
  }

  /**
   * Shortcut for \ImageTransform\Transformation::process()
   *
   * @param \ImageTransform\Image $image Image instance to be processed
   */
  public function __invoke(Image $image)
  {
    $this->process($image);
  }
{'fraction_non_alphanumeric': 0.11484217595701814, 'fraction_numerical': 0.0, 'mean_word_length': 3.207627118644068, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '394824', 'n_tokens_mistral': 834, 'n_tokens_neox': 816, 'n_words': 273}