Completed
Push — master ( a9154f...38f43b )
by Daniel
02:17
created

ColumnTemplateInferrer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A inferCellTemplate() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid\Util;
6
7
class ColumnTemplateInferrer
8
{
9
    public static function inferCellTemplate($columnClassFqn)
10
    {
11
        $shortName = substr($columnClassFqn, strrpos($columnClassFqn, '\\') + 1);
12
        $offset = strrpos($shortName, 'Column');
13
14
        if (false !== $offset) {
15
            $shortName = substr($shortName, 0, $offset);
16
        }
17
18
        return $shortName;
19
    }
20
}
21