Completed
Pull Request — master (#13)
by Rafael
06:46
created

SubscriptionRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Subscription;
12
13
/**
14
 * The subscriptions request is launched when
15
 * internally the subscriptions manager dispatch subscriptions
16
 * in order to emulate user like requests
17
 */
18
class SubscriptionRequest
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $id;
24
25
    /**
26
     * @var array
27
     */
28
    protected $data = [];
29
30
    /**
31
     * SubscriptionRequest constructor.
32
     *
33
     * @param string $id
34
     * @param array  $data
35
     */
36
    public function __construct(string $id, array $data = [])
37
    {
38
        $this->id = $id;
39
        $this->data = $data;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getId(): string
46
    {
47
        return $this->id;
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getData(): array
54
    {
55
        return $this->data;
56
    }
57
}
58