Passed
Push — master ( 06bf02...b3147e )
by Ferry
03:01
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\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
}