<commit_before><?php namespace TightenCo\Jigsaw;

class PageVariable extends IterableObject
{
    public function addVariables($variables)
    {
        $this->items = collect($this->items)->merge($this->makeIterable($variables))->all();
    }

    public function __call($method, $args)
    {
        $helper = $this->get($method);

        if (! $helper && starts_with($method, 'get')) {
            return $this->_meta->get(camel_case(substr($method, 3)), function () use ($method) {
                throw new \Exception($this->missingHelperError($method));
            });
        }

        if (is_callable($helper)) {
            return $helper->__invoke($this, ...$args);
        } else {
            throw new \Exception($this->missingHelperError($method));
        }
    }

    public function getPath($key = null)
    {
        if (($key || $this->_meta->extending) && $this->_meta->path instanceof IterableObject) {
            return $this->_meta->path->get($key ?: $this->getExtending());
        }

        return $this->_meta->path;
    }

    public function getUrl($key = null)
    {
        if (($key || $this->_meta->extending) && $this->_meta->path instanceof IterableObject) {
            return $this->_meta->url->get($key ?: $this->getExtending());
        }

        return $this->_meta->url;
    }

    protected function missingHelperError($functionName)
    {
        return 'No function named "' . $functionName . '" was found in the file "config.php".';
    }
}<commit_msg>Add getPaths/getUrls to PageVariable to specifically get path/url arrays<commit_after><?php namespace TightenCo\Jigsaw;

class PageVariable extends IterableObject
{
    public function addVariables($variables)
    {
        $this->items = collect($this->items)->merge($this->makeIterable($variables))->all();
    }

    public function __call($method, $args)
    {
        $helper = $this->get($method);

        if (! $helper && starts_with($method, 'get')) {
            return $this->_meta->get(camel_case(substr($method, 3)), function () use ($method) {
                throw new \Exception($this->missingHelperError($method));
            });
        }

        if (is_callable($helper)) {
            return $helper->__invoke($this, ...$args);
        } else {
            throw new \Exception($this->missingHelperError($method));
        }
    }

    public function getPath($key = null)
    {
        if (($key || $this->_meta->extending) && $this->_meta->path instanceof IterableObject) {
            return $this->_meta->path->get($key ?: $this->getExtending());
        }

        return (String) $this->_meta->path;
    }

    public function getPaths()
    {
        return $this->_meta->path;
    }

    public function getUrl($key = null)
    {
        if (($key || $this->_meta->extending) && $this->_meta->path instanceof IterableObject) {
            return $this->_meta->url->get($key ?: $this->getExtending());
        }

        return (String) $this->_meta->url;
    }

    public function getUrls()
    {
        return $this->_meta->url;
    }

    protected function missingHelperError($functionName)
    {
        return 'No function named "' . $functionName . '" was found in the file "config.php".';
    }
}
{'fraction_non_alphanumeric': 0.16373185047883843, 'fraction_numerical': 0.0006178560395427865, 'mean_word_length': 2.4410201912858662, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, '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': '2601478', 'n_tokens_mistral': 934, 'n_tokens_neox': 914, 'n_words': 188}