Passed
Pull Request — master (#37)
by Christopher
14:20 queued 10:17
created

TMultiplicityTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isTMultiplicityValid() 0 7 4
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits;
4
5
trait TMultiplicityTrait
6
{
7
    public function isTMultiplicityValid($string)
8
    {
9
        if (!is_string($string)) {
10
            throw new \InvalidArgumentException("Input must be a string");
11
        }
12
        return '0..1' == $string || '1' == $string || '*' == $string;
13
    }
14
}
15