Completed
Push — develop ( 3b0dc5...bd86c4 )
by Abdelrahman
01:14
created

Escaper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A escapeRow() 0 14 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Support\Traits;
6
7
trait Escaper
8
{
9
    /**
10
     * Escape all values of row.
11
     *
12
     * @param array $row
13
     *
14
     * @return array
15
     */
16
    protected function escapeRow(array $row): array
17
    {
18
        $arrayDot = array_filter(array_dot($row));
19
20
        foreach ($arrayDot as $key => $value) {
21
            $arrayDot[$key] = e($value);
22
        }
23
24
        foreach ($arrayDot as $key => $value) {
25
            array_set($row, $key, $value);
26
        }
27
28
        return $row;
29
    }
30
}
31