Completed
Push — master ( dda3c5...f5bb38 )
by Oscar
01:16
created

NegativeResultTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 9 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Middleland\Matchers;
5
6
trait NegativeResultTrait
7
{
8
    private $result = true;
9
10
    private function getValue(string $value)
11
    {
12
        if ($value[0] === '!') {
13
            $this->result = false;
14
            return substr($value, 1);
15
        }
16
17
        return $value;
18
    }
19
}
20