Completed
Push — master ( eb575e...c103e9 )
by Romain
13s
created

AbstractAirlineTemplate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setThemeColor() 0 7 1
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Model\Message\Attachment\Template;
6
7
use Kerox\Messenger\Helper\ValidatorTrait;
8
use Kerox\Messenger\Model\Message\Attachment\Template;
9
10
abstract class AbstractAirlineTemplate extends Template
11
{
12
    use ValidatorTrait;
13
14
    /**
15
     * @var string
16
     */
17
    protected $locale;
18
19
    /**
20
     * @var null|string
21
     */
22
    protected $themeColor;
23
24
    /**
25
     * AbstractAirline constructor.
26
     *
27
     * @param string $locale
28
     *
29
     * @throws \InvalidArgumentException
30
     */
31
    public function __construct(string $locale)
32
    {
33
        parent::__construct();
34
35
        $this->isValidLocale($locale);
36
37
        $this->locale = $locale;
38
    }
39
40
    /**
41
     * @param string $themeColor
42
     *
43
     * @throws \InvalidArgumentException
44
     *
45
     * @return \Kerox\Messenger\Model\Message\Attachment\Template\AbstractAirlineTemplate
46
     */
47
    public function setThemeColor(string $themeColor): self
48
    {
49
        $this->isValidColor($themeColor);
50
51
        $this->themeColor = $themeColor;
52
53
        return $this;
54
    }
55
}
56