<commit_before><?php

/**
 * Class Zigra_Registry
 *
 * This was born as a simple Registry object, from Zigra version 0.9 Registry methods are both static and non static.
 * Why? Backward compatibility WTF! Beware lot of (fully tested) 💩💩💩💩 code below 💩💩💩💩
 *
 * @method get($key)
 * @method set($key, $value)
 * @method add($key, $value)
 * @method has($key)
 * @method getAll()
 * @method getKeys()
 */
class Zigra_Registry
{
    protected static $instance;

    /**
     * @var array
     */
    protected $pool = [];

    /**
     * @return Zigra_Registry
     */
    public static function getInstance()
    {
        if (self::$instance === null) {
            self::$instance = new static();
        }

        return self::$instance;
    }

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        // Note: value of $name is case sensitive.
        //echo "Calling object method '$name' " . implode(', ', $arguments) . "\n";
        switch ($name) {
            case 'get':
            case 'set':
            case 'add':
            case 'has':
            case 'getAll':
            case 'getKeys':
            case 'clear':
                $privateMethod = 'private' . ucfirst($name);
                return call_user_func_array([static::class, $privateMethod], $arguments);
                break;
            default:
                throw new \RuntimeException('Method not implemented');
        }
    }

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public static function __callStatic($name, $arguments)
    {
        // Note: value of $name is case sensitive.
        //echo "Calling static method '$name' " . implode(', ', $arguments) . "\n";
        switch ($name) {
            case 'get':
            case 'set':
            case 'add':
            case 'has':
            case 'getAll':
            case 'getKeys':
            case 'clear':
                $instance = static::getInstance();
                $privateMethod = 'private' . ucfirst($name);
                return call_user_func_array([$instance, $privateMethod], $arguments);
                break;
            default:
                throw new \RuntimeException('Method not implemented');
        }
    }

    /**
     * Get key's value as if key is an object property
     * @param string $key the variable's name
     *
     * @return mixed
     */<commit_msg>Remove useless break after return<commit_after><?php

/**
 * Class Zigra_Registry
 *
 * This was born as a simple Registry object, from Zigra version 0.9 Registry methods are both static and non static.
 * Why? Backward compatibility WTF! Beware lot of (fully tested) 💩💩💩💩 code below 💩💩💩💩
 *
 * @method get($key)
 * @method set($key, $value)
 * @method add($key, $value)
 * @method has($key)
 * @method getAll()
 * @method getKeys()
 * @method clear()
 */
class Zigra_Registry
{
    protected static $instance;

    /**
     * @var array
     */
    protected $pool = [];

    /**
     * @return Zigra_Registry
     */
    public static function getInstance()
    {
        if (self::$instance === null) {
            self::$instance = new static();
        }

        return self::$instance;
    }

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        // Note: value of $name is case sensitive.
        //echo "Calling object method '$name' " . implode(', ', $arguments) . "\n";
        switch ($name) {
            case 'get':
            case 'set':
            case 'add':
            case 'has':
            case 'getAll':
            case 'getKeys':
            case 'clear':
                $privateMethod = 'private' . ucfirst($name);

                return call_user_func_array([static::class, $privateMethod], $arguments);
            default:
                throw new \RuntimeException('Method not implemented');
        }
    }

    /**
     * @param string $name
     * @param array $arguments
     * @return mixed
     */
    public static function __callStatic($name, $arguments)
    {
        // Note: value of $name is case sensitive.
        //echo "Calling static method '$name' " . implode(', ', $arguments) . "\n";
        switch ($name) {
            case 'get':
            case 'set':
            case 'add':
            case 'has':
            case 'getAll':
            case 'getKeys':
            case 'clear':
                $instance = static::getInstance();
                $privateMethod = 'private' . ucfirst($name);

                return call_user_func_array([$instance, $privateMethod], $arguments);
            default:
                throw new \RuntimeException('Method not implemented');
        }
    }

    /**
     * Get key's value as if key is an object property
     * @param string $key the variable's name
     *
     * @return mixed
     */
{'fraction_non_alphanumeric': 0.13138393751251753, 'fraction_numerical': 0.0008011215701982776, 'mean_word_length': 1.7729039422543031, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5249777', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1388, 'n_words': 420}