Completed
Push — master ( 055f1b...f72a4b )
by Pavel
52s
created

Request::getAttributes()   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 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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