<commit_before><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\data;

use Yii;
use yii\base\Object;
use yii\web\Request;

/**
 * Pagination represents information relevant to pagination of data items.
 *
 * When data needs to be rendered in multiple pages, Pagination can be used to
 * represent information such as [[totalCount|total item count]], [[pageSize|page size]],
 * [[page|current page]], etc. These information can be passed to [[yii\widgets\Pager|pagers]]
 * to render pagination buttons or links.
 *
 * The following example shows how to create a pagination object and feed it
 * to a pager.
 *
 * Controller action:
 *
 * ~~~
 * function actionIndex()
 * {
 *     $query = Article::find()->where(['status' => 1]);
 *     $countQuery = clone $query;
 *     $pages = new Pagination(['totalCount' => $countQuery->count()]);
 *     $models = $query->offset($pages->offset)
 *         ->limit($pages->limit)
 *         ->all();
 *
 *     return $this->render('index', [
 *          'models' => $models,
 *          'pages' => $pages,
 *     ]);
 * }
 * ~~~
 *
 * View:
 *
 * ~~~
 * foreach ($models as $model) {
 *     // display $model here
 * }
 *
 * // display pagination
 * echo LinkPager::widget([
 *     'pagination' => $pages,
 * ]);
 * ~~~
 *
 * @property integer $limit The limit of the data. This may be used to set the LIMIT value for a SQL statement
 * for fetching the current page of data. Note that if the page size is infinite, a value -1 will be returned.
 * This property is read-only.
 * @property integer $offset The offset of the data. This may be used to set the OFFSET value for a SQL
 * statement for fetching the current page of data. This property is read-only.
 * @property integer $page The zero-based current page number.
 * @property integer $pageCount Number of pages. This property is read-only.
 *
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class Pagination extends Object
{
	/**
	 * @var string name of the parameter storing the current page index. Defaults to 'page'.
	 * @see params
	 */
	public $pageVar = 'page';
	/**
	 * @var boolean whether to always have the page parameter in the URL created by [[createUrl()]].
	 * If false and [[page]] is 0, the page parameter will not be put in the URL.
	 */
	public $forcePageVar = true;
	/**
	 * @var string the route of the controller action for displaying the paged contents.
	 * If not set, it means using the currently requested route.
	 */
	public $route;
	/**
	 * @var array parameters (name => value) that should be used to obtain the current page number
	 * and to create new pagination URLs. If not set, all parameters from $_GET will be used instead.
	 * In order to add hash to all links use `'#' => 'hashtag'`.
	 *
	 * The array element indexed by [[pageVar]] is considered to be the current page number.
	 * If the element does not exist, the current page number is considered 0.
	 */
	public $params;
	/**
	 * @var \yii\web\UrlManager the URL manager used for creating pagination URLs. If not set,
	 * the "urlManager" application component will be used.
	 */
	public $urlManager;
	/**
	 * @var boolean whether to check if [[page]] is within valid range.
	 * When this property is true, the value of [[page]] will always be between 0 and ([[pageCount]]-1).
	 * Because [[pageCount]] relies on the correct value of [[totalCount]] which may not be available
	 * in some cases (e.g. MongoDB), you may want to set this property to be false to disable the page
	 * number validation. By doing so, [[page]] will return the value indexed by [[pageVar]] in [[params]].
	 */
	public $validatePage = true;
	/**
	 * @var integer number of items on each page. Defaults to 20.
	 * If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
	 */
	public $pageSize = 20;
	/**
	 * @var integer total number of items.<commit_msg>Fixed hash doc for pagination<commit_after><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\data;

use Yii;
use yii\base\Object;
use yii\web\Request;

/**
 * Pagination represents information relevant to pagination of data items.
 *
 * When data needs to be rendered in multiple pages, Pagination can be used to
 * represent information such as [[totalCount|total item count]], [[pageSize|page size]],
 * [[page|current page]], etc. These information can be passed to [[yii\widgets\Pager|pagers]]
 * to render pagination buttons or links.
 *
 * The following example shows how to create a pagination object and feed it
 * to a pager.
 *
 * Controller action:
 *
 * ~~~
 * function actionIndex()
 * {
 *     $query = Article::find()->where(['status' => 1]);
 *     $countQuery = clone $query;
 *     $pages = new Pagination(['totalCount' => $countQuery->count()]);
 *     $models = $query->offset($pages->offset)
 *         ->limit($pages->limit)
 *         ->all();
 *
 *     return $this->render('index', [
 *          'models' => $models,
 *          'pages' => $pages,
 *     ]);
 * }
 * ~~~
 *
 * View:
 *
 * ~~~
 * foreach ($models as $model) {
 *     // display $model here
 * }
 *
 * // display pagination
 * echo LinkPager::widget([
 *     'pagination' => $pages,
 * ]);
 * ~~~
 *
 * @property integer $limit The limit of the data. This may be used to set the LIMIT value for a SQL statement
 * for fetching the current page of data. Note that if the page size is infinite, a value -1 will be returned.
 * This property is read-only.
 * @property integer $offset The offset of the data. This may be used to set the OFFSET value for a SQL
 * statement for fetching the current page of data. This property is read-only.
 * @property integer $page The zero-based current page number.
 * @property integer $pageCount Number of pages. This property is read-only.
 *
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class Pagination extends Object
{
	/**
	 * @var string name of the parameter storing the current page index. Defaults to 'page'.
	 * @see params
	 */
	public $pageVar = 'page';
	/**
	 * @var boolean whether to always have the page parameter in the URL created by [[createUrl()]].
	 * If false and [[page]] is 0, the page parameter will not be put in the URL.
	 */
	public $forcePageVar = true;
	/**
	 * @var string the route of the controller action for displaying the paged contents.
	 * If not set, it means using the currently requested route.
	 */
	public $route;
	/**
	 * @var array parameters (name => value) that should be used to obtain the current page number
	 * and to create new pagination URLs. If not set, all parameters from $_GET will be used instead.
	 *
	 * In order to add hash to all links use array_merge($_GET, ['#' => 'my-hash']).
	 *
	 * The array element indexed by [[pageVar]] is considered to be the current page number.
	 * If the element does not exist, the current page number is considered 0.
	 */
	public $params;
	/**
	 * @var \yii\web\UrlManager the URL manager used for creating pagination URLs. If not set,
	 * the "urlManager" application component will be used.
	 */
	public $urlManager;
	/**
	 * @var boolean whether to check if [[page]] is within valid range.
	 * When this property is true, the value of [[page]] will always be between 0 and ([[pageCount]]-1).
	 * Because [[pageCount]] relies on the correct value of [[totalCount]] which may not be available
	 * in some cases (e.g. MongoDB), you may want to set this property to be false to disable the page
	 * number validation. By doing so, [[page]] will return the value indexed by [[pageVar]] in [[params]].
	 */
	public $validatePage = true;
	/**
	 * @var integer number of items on each page. Defaults to 20.
	 * If it is less than 1, it means the page size is infinite, and thus a single page contains all items.
	 */
	public $pageSize = 20;
	/**
	 * @var integer total number of items.
{'fraction_non_alphanumeric': 0.12053013253313329, 'fraction_numerical': 0.0042510627656914225, 'mean_word_length': 3.2457537154989384, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5730537', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2247, 'n_words': 1038}