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

AbstractHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 34
ccs 3
cts 3
cp 1
rs 10

1 Method

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