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

ColumnTemplateInferrer::inferCellTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
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