{"record":{"id":"e63b01911a63c975","repo":"octobercms/october","slug":"current-page-must-be-zero-or-a-positive-integer","errorCode":null,"errorMessage":"Current page must be zero or a positive integer","messagePattern":"Current page must be zero or a positive integer","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/classes/ReportDataPaginationParams.php","lineNumber":25,"sourceCode":" */\nclass ReportDataPaginationParams\n{\n    private $recordsPerPage;\n    private $currentPage;\n\n    /**\n     * Creates a pagination parameters object.\n     * @param int $recordsPerPage Specifies the number of records per page.\n     * @param int $currentPage Specifies the current page index.\n     */\n    public function __construct(int $recordsPerPage, int $currentPage)\n    {\n        if ($recordsPerPage <= 0) {\n            throw new ApplicationException('Records per page must be a positive integer');\n        }\n\n        if ($currentPage < 0) {\n            throw new ApplicationException('Current page must be zero or a positive integer');\n        }\n\n        $this->recordsPerPage = $recordsPerPage;\n        $this->currentPage = $currentPage;\n    }\n\n    /**\n     * Returns the records per page value\n     * @return int\n     */\n    public function getRecordsPerPage(): int\n    {\n        return $this->recordsPerPage;\n    }\n\n    /**\n     * Returns the current page value\n     * @return int","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/classes/ReportDataPaginationParams.php#L7-L43","documentation":"ApplicationException from the ReportDataPaginationParams constructor: the $currentPage argument was passed as a negative number. Page indexes are zero-based, so any negative value is invalid for the OFFSET calculation and indicates the caller computed the current page incorrectly.","triggerScenarios":"Thrown at modules/dashboard/classes/ReportDataPaginationParams.php:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a zero-based non-negative page index","Default missing page parameters to 0 before construction"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}