Completed
Push — master ( 188ba1...86d637 )
by Samuel
02:55
created

JsonInput::getData()   A

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 9.4285
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