Passed
Push — master ( 342193...f80fe6 )
by Andrea Marco
03:14 queued 11s
created

AbstractHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Cerbero\LazyJsonPages\Handlers;
4
5
use Cerbero\LazyJsonPages\Concerns\RetriesHttpRequests;
6
use Cerbero\LazyJsonPages\Config;
7
use Traversable;
8
9
/**
10
 * The abstract handler.
11
 *
12
 */
13
abstract class AbstractHandler
14
{
15
    use RetriesHttpRequests;
0 ignored issues
show
introduced by
The trait Cerbero\LazyJsonPages\Concerns\RetriesHttpRequests requires some properties which are not provided by Cerbero\LazyJsonPages\Handlers\AbstractHandler: $attempts, $backoff
Loading history...
16
17
    /**
18
     * The APIs configuration.
19
     *
20
     * @var Config
21
     */
22
    protected $config;
23
24
    /**
25
     * Instantiate the class.
26
     *
27
     * @param Config $config
28
     */
29 14
    public function __construct(Config $config)
30
    {
31 14
        $this->config = $config;
32 14
    }
33
34
    /**
35
     * Determine whether the handler can handle the APIs configuration
36
     *
37
     * @return bool
38
     */
39
    abstract public function matches(): bool;
40
41
    /**
42
     * Handle the APIs configuration
43
     *
44
     * @return Traversable
45
     */
46
    abstract public function handle(): Traversable;
47
}
48