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

AbstractJsonResourceRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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