Passed
Pull Request — master (#9)
by Pavel
05:47
created

Request::getParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Test\Impl;
4
5
use Bankiru\Api\Rpc\RpcRequestInterface;
6
use Symfony\Component\HttpFoundation\ParameterBag;
7
8
final class Request implements RpcRequestInterface
9
{
10
    /** @var  ParameterBag */
11
    private $attributes;
12
    /** @var  string */
13
    private $method;
14
    /** @var  array|\stdClass */
15
    private $parameters;
16
17
    /**
18
     * Request constructor.
19
     *
20
     * @param ParameterBag    $attributes
21
     * @param string          $method
22
     * @param array|\stdClass $parameters
23
     */
24 9
    public function __construct($method, $parameters, ParameterBag $attributes = null)
25
    {
26 9
        $this->attributes = $attributes ?: new ParameterBag();
27 9
        $this->method     = $method;
28 9
        $this->parameters = $parameters;
29 9
    }
30
31
    /** {@inheritdoc} */
32 9
    public function getAttributes()
33
    {
34 9
        return $this->attributes;
35
    }
36
37
    /** {@inheritdoc} */
38 9
    public function getMethod()
39
    {
40 9
        return $this->method;
41
    }
42
43
    /** {@inheritdoc} */
44 8
    public function getParameters()
45
    {
46 8
        return $this->parameters;
47
    }
48
}
49