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

Item   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 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