Passed
Pull Request — master (#17)
by
unknown
05:31
created

Item::__construct()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the LineMob package.
5
 *
6
 * (c) Ishmael Doss <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace LineMob\Core\Template\ImageCarousel;
13
14
use LineMob\Core\Template\Action;
15
16
/**
17
 * @author YokYukYik <[email protected]>
18
 */
19
class Item
20
{
21
    /**
22
     * @var string
23
     */
24
    public $imageUrl;
25
26
    /**
27
     * @var Action
28
     */
29
    public $action;
30
31
    /**
32
     * @param $imageUrl
33
     * @param $action
34
     */
35
    public function __construct($imageUrl, $action)
36
    {
37
        $this->imageUrl = $imageUrl;
38
39
        if (!$action instanceof Action) {
40
            throw new \InvalidArgumentException("`Action` should be typeof: " . Action::class);
41
        }
42
43
        $this->action = $action;
44
    }
45
}
46