<commit_before><?php

/**
 * Nip Framework.
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category   Nip
 *
 * @copyright  2009 Nip Framework
 *
 * @version    SVN: $Id: Flash.php 14 2009-04-13 11:24:22Z victor.stanciu $
 */
class Nip_Flash
{
    protected $previous = [];
    protected $next = [];
    protected $session_var = 'flash-data';

    public function __construct()
    {
        $this->read();
    }

    public function read()
    {
        $data = $_SESSION[$this->session_var];
        if (!is_null($data)) {
            if (is_array($data)) {
                $this->previous = $data;
            }
            unset($_SESSION[$this->session_var]);
        }
    }

    /**
     * Returns static instance.
     *
     * @return self
     */
    public static function &instance()
    {
        static $instance;
        if (!($instance instanceof self)) {
            $instance = new self();
        }

        return $instance;
    }

    public function has($var)
    {
        return isset($this->previous[trim($var)]) ? true : false;
    }

    public function get($var)<commit_msg>fix notice from flash memory<commit_after><?php

/**
 * Nip Framework.
 *
 * LICENSE
 *
 * This source file is subject to the license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category   Nip
 *
 * @copyright  2009 Nip Framework
 *
 * @version    SVN: $Id: Flash.php 14 2009-04-13 11:24:22Z victor.stanciu $
 */
class Nip_Flash
{
    protected $previous = [];
    protected $next = [];
    protected $session_var = 'flash-data';

    public function __construct()
    {
        $this->read();
    }

    public function read()
    {
        $data = isset($_SESSION[$this->session_var]) ? $_SESSION[$this->session_var] : null;
        if (!is_null($data)) {
            if (is_array($data)) {
                $this->previous = $data;
            }
            unset($_SESSION[$this->session_var]);
        }
    }

    /**
     * Returns static instance.
     *
     * @return self
     */
    public static function &instance()
    {
        static $instance;
        if (!($instance instanceof self)) {
            $instance = new self();
        }

        return $instance;
    }

    public function has($var)
    {
        return isset($this->previous[trim($var)]) ? true : false;
    }

    public function get($var)
{'fraction_non_alphanumeric': 0.13634496919917866, 'fraction_numerical': 0.01642710472279261, 'mean_word_length': 1.9852941176470589, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '6835089', 'n_tokens_mistral': 767, 'n_tokens_neox': 720, 'n_words': 187}