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

Request   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 41
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A getAttributes() 0 4 1
A getMethod() 0 4 1
A getParameters() 0 4 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