AbstractDriver   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isEnabled() 0 3 2
A prepare() 0 1 1
A setConfig() 0 6 1
A __construct() 0 3 1
1
<?php 
2
3
namespace Yaro\LogEnvelope\Drivers;
4
5
abstract class AbstractDriver
6
{
7
    
8
    protected $config = [];
9
    protected $data   = [];
10
    
11
    public function __construct($data)
12
    {
13
        $this->data = $data;
14
    } // end __construct
15
    
16
    public function setConfig($config)
17
    {
18
        $this->config = $config;
19
        $this->prepare();
20
        
21
        return $this;
22
    } // end setConfig
23
    
24
    protected function prepare() {} // end prepare
25
    
26
    protected function isEnabled()
27
    {
28
        return isset($this->config['enabled']) && $this->config['enabled'];
29
    } // end isEnabled
30
    
31
    abstract public function send();
32
    
33
    abstract protected function check();
34
    
35
}
36