<commit_before><?php

namespace StorageBins;

class ArrayBin
{
    const GETTER_REGEX = '/^get(.*)$/';

    private $array;
    private $is_camelcase;

    public function __construct($array, $is_camelcase = true)
    {
        $this->array = $array;
        $this->is_camelcase = $is_camelcase;
    }

    public function __call($name, $arguments)
    {
        $result = preg_match(self::GETTER_REGEX, $name, $matches);

        if (false === $result) {
            throw new \RuntimeException('Ups, something went wrong');
        } elseif (0 === $result) {
            throw new \BadMethodCallException();
        } elseif (1 === $result) {
            $attribute_nane = ($this->is_camelcase)
                ? lcfirst($matches[1])
                : $this->camelCaseToUnderscore($matches[1]);

            if (!array_key_exists($attribute_nane, $this->array)) {
                throw new \BadMethodCallException();
            }

            $attribute_value = $this->array[$attribute_nane];
<commit_msg>Adds @return to ArrayBin::_call method<commit_after><?php

namespace StorageBins;

class ArrayBin
{
    const GETTER_REGEX = '/^get(.*)$/';

    private $array;
    private $is_camelcase;

    public function __construct($array, $is_camelcase = true)
    {
        $this->array = $array;
        $this->is_camelcase = $is_camelcase;
    }

    /**
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        $result = preg_match(self::GETTER_REGEX, $name, $matches);

        if (false === $result) {
            throw new \RuntimeException('Ups, something went wrong');
        } elseif (0 === $result) {
            throw new \BadMethodCallException();
        } elseif (1 === $result) {
            $attribute_nane = ($this->is_camelcase)
                ? lcfirst($matches[1])
                : $this->camelCaseToUnderscore($matches[1]);

            if (!array_key_exists($attribute_nane, $this->array)) {
                throw new \BadMethodCallException();
            }

            $attribute_value = $this->array[$attribute_nane];

{'fraction_non_alphanumeric': 0.14148219441770934, 'fraction_numerical': 0.0038498556304138597, 'mean_word_length': 2.3, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1628718', 'n_tokens_mistral': 642, 'n_tokens_neox': 630, 'n_words': 124}