createRequestErrorException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
/**
3
 * Copyright © Thomas Klein, All rights reserved.
4
 * See LICENSE bundled with this library for license details.
5
 */
6
declare(strict_types=1);
7
8
namespace Zoho\Desk\Exception;
9
10
use function sprintf;
11
12
/**
13
 * @api
14
 */
15
class InvalidRequestException extends Exception
16
{
17
    private const REQUEST_ERROR_MESSAGE_MASK = 'An error occurred while processing the request: %s';
18
19
    public static function createRequestErrorException(string $error, int $errno): InvalidRequestException
20
    {
21
        return new self(sprintf(static::REQUEST_ERROR_MESSAGE_MASK, $error), $errno);
22
    }
23
}
24