SubTitleParam   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
4
namespace Bigwhoop\Trumpet\Config\Params;
5
6
use Bigwhoop\Trumpet\Config\ConfigException;
7
use Bigwhoop\Trumpet\Config\Presentation;
8
9
final class SubTitleParam implements Param
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function parse($value, Presentation $presentation)
15
    {
16
        if (!is_string($value)) {
17
            throw new ConfigException('Sub title must be a string.');
18
        }
19
20
        if (empty($value)) {
21
            throw new ConfigException('Sub title must not be empty.');
22
        }
23
24
        $presentation->subtitle = $value;
25
    }
26
}
27