Completed
Push — master ( e6719d...13ae3c )
by John
01:53
created

JSONBodyParser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 3 1
1
<?php
2
namespace LunixREST\Request\BodyParser;
3
4
use LunixREST\Request\BodyParser\Exceptions\InvalidRequestDataException;
5
use LunixREST\Request\RequestData\JSONRequestData;
6
use LunixREST\Request\RequestData\RequestData;
7
8
class JSONBodyParser implements BodyParser {
9
10
    /**
11
     * Parses API request data out of a json string
12
     * @param $rawBody
13
     * @return RequestData
14
     * @throws InvalidRequestDataException
15
     */
16
    public function parse(string $rawBody): RequestData {
17
        return new JSONRequestData($rawBody);
18
    }
19
}
20