Completed
Push — master ( 654a3a...0d91ac )
by Arman
20s queued 16s
created

PaginatorException::missingRequiredParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 10
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.9.7
13
 */
14
15
namespace Quantum\Paginator\Exceptions;
16
17
use Quantum\App\Exceptions\BaseException;
18
19
/**
20
 * Class PaginatorException
21
 * @package Quantum\Paginator
22
 */
23
class PaginatorException extends BaseException
24
{
25
    /**
26
     * @param string $type
27
     * @param array $missingParams
28
     * @return PaginatorException
29
     */
30
    public static function missingRequiredParams(string $type, array $missingParams): PaginatorException
31
    {
32
        return new static(
33
            t('exception.paginator_missing_params', [
34
                ucfirst($type),
35
                implode(', ', $missingParams)
36
            ]),
37
            E_WARNING
38
        );
39
    }
40
}