<commit_before><?php
namespace BenTools\ETL;

use BenTools\ETL\Interfaces\ContextInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LoggerInterface;

class Context implements LoggerAwareInterface, ContextInterface, \ArrayAccess {

    use LoggerAwareTrait;

    /**
     * @var ETLBag
     */
    protected $extractedData;
    protected $transformedData;
    protected $currentETL;
    protected $shouldSkip  =   false;
    protected $shouldBreak =   false;
    protected $shouldHalt  =   false;
    protected $shouldFlush =   false;
    protected $identifier;
    protected $extractorIdentifierCallable;
    protected $transformerIdentifierCallable;
    protected $container   = [];

    /**
     * @param LoggerInterface $logger
     */
    public function __construct(LoggerInterface $logger) {
        $this->setLogger($logger);
    }

    /**
     * @inheritDoc
     */
    public function getExtractedData() {
        return $this->extractedData;
    }

    /**
     * @inheritDoc
     */
    public function getTransformedData() {
        return $this->transformedData;
    }

    /**
     * @return ETLBag
     */
    public function getCurrentETL() {
        return $this->currentETL;
    }

    /**
     * @param ETLBag $currentETL
     * @return $this - Provides Fluent Interface
     */
    public function setCurrentETL(ETLBag $currentETL) {
        $this->currentETL = $currentETL;
        return $this;
    }

    /**
     * Indicates if the ETL should skip this row.
     * @return boolean
     */
    public function shouldSkip($value = null) {
        if (func_num_args() > 0)
            $this->shouldSkip   =   $value;
        return $this->shouldSkip;
    }

    /**
     * Indicates if the ETL should stop and go flushing.
     * @return boolean
     */
    public function shouldBreak($value = null) {
        if (func_num_args() > 0)
            $this->shouldBreak  =   $value;
        return $this->shouldBreak;
    }

    /**
     * Indicates if the ETL should stop and not flush anything.
     * @return boolean
     */
    public function shouldHalt($value = null) {
        if (func_num_args() > 0)
            $this->shouldHalt   =   $value;
        return $this->shouldHalt;
    }

    /**
     * Indicates if the ETL should flush.
     * @return boolean
     */
    public function shouldFlush($value = null) {
        if (func_num_args() > 0)
            $this->shouldFlush   =   $value;
        return $this->shouldFlush;<commit_msg>Context constructor<commit_after><?php
namespace BenTools\ETL;

use BenTools\ETL\Interfaces\ContextInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LoggerInterface;

class Context implements LoggerAwareInterface, ContextInterface, \ArrayAccess {

    use LoggerAwareTrait;

    /**
     * @var ETLBag
     */
    protected $extractedData;
    protected $transformedData;
    protected $currentETL;
    protected $shouldSkip  = false;
    protected $shouldBreak = false;
    protected $shouldHalt  = false;
    protected $shouldFlush = false;
    protected $identifier;
    protected $extractorIdentifierCallable;
    protected $transformerIdentifierCallable;
    protected $container   = [];

    /**
     * @param LoggerInterface $logger
     * @param callable $extractorIdentifierCallable
     * @param callable $transformerIdentifierCallable
     */
    public function __construct(LoggerInterface $logger, callable $extractorIdentifierCallable = null, callable $transformerIdentifierCallable = null) {
        $this->setLogger($logger);
        $this->extractorIdentifierCallable   = $extractorIdentifierCallable;
        $this->transformerIdentifierCallable = $transformerIdentifierCallable;
    }

    /**
     * @inheritDoc
     */
    public function getExtractedData() {
        return $this->extractedData;
    }

    /**
     * @inheritDoc
     */
    public function getTransformedData() {
        return $this->transformedData;
    }

    /**
     * @return ETLBag
     */
    public function getCurrentETL() {
        return $this->currentETL;
    }

    /**
     * @param ETLBag $currentETL
     * @return $this - Provides Fluent Interface
     */
    public function setCurrentETL(ETLBag $currentETL) {
        $this->currentETL = $currentETL;
        return $this;
    }

    /**
     * Indicates if the ETL should skip this row.
     * @return boolean
     */
    public function shouldSkip($value = null) {
        if (func_num_args() > 0)
            $this->shouldSkip = $value;
        return $this->shouldSkip;
    }

    /**
     * Indicates if the ETL should stop and go flushing.
     * @return boolean
     */
    public function shouldBreak($value = null) {
        if (func_num_args() > 0)
            $this->shouldBreak = $value;
        return $this->shouldBreak;
    }

    /**
     * Indicates if the ETL should stop and not flush anything.
     * @return boolean
     */
    public function shouldHalt($value = null) {
        if (func_num_args() > 0)
            $this->shouldHalt = $value;
        return $this->shouldHalt;
    }

    /**
     * Indicates if the ETL should flush.
     * @return boolean
     */
    public function shouldFlush($value = null) {
        if (func_num_args() > 0)
            $this->shouldFlush = $value;
        return $this->shouldFlush;
{'fraction_non_alphanumeric': 0.10551917680074836, 'fraction_numerical': 0.0014967259120673526, 'mean_word_length': 2.372870662460568, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '6585576', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1547, 'n_words': 366}