Passed
Branch feature/second-release (e9200f)
by Andrea Marco
13:37
created

OutOfAttemptsException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 6
ccs 2
cts 2
cp 1
crap 1
rs 10
c 3
b 0
f 0
1
<?php
2
3
namespace Cerbero\LazyJsonPages\Exceptions;
4
5
use GuzzleHttp\Exception\TransferException;
6
use Illuminate\Support\LazyCollection;
7
8
/**
9
 * The exception thrown when an HTTP request failed too many times.
10
 */
11
class OutOfAttemptsException extends LazyJsonPagesException
12
{
13
    /**
14
     * Instantiate the class.
15
     *
16
     * @param array<int, int> $failedPages
17
     * @param LazyCollection<int, mixed> $items
18
     */
19 1
    public function __construct(
20
        TransferException $e,
21
        public readonly array $failedPages,
22
        public readonly LazyCollection $items,
23
    ) {
24 1
        parent::__construct($e->getMessage(), 0, $e);
25
    }
26
}
27