<commit_before><?php

namespace Rizeway\Anchour\Step;

use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;

class StepRunner
{

    /**
     * The steps
     * @var Step[]
     */
    protected $steps;

    protected $application;

    /**
     * @param Step[] $steps
     */
    public function __construct($application, array $steps)
    {
        $this->application = $application;
        $this->steps = $steps;
    }

    /**
     * @param \Symfony\Component\Console\Output\OutputInterface $output
     */
    public function run(InputInterface $input, OutputInterface $output)
    {
        $status = 0;

        foreach ($this->steps as $step) {
            if ($step instanceof \Rizeway\Anchour\Step\StepApplicationAware) {
                $step->setApplication($this->application);
            }

            $status += $step->run($input, $output);
        }

        return $status;
    }
}<commit_msg>Stop when a step exit code > 0<commit_after><?php

namespace Rizeway\Anchour\Step;

use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputInterface;

class StepRunner
{

    /**
     * The steps
     * @var Step[]
     */
    protected $steps;

    protected $application;

    /**
     * @param Step[] $steps
     */
    public function __construct($application, array $steps)
    {
        $this->application = $application;
        $this->steps = $steps;
    }

    /**
     * @param \Symfony\Component\Console\Output\OutputInterface $output
     */
    public function run(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->steps as $step) {
            if ($step instanceof \Rizeway\Anchour\Step\StepApplicationAware) {
                $step->setApplication($this->application);
            }

            $status = $step->run($input, $output);
            if ( $status != 0 )
            {
                return $status;
            }
        }

        return 0;
    }
}
{'fraction_non_alphanumeric': 0.12773359840954274, 'fraction_numerical': 0.0019880715705765406, 'mean_word_length': 2.0874233128834354, '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': '4809872', 'n_tokens_mistral': 585, 'n_tokens_neox': 565, 'n_words': 117}