LicenseParam   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 18
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 12 3
1
<?php declare(strict_types=1);
2
3
namespace Bigwhoop\Trumpet\Config\Params;
4
5
use Bigwhoop\Trumpet\Config\ConfigException;
6
use Bigwhoop\Trumpet\Config\Presentation;
7
8
final class LicenseParam implements Param
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function parse($value, Presentation $presentation)
14
    {
15
        if (!is_string($value)) {
16
            throw new ConfigException('License must be a string.');
17
        }
18
19
        if (empty($value)) {
20
            throw new ConfigException('License must not be empty.');
21
        }
22
23
        $presentation->license = $value;
24
    }
25
}
26