Error::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
dl 0
loc 16
c 1
b 0
f 0
rs 10
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
// ---------------------------------------------------------------------
4
//
5
//  Copyright (C) 2018-2024 Artem Rodygin
6
//
7
//  You should have received a copy of the MIT License along with
8
//  this file. If not, see <https://opensource.org/licenses/MIT>.
9
//
10
// ---------------------------------------------------------------------
11
12
namespace Linode\Exception;
13
14
/**
15
 * An object for describing a single error that occurred during the processing of a request.
16
 */
17
class Error
18
{
19 2
    public function __construct(
20
        /**
21
         * What happened to cause this error. In most cases, this can be fixed immediately by
22
         * changing the data you sent in the request, but in some cases you will be instructed to
23
         * open a Support Ticket (@see SupportTicketRepositoryInterface::createTicket) or perform some
24
         * other action before you can complete the request successfully.
25
         */
26
        public readonly string $reason,
27
28
        /**
29
         * The field in the request that caused this error. This may be a path, separated by
30
         * periods in the case of nested fields. In some cases this may come back as "null" if the
31
         * error is not specific to any single element of the request.
32
         */
33
        public readonly ?string $field = null
34 2
    ) {}
35
}
36