<commit_before><?php

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

namespace Zephir;

use Zephir\Passes\MutateGathererPass;
use Zephir\Statements\BreakStatement;
use Zephir\Statements\ContinueStatement;
use Zephir\Statements\DeclareStatement;
use Zephir\Statements\DoWhileStatement;
use Zephir\Statements\EchoStatement;
use Zephir\Statements\ForStatement;
use Zephir\Statements\IfStatement;
use Zephir\Statements\LetStatement;
use Zephir\Statements\LoopStatement;
use Zephir\Statements\RequireStatement;
use Zephir\Statements\ReturnStatement;
use Zephir\Statements\SwitchStatement;
use Zephir\Statements\ThrowStatement;
use Zephir\Statements\TryCatchStatement;
use Zephir\Statements\UnsetStatement;
use Zephir\Statements\WhileStatement;

/**
 * StatementsBlock.
 *
 * This represents a single basic block in Zephir.
 * A statements block is simply a container of instructions that execute sequentially.
 */
class StatementsBlock
{
    protected $statements;

    protected $unreachable;

    protected $debug = false;

    protected $loop = false;

    protected $mutateGatherer;

    /**
     * @var array|null
     */
    protected $lastStatement;

    /**
     * StatementsBlock constructor.
     *
     * @param array $statements
     */
    public function __construct(array $statements)
    {
        $this->statements = $statements;

        $debug = false;
        if (getenv('ZEPHIR_DEBUG')) {
            // Do not use this feature for typical use case.
            // Enabling debug mode using env var provided only for
            // testing purposes and may be removed in the future.
            // You SHOULD NOT rely on this possibility.
            $debug = getenv('ZEPHIR_DEBUG');
        } elseif ($this->container->has('ZEPHIR_DEBUG')) {
            $debug = $this->container->get('ZEPHIR_DEBUG');
        }

        $this->debug = filter_var($debug, FILTER_VALIDATE_BOOLEAN);
    }

    /**
     * Sets whether the statements blocks belongs to a loop.
     *
     * @param bool $loop
     *
     * @return StatementsBlock
     */
    public function isLoop($loop)
    {
        $this->loop = $loop;

        return $this;
    }

    /**
     * @param CompilationContext $compilationContext
     * @param bool               $unreachable
     * @param int                $branchType
     *
     * @return Branch<commit_msg>Disabling container using for StatementsBlock constructor<commit_after><?php

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

namespace Zephir;

use Zephir\Passes\MutateGathererPass;
use Zephir\Statements\BreakStatement;
use Zephir\Statements\ContinueStatement;
use Zephir\Statements\DeclareStatement;
use Zephir\Statements\DoWhileStatement;
use Zephir\Statements\EchoStatement;
use Zephir\Statements\ForStatement;
use Zephir\Statements\IfStatement;
use Zephir\Statements\LetStatement;
use Zephir\Statements\LoopStatement;
use Zephir\Statements\RequireStatement;
use Zephir\Statements\ReturnStatement;
use Zephir\Statements\SwitchStatement;
use Zephir\Statements\ThrowStatement;
use Zephir\Statements\TryCatchStatement;
use Zephir\Statements\UnsetStatement;
use Zephir\Statements\WhileStatement;

/**
 * StatementsBlock.
 *
 * This represents a single basic block in Zephir.
 * A statements block is simply a container of instructions that execute sequentially.
 */
class StatementsBlock
{
    protected $statements;

    protected $unreachable;

    protected $debug = false;

    protected $loop = false;

    protected $mutateGatherer;

    /**
     * @var array|null
     */
    protected $lastStatement;

    /**
     * StatementsBlock constructor.
     *
     * @param array $statements
     */
    public function __construct(array $statements)
    {
        $this->statements = $statements;

        $debug = false;
        if (getenv('ZEPHIR_DEBUG')) {
            // Do not use this feature for typical use case.
            // Enabling debug mode using env var provided only for
            // testing purposes and may be removed in the future.
            // You SHOULD NOT rely on this possibility.
            $debug = getenv('ZEPHIR_DEBUG');
        }

        // TODO: Add container support
        // elseif ($this->container->has('ZEPHIR_DEBUG')) {
        //     $debug = $this->container->get('ZEPHIR_DEBUG');
        // }

        $this->debug = filter_var($debug, FILTER_VALIDATE_BOOLEAN);
    }

    /**
     * Sets whether the statements blocks belongs to a loop.
     *
     * @param bool $loop
     *
     * @return StatementsBlock
     */
    public function isLoop($loop)
    {
        $this->loop = $loop;

        return $this;
    }

    /**
     * @param CompilationContext $compilationContext
     * @param bool               $unreachable
     * @param int                $branchType
     *
     * @return Branch
{'fraction_non_alphanumeric': 0.09597644749754661, 'fraction_numerical': 0.0, 'mean_word_length': 2.7443056576047025, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '1331518', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1462, 'n_words': 398}