BadRequestException::getViolations()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DigitalCz\DigiSign\Exception;
6
7
use DigitalCz\DigiSign\Resource\Violations;
8
9
/**
10
 * Represents response with http status 400
11
 */
12
final class BadRequestException extends ClientException
13
{
14
    public function getViolations(): ?Violations
15
    {
16
        try {
17
            return new Violations($this->parseResult());
18
        } catch (EmptyResultException $e) {
19
            return null;
20
        }
21
    }
22
}
23