Completed
Push — master ( 0790e6...dce13b )
by
unknown
42:22 queued 17:20
created

UserInfo::validate()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 4
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MovingImage\Client\VMPro\Entity;
6
7
use JMS\Serializer\Annotation\SerializedName;
8
use JMS\Serializer\Annotation\Type;
9
10
class UserInfo
11
{
12
    /**
13
     * @Type("string")
14
     */
15
    private $email;
16
17
    /**
18
     * @Type("string")
19
     * @SerializedName("fullName")
20
     */
21
    private $fullName;
22
23
    /**
24
     * @Type("array")
25
     * @SerializedName("videoManagerIds")
26
     */
27
    private $videoManagerIds = [];
28
29
    public function validate(): void
30
    {
31
        if (!\is_string($this->email) || !\is_string($this->fullName) || !\is_array($this->videoManagerIds)) {
32
            throw new \InvalidArgumentException(sprintf(
33
                '%s is not valid',
34
                self::class
35
            ));
36
        }
37
    }
38
39
    public function getEmail(): string
40
    {
41
        return $this->email;
42
    }
43
44
    public function getFullName(): string
45
    {
46
        return $this->fullName;
47
    }
48
49
    /**
50
     * @return int[]
51
     */
52
    public function getVideoManagerIds(): array
53
    {
54
        return $this->videoManagerIds;
55
    }
56
}
57