JsonInput::getData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Kelemen\ApiNette\Validator\Input;
4
5
class JsonInput implements InputInterface
6
{
7
    private $data = null;
8
9
    public function getData()
10
    {
11
        if ($this->data === null) {
12
            $this->data = json_decode(file_get_contents("php://input"), true);
13
        }
14
15
        return $this->data;
16
    }
17
}
18