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

ColumnTemplateInferrer::inferCellTemplate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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