Completed
Push — master ( af88ae...a08cb5 )
by Rafael
09:55 queued 06:31
created

SubscriptionEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
use Ynlo\GraphQLBundle\Model\PolymorphicObjectInterface;
14
use Ynlo\GraphQLBundle\Model\PolymorphicObjectTrait;
15
16
class SubscriptionEvent implements PolymorphicObjectInterface
17
{
18
    use PolymorphicObjectTrait;
19
20
    /**
21
     * @var mixed|null
22
     */
23
    protected $data;
24
25
    /**
26
     * SubscriptionEvent constructor.
27
     *
28
     * @param mixed|null $data
29
     */
30
    public function __construct($data)
31
    {
32
        $this->data = $data;
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38
    public function __get($name)
39
    {
40
        return $this->data;
41
    }
42
43
    /**
44
     * @inheritDoc
45
     */
46
    public function __set($name, $value)
47
    {
48
        $this->data = $value;
49
    }
50
51
    /**
52
     * @inheritDoc
53
     */
54
    public function __isset($name)
55
    {
56
        return isset($this->data);
57
    }
58
}
59