GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9014c2...c6747a )
by TJ
02:34
created

FiltersData::filterKeys()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Honeybadger\Concerns;
4
5
use Honeybadger\Support\Arr;
6
7
trait FiltersData
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $keysToFilter = [];
13
14
    /**
15
     * @param  array  $keysToFilter
16
     * @return mixed
17
     */
18
    public function filterKeys(array $keysToFilter) : self
19
    {
20
        $this->keysToFilter = array_merge($this->keysToFilter, $keysToFilter);
21
22
        return $this;
23
    }
24
25
    /**
26
     * @param  array  $values
27
     * @return array
28
     */
29
    private function filter(array $values) : array
30
    {
31
        return Arr::mapWithKeys($values, function ($value, $key) {
32
            if (is_array($value)) {
33
                return $this->filter($value);
34
            }
35
36
            if (in_array($key, $this->keysToFilter)) {
37
                return '[FILTERED]';
38
            }
39
40
            return $value;
41
        });
42
    }
43
}
44