InvalidRequestException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRequestErrorException() 0 3 1
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