DataSetKey   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
dl 0
loc 11
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A pipe() 0 4 1
1
<?php
2
3
namespace Ghc\Rosetta\Pipes;
4
5
use Illuminate\Support\Arr;
6
7
class DataSetKey implements Pipeable
8
{
9
    /**
10
     * @param array $options
11
     *
12
     * @return \Closure
13
     */
14
    public function pipe($options = [])
15
    {
16
        return function ($inputData) use ($options) {
17
            return Arr::set($inputData, Arr::get($options, 'key'), Arr::get($options, 'value'));
0 ignored issues
show
Bug introduced by
It seems like Illuminate\Support\Arr::get($options, 'key') can also be of type array; however, parameter $key of Illuminate\Support\Arr::set() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
            return Arr::set($inputData, /** @scrutinizer ignore-type */ Arr::get($options, 'key'), Arr::get($options, 'value'));
Loading history...
18
        };
19
    }
20
}
21