RemoveProperties   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 7 2
1
<?php
2
3
namespace Ghc\Rosetta\Transformers;
4
5
class RemoveProperties extends Transformer
6
{
7
    /**
8
     * @param array $data
9
     *
10
     * @return array
11
     */
12
    public function transform($data)
13
    {
14
        return collect($data)->reject(function ($value, $key) {
15
            return in_array($key, $this->config['properties']);
16
        })->map(function ($value) {
17
            return !is_array($value) ? $value : $this->transform($value);
18
        })->toArray();
19
    }
20
}
21