Completed
Push — master ( a482e0...5c9671 )
by Sebastian
02:54
created

AbstractJsonResourceRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFromJsonInBody() 0 4 1
1
<?php
2
namespace Kartenmacherei\RestFramework\ResourceRequest;
3
4
use Kartenmacherei\RestFramework\Request\Body\JsonBody;
5
6
abstract class AbstractJsonResourceRequest implements ResourceRequest
7
{
8
    /**
9
     * @var JsonBody
10
     */
11
    private $body;
12
13
    /**
14
     * @param JsonBody $body
15
     */
16
    public function __construct(JsonBody $body)
17
    {
18
        $this->body = $body;
19
    }
20
21
    /**
22
     * @param string $selector
23
     * @return \Kartenmacherei\RestFramework\JsonArray|\Kartenmacherei\RestFramework\JsonObject
24
     */
25
    public function getFromJsonInBody(string $selector)
26
    {
27
        return $this->body->query($selector);
28
    }
29
}
30