<commit_before><?php namespace OParl\Spec\Jobs;

use OParl\Spec\Model\SpecificationBuild;

class ExtractSpecificationBuildJob extends SpecificationJob
{
    protected $build = null;

  /**
   * ExtractSpecificationBuildJob constructor.
   *
   * @param SpecificationBuild $build
   */
  public function __construct(SpecificationBuild $build)
  {
      $this->build = $build;
  }


    public function handle()
    {
        $extractCmd = sprintf('tar -xvzf %s %s',
      $this->build->tar_gz_storage_path,
      $this->build->extracted_files_storage_path
    );

        $returnValue = exec($extractCmd, $output);

        if ($returnValue !== 0) {
            $output = implode("\n", $output);
            \Log::error("Specification Build archive extraction failed. Full output follows:\n\n{$output}");
        }
    }
}<commit_msg>Replaced exec() with process.<commit_after><?php namespace OParl\Spec\Jobs;

use OParl\Spec\Model\SpecificationBuild;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;

class ExtractSpecificationBuildJob extends SpecificationJob
{
    protected $build = null;

    /**
     * ExtractSpecificationBuildJob constructor.
     *
     * @param SpecificationBuild $build
     */
    public function __construct(SpecificationBuild $build)
    {
        $this->build = $build;
    }


    public function handle()
    {
        $extractCmd = sprintf('tar -xvzf %s %s',
            $this->build->tar_gz_storage_path,
            $this->build->extracted_files_storage_path
        );

        $process = new Process($extractCmd);
        $process->mustRun();

        try {
            $process->run();
        } catch (ProcessFailedException $e) {
            $output = $process->getOutput();
            \Log::error("Specification Build archive extraction failed. Full output follows:\n\n{$output}");
        }
    }
}
{'fraction_non_alphanumeric': 0.12183544303797468, 'fraction_numerical': 0.0005274261603375527, 'mean_word_length': 2.7864271457085827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '5316902', 'n_tokens_mistral': 552, 'n_tokens_neox': 540, 'n_words': 109}