Passed
Push — master ( 06bf02...b3147e )
by Ferry
03:01
created

Hook   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexRender() 0 7 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\wysiwyg;
10
11
use crocodicstudio\crudbooster\types\TypesHook;
12
use Illuminate\Support\Str;
13
14
class Hook extends TypesHook
15
{
16
17
    /**
18
     * @param $row
19
     * @param $column WysiwygModel
20
     * @return string
21
     */
22
    public function indexRender($row, $column)
23
    {
24
        $value = trim(strip_tags($row->{ $column->getField() }));
25
        if($column->getLimit()) {
26
            $value = Str::limit($value, $column->getLimit());
27
        }
28
        return $value;
29
    }
30
31
32
}