src/Charcoal/Source/Pagination.php
public function setPage($page)
    {
        if (!is_numeric($page)) {
            throw new InvalidArgumentException(
                'Page number must be numeric.'
            );
        }

        $page = (int)$page;
        if ($page === 0) {
            $page = 1;
        } elseif ($page < 0) {
            throw new InvalidArgumentException(
                'Page number must be greater than zero.'
            );
        }

        $this->page = $page;
        return $this;
    }
public function setPage($page)
    {
        if (!is_numeric($page)) {
            throw new InvalidArgumentException(
                'Page number must be numeric.'
            );
        }

        $page = (int)$page;
        if ($page === 0) {
            $page = 1;
        } elseif ($page < 0) {
            throw new InvalidArgumentException(
                'Page number must be greater than zero.'
            );
        }

        $this->page = $page;
        return $this;
    }
public function setPage ( $ page ) { if ( ! is_numeric ( $ page ) ) { throw new InvalidArgumentException ( 'Page number must be numeric.' ) ; } $ page = ( int ) $ page ; if ( $ page === 0 ) { $ page = 1 ; } elseif ( $ page < 0 ) { throw new InvalidArgumentException ( 'Page number must be greater than zero.' ) ; } $ this -> page = $ page ; return $ this ; }
Set the page number.

@param  integer $page The current page.
Pages should start at 1.
@throws InvalidArgumentException If the parameter is not numeric or < 0.
@return self
Set the page number .