Completed
Push — develop ( bd86c4...096d2c )
by Abdelrahman
01:38
created

Escaper::escapeRow()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 4
nop 1
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Support\Traits;
6
7
trait Escaper
8
{
9
    /**
10
     * Escape all values.
11
     *
12
     * @param array $data
13
     *
14
     * @return array
15
     */
16
    protected function escape(array $data): array
17
    {
18
        $arrayDot = array_filter(array_dot($data));
19
20
        foreach ($arrayDot as $key => $value) {
21
            $arrayDot[$key] = e($value);
22
        }
23
24
        foreach ($arrayDot as $key => $value) {
25
            array_set($data, $key, $value);
26
        }
27
28
        return $data;
29
    }
30
}
31