IncludeDefinition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A relation() 0 8 2
A method() 0 3 1
A isDefault() 0 3 1
1
<?php
2
3
namespace Rexlabs\Smokescreen\Includes;
4
5
use Rexlabs\Smokescreen\Definition\AbstractDefinition;
6
7
class IncludeDefinition extends AbstractDefinition
8
{
9
    public function relation(): array
10
    {
11
        $relation = $this->get('relation', []);
12
        if (!\is_array($relation)) {
13
            $relation = (array) preg_split('/\s*,\s*', $relation);
14
        }
15
16
        return $relation;
17
    }
18
19
    public function method()
20
    {
21
        return $this->get('method');
22
    }
23
24
    public function isDefault()
25
    {
26
        return $this->has('default');
27
    }
28
}
29