<commit_before><?php
/*
 * This file is part of the ************************ package.
 * ##########################################################
 * #   ____                          ______  _   _ ______   #
 * #  /     \       ___  _ __  _   _ | ___ \| | | || ___ \  #
 * # |   (  ||(_)| / _ \| '__|| | | || |_/ /| |_| || |_/ /  #
 * #  \____/ |___||  __/| |   | |_| ||  __/ |  _  ||  __/   #
 * #       \__   | \___ |_|    \__  || |    | | | || |      #
 * #     Query Yet Simple      __/  |\_|    |_| |_|\_|      #
 * #                          |___ /  Since 2010.10.03      #
 * ##########################################################
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2018 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Queryyetsimple\Flow;

/**
 * 流程控制复用
 *
 * @author <NAME> <<EMAIL>>
 * @package $$
 * @since 2017.04.13
 * @version 1.0
 */
trait TControl
{

    /**
     * 逻辑代码是否处于条件表达式中
     *
     * @var boolean
     */
    protected $inFlowControl = false;

    /**
     * 条件表达式是否为真
     *
     * @var boolean
     */
    protected $isFlowcontrolTrue = false;

    /**
     * 条件语句 ifs
     *
     * @param boolean $value
     * @return $this
     */
    public function ifs($value = false)
    {
        return $this->setTControl(true, $value);
    }

    /**
     * 条件语句 elseIfs
     *
     * @param boolean $value
     * @return $this
     */
    public function elseIfs($value = false)
    {
        return $this->setTControl(true, $value);
    }

    /**
     * 条件语句 elses
     *
     * @return $this
     */
    public function elses()
    {
        return $this->setTControl(true, ! $this->getTControl()[1]);
    }

    /**
     * 条件语句 endIfs
     *
     * @return $this
     */
    public function endIfs()
    {
        return $this->setTControl(false, false);
    }

    /**
     * 设置当前条件表达式状态
     *
     * @param boolean $inFlowControl
     * @param boolean $isFlowcontrolTrue
     * @return $this
     */
    public function setTControl($inFlowControl, $isFlowcontrolTrue)
    {
        $this->inFlowControl = $inFlowControl;
        $this->isFlowcontrolTrue = $isFlowcontrolTrue;

        return $this;
    }

    /**
     * 获取当前条件表达式状态
     *
     * @return array
     */
    public function getTControl()
    {
        return [
            $this->inFlowControl,
            $this->isFlowcontrolTrue
        ];
    }

    /**
     * 验证一下条件表达式是否通过
     *
     * @return boolean
     */
    public function checkTControl()
    {
        return $this->inFlowControl && ! $this->isFlowcontrolTrue;
    }

    /**
     * 占位符
     *
     * @param string $method
     * @return boolean
     */
    public function placeholderTControl($method)
    {
        return in_array($method, [
            'placeholder',
            'foobar'
        ]);<commit_msg>http JsonResponse<commit_after><?php
/*
 * This file is part of the ************************ package.
 * ##########################################################
 * #   ____                          ______  _   _ ______   #
 * #  /     \       ___  _ __  _   _ | ___ \| | | || ___ \  #
 * # |   (  ||(_)| / _ \| '__|| | | || |_/ /| |_| || |_/ /  #
 * #  \____/ |___||  __/| |   | |_| ||  __/ |  _  ||  __/   #
 * #       \__   | \___ |_|    \__  || |    | | | || |      #
 * #     Query Yet Simple      __/  |\_|    |_| |_|\_|      #
 * #                          |___ /  Since 2010.10.03      #
 * ##########################################################
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2018 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Queryyetsimple\Flow;

/**
 * 流程控制复用
 *
 * @author <NAME> <<EMAIL>>
 * @package $$
 * @since 2017.04.13
 * @version 1.0
 */
trait TControl
{

    /**
     * 逻辑代码是否处于条件表达式中
     *
     * @var boolean
     */
    protected $inFlowControl = false;

    /**
     * 条件表达式是否为真
     *
     * @var boolean
     */
    protected $isFlowControlTrue = false;

    /**
     * 条件语句 ifs
     *
     * @param boolean $value
     * @return $this
     */
    public function ifs($value = false)
    {
        return $this->setTControl(true, $value);
    }

    /**
     * 条件语句 elseIfs
     *
     * @param boolean $value
     * @return $this
     */
    public function elseIfs($value = false)
    {
        return $this->setTControl(true, $value);
    }

    /**
     * 条件语句 elses
     *
     * @return $this
     */
    public function elses()
    {
        return $this->setTControl(true, ! $this->getTControl()[1]);
    }

    /**
     * 条件语句 endIfs
     *
     * @return $this
     */
    public function endIfs()
    {
        return $this->setTControl(false, false);
    }

    /**
     * 设置当前条件表达式状态
     *
     * @param boolean $inFlowControl
     * @param boolean $isFlowControlTrue
     * @return $this
     */
    public function setTControl($inFlowControl, $isFlowControlTrue)
    {
        $this->inFlowControl = $inFlowControl;
        $this->isFlowControlTrue = $isFlowControlTrue;

        return $this;
    }

    /**
     * 获取当前条件表达式状态
     *
     * @return array
     */
    public function getTControl()
    {
        return [
            $this->inFlowControl,
            $this->isFlowControlTrue
        ];
    }

    /**
     * 验证一下条件表达式是否通过
     *
     * @return boolean
     */
    public function checkTControl()
    {
        return $this->inFlowControl && ! $this->isFlowControlTrue;
    }

    /**
     * 占位符
     *
     * @param string $method
     * @return boolean
     */
    public function placeholderTControl($method)
    {
        return in_array($method, [
            'placeholder',
            'foobar'
        ]);
{'fraction_non_alphanumeric': 0.18377650622685965, 'fraction_numerical': 0.009087849209020532, 'mean_word_length': 1.6650224215246636, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, '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': '6362703', 'n_tokens_mistral': 2067, 'n_tokens_neox': 2046, 'n_words': 349}