Completed
Pull Request — master (#79)
by Daniel
02:24
created

ColumnTemplateInferrer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

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