SingleValueParser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
1
<?php
2
/**
3
 * @author Aleksandar Panic
4
 * @license http://www.apache.org/licenses/LICENSE-2.0
5
 * @since 1.0.0
6
 **/
7
8
namespace ArekX\ArrayExpression\ValueParsers;
9
10
/**
11
 * Class SingleValueParser
12
 * Single value parser which gets and only returns one raw value.
13
 *
14
 * @package ArekX\ArrayExpression\ValueParsers
15
 *
16
 */
17
class SingleValueParser extends BaseValueParser
18
{
19
    /**
20
     * Returns RAW value passed to this value parser.
21
     *
22
     * This parser ignores $requestedName and $default and always returns RAW value.
23
     *
24
     * @param string $requestedName (Ignored) Requested name to return value
25
     * @param mixed $default (Ignored) Default value to be returned if value is not found by requested name.
26
     * @return mixed
27
     */
28 3
    public function getValue($requestedName = '', $default = null)
29
    {
30 3
        return $this->raw;
31
    }
32
}