Completed
Pull Request — master (#61)
by Michal
02:15
created

PutInputParam::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tomaj\NetteApi\Params;
6
7
class PutInputParam extends InputParam
8
{
9
    protected $type = self::TYPE_PUT;
10
11 6
    public function getValue()
12
    {
13 6
        parse_str(file_get_contents("php://input"), $params);
14 6
        return $params[$this->key] ?? $this->default;
15
    }
16
}
17