DataProcessor::escapeRow()   A
last analyzed

Complexity

Conditions 5
Paths 6

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 16
rs 9.4222
cc 5
nc 6
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Processors;
6
7
use Yajra\DataTables\Processors\DataProcessor as BaseDataProcessor;
8
9
class DataProcessor extends BaseDataProcessor
10
{
11
    /**
12
     * Escape all values of row.
13
     *
14
     * @param array $row
15
     *
16
     * @return array
17
     */
18
    protected function escapeRow(array $row)
19
    {
20
        $arrayDot = array_filter(array_dot($row));
0 ignored issues
show
Deprecated Code introduced by
The function array_dot() has been deprecated with message: Arr::dot() should be used directly instead. Will be removed in Laravel 6.0.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
21
22
        foreach ($arrayDot as $key => $value) {
23
            if (! in_array($key, $this->rawColumns) && is_string($value)) {
24
                $arrayDot[$key] = e($value);
25
            }
26
        }
27
28
        foreach ($arrayDot as $key => $value) {
29
            array_set($row, $key, $value);
0 ignored issues
show
Deprecated Code introduced by
The function array_set() has been deprecated with message: Arr::set() should be used directly instead. Will be removed in Laravel 6.0.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
30
        }
31
32
        return $row;
33
    }
34
}
35