<commit_before><?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 11.09.2015
 * Time: 12:37
 */

namespace Anonym\Components\Database\Pagination;

/**
 * Class Paginator
 * @package Anonym\Components\Database\Pagination
 */
class Paginator extends PaginationFactory
{


    /**
     * determine if there are more page in datas
     *
     * @var int
     */
    protected $hasMore;

    /**
     * create a new instance and register options and more variables
     *
     * @param mixed $items
     * @param int $perPage
     * @param null $currentPage
     * @param array $options
     */
    public function __construct($items, $perPage, $currentPage = null, array $options = [])
    {
        $this->setItems($items)
            ->setCurrentPage($currentPage)
            ->setPerPage($perPage)
            ->setOptions($options);
    }


    /**
     * register the url pattern
     *
     * @param string $expression
     * @return $this
     */
    public function customUrl($expression  = '')
    {
        $this->setExpression($expression);
        return $this;
    }

    /**
     * get all appends
     *
     * @param array $appends
     * @return $this
     */
    public function appends(array $appends = []){
        $this->appends = array_merge($this->appends, $appends);
        return $this;
    }


    /**
     * add a new fragment to url
     *
     * @param string $name
     * @return $this
     */
    public function fragment($name = '')
    {
        $this->fragments[] = $name;
        return $this;
    }

    /**
     * get next page
     *
     * if current page is null, current page accept 0
     *
     * @return int
     */
    public function nextPage(){
        $current = $this->getCurrentPage();

        if (!is_int($current)) {
            $current = 0;
        }

        return $current + 1;
    }

    /**
     * return per page
     *
     * @return int
     */
    public function perPage(){
        return $this->getPerPage();
    }

    /**
     * return current page
     *
     * @return int|null
     */
    public function currentPage(){
        return $this->getCurrentPage();
    }
}
<commit_msg>made some updates<commit_after><?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 11.09.2015
 * Time: 12:37
 */

namespace Anonym\Components\Database\Pagination;

/**
 * Class Paginator
 * @package Anonym\Components\Database\Pagination
 */
class Paginator extends PaginationFactory
{


    /**
     * determine if there are more page in datas
     *
     * @var int
     */
    protected $hasMore;

    /**
     * create a new instance and register options and more variables
     *
     * @param mixed $items
     * @param int $perPage
     * @param null $currentPage
     * @param array $options
     */
    public function __construct($items, $perPage, $currentPage = null, array $options = [])
    {
        $this->setItems($items)
            ->setCurrentPage($currentPage)
            ->setPerPage($perPage)
            ->setOptions($options);
    }


    /**
     * register the url pattern
     *
     * @param string $expression
     * @return $this
     */
    public function customUrl($expression  = '')
    {
        $this->setExpression($expression);
        return $this;
    }

    /**
     * get all appends
     *
     * @param array $appends
     * @return $this
     */
    public function appends(array $appends = []){
        $this->appends = array_merge($this->appends, $appends);
        return $this;
    }


    /**
     * add a new fragment to url
     *
     * @param string $name
     * @return $this
     */
    public function fragment($name = '')
    {
        $this->fragments[] = $name;
        return $this;
    }

    /**
     * get next page
     *
     * if current page is null, current page accept 0
     *
     * @return int
     */
    public function nextPage(){
        $current = $this->getCurrentPage();

        if (!is_int($current)) {
            $current = 0;
        }

        return $current + 1;
    }

    /**
     * return per page
     *
     * @return int
     */
    public function perPage(){
        return $this->getPerPage();
    }

    /**
     * return current page
     *
     * @return int|null
     */
    public function currentPage(){
        return $this->getCurrentPage();
    }


}
{'fraction_non_alphanumeric': 0.12879314338661108, 'fraction_numerical': 0.006949270326615705, 'mean_word_length': 1.8038961038961039, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1745372', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1264, 'n_words': 326}