Completed
Push — master ( 005b00...a8a0a1 )
by John
01:59
created

JSONBodyParser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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 8
    public function parse(string $rawBody): RequestData {
17 8
        return new JSONRequestData($rawBody);
18
    }
19
}
20