Completed
Push — master ( 055f1b...f72a4b )
by Pavel
52s
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 1
Bugs 1 Features 0
Metric Value
wmc 5
c 1
b 1
f 0
lcom 0
cbo 1
dl 0
loc 41
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
 * Created by PhpStorm.
4
 * User: batanov.pavel
5
 * Date: 16.05.2016
6
 * Time: 11:51
7
 */
8
9
namespace Bankiru\Api\Rpc\Impl;
10
11
use Bankiru\Api\Rpc\Http\RequestInterface;
12
use Symfony\Component\HttpFoundation\ParameterBag;
13
14
final class Request implements RequestInterface
15
{
16
    /** @var  ParameterBag */
17
    private $attributes;
18
    /** @var  string */
19
    private $method;
20
    /** @var  array|\stdClass */
21
    private $parameters;
22
23
    /**
24
     * Request constructor.
25
     *
26
     * @param ParameterBag    $attributes
27
     * @param string          $method
28
     * @param array|\stdClass $parameters
29
     */
30 7
    public function __construct($method, $parameters, ParameterBag $attributes = null)
31
    {
32 7
        $this->attributes = $attributes ?: new ParameterBag();
33 7
        $this->method     = $method;
34 7
        $this->parameters = $parameters;
35 7
    }
36
37
    /** {@inheritdoc} */
38 7
    public function getAttributes()
39
    {
40 7
        return $this->attributes;
41
    }
42
43
    /** {@inheritdoc} */
44 7
    public function getMethod()
45
    {
46 7
        return $this->method;
47
    }
48
49
    /** {@inheritdoc} */
50 7
    public function getParameters()
51
    {
52 7
        return $this->parameters;
53
    }
54
}
55