TypeParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFinalType() 0 8 2
1
<?php
2
3
namespace Arthem\GraphQLMapper\Utils;
4
5
abstract class TypeParser
6
{
7
    /**
8
     * Return the real type if wrapped in a collection
9
     * "[MyCustomType]!" will return "MyCustomType"
10
     *
11
     * @param string $type
12
     * @return string
13
     */
14
    public static function getFinalType($type)
15
    {
16
        if (preg_match('#^\[(.+)\]!?$#', $type, $regs)) {
17
            return $regs[1];
18
        }
19
20
        return $type;
21
    }
22
}
23