ValuesMod::value()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LaravelLangBundler\BundleItems\Mods;
4
5
use LaravelLangBundler\BundleItems\ItemWrapper;
6
7
class ValuesMod extends ItemWrapper
8
{
9
    /**
10
     * Alter key and return.
11
     *
12
     * @param string $key
13
     *
14
     * @return string
15
     */
16
    public function key($key)
17
    {
18
        return $key;
19
    }
20
21
    /**
22
     * Alter value and return.
23
     *
24
     * @param mixed $value
25
     *
26
     * @return mixed
27
     */
28
    public function value($value)
29
    {
30
        if (is_array($value)) {
31
            return array_values($value);
32
        }
33
34
        return $value;
35
    }
36
}
37