<commit_before><?php
/**
 * Created by PhpStorm.
 * User: xandros15
 * Date: 2016-06-18
 * Time: 22:47
 */

namespace Xandros15\SlimPagination;

class PageAttribute extends Page implements PageInterface
{
    public function getPageName() : string
    {
        return $this->pageName;
    }

    public function pathFor() : string
    {
        if ($this->isCurrent()) {
            return '#';
        }
        $data = $this->request->getAttribute('route')->getArguments();
        return $this->router->pathFor(
            $this->request->getAttribute('route')->getName(),
            array_merge($data, [$this->paramName => $this->pageNumber]),
            $this->request->getQueryParams()
        );
    }

    public function isCurrent() : bool
    {
        return $this->pageNumber == $this->current;
    }
}<commit_msg>optimise arguments<commit_after><?php
/**
 * Created by PhpStorm.
 * User: xandros15
 * Date: 2016-06-18
 * Time: 22:47
 */

namespace Xandros15\SlimPagination;

class PageAttribute extends Page implements PageInterface
{
    public function getPageName() : string
    {
        return $this->pageName;
    }

    public function pathFor() : string
    {
        if ($this->isCurrent()) {
            return '#';
        }

        $newArguments = [$this->paramName => $this->pageNumber];
        $arguments = !($arguments = $this->request->getAttribute('route')->getArguments()) ? $newArguments : array_merge($arguments,
            $newArguments);

        return $this->router->pathFor(
            $this->request->getAttribute('route')->getName(),
            $arguments,
            $this->request->getQueryParams()
        );
    }

    public function isCurrent() : bool
    {
        return $this->pageNumber == $this->current;
    }
}
{'fraction_non_alphanumeric': 0.14946418499717992, 'fraction_numerical': 0.01804850535815003, 'mean_word_length': 2.4446601941747574, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '1033182', 'n_tokens_mistral': 527, 'n_tokens_neox': 503, 'n_words': 100}