Passed
Push — master ( b3147e...c49c81 )
by Ferry
03:13
created

Hook::indexRender()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 2/13/2019
6
 * Time: 5:43 PM
7
 */
8
9
namespace crocodicstudio\crudbooster\types\text;
10
11
use crocodicstudio\crudbooster\types\TypesHook;
12
13
class Hook extends TypesHook
14
{
15
16
    /**
17
     * @param $row
18
     * @param $column TextModel
19
     * @return string
20
     */
21
    public function indexRender($row, $column)
22
    {
23
        $value = trim(strip_tags($row->{ $column->getField() }));
24
        if($column->getLimit()) {
25
            $value = Str::limit($value, $column->getLimit());
0 ignored issues
show
Bug introduced by
The type crocodicstudio\crudbooster\types\text\Str was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
26
        }
27
        return $value;
28
    }
29
30
}