Passed
Push — master ( bb6abf...8dd668 )
by Alex
10:54 queued 07:14
created

AccessTypeTraits   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B isTAccessOk() 0 7 5
A isTPublicOrInternalAccessOK() 0 5 3
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\CodeGeneration;
4
5
trait AccessTypeTraits
6
{
7
    public function isTAccessOk($string)
8
    {
9
        if (!is_string($string)) {
10
            throw new \InvalidArgumentException("Input must be a string");
11
        }
12
        return 'Public' == $string || 'Internal' == $string || 'Protected' == $string || 'Private' == $string;
13
    }
14
15
    public function isTPublicOrInternalAccessOK($string)
16
    {
17
        $result = $this->isTAccessOk($string);
18
        return $result && ('Public' == $string || 'Internal' == $string);
19
    }
20
}
21