Passed
Push — master ( 1faa52...d67625 )
by Dispositif
05:49 queued 11s
created

BigTitle::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application (@github)
4
 * 2019/2020 © Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the license file.
6
 */
7
8
declare(strict_types=1);
9
10
11
namespace App\Domain\Models;
12
13
14
use App\Domain\Utils\ArrayProcessTrait;
15
16
class BigTitle
17
{
18
    use ArrayProcessTrait;
19
20
    /**
21
     * @var string
22
     */
23
    private $title;
24
    /**
25
     * @var string|null
26
     */
27
    private $subTitle;
28
29
    private $lang = null;
30
31
    /**
32
     * BigTitle constructor.
33
     *
34
     * @param string      $title
35
     * @param string|null $subTitle
36
     */
37
    public function __construct(string $title, ?string $subTitle = null)
38
    {
39
        $this->title = $title;
40
        $this->subTitle = $subTitle;
41
    }
42
43
    public function getData(): array
44
    {
45
        return $this->deleteEmptyValueArray(
46
            [
47
                'titre' => $this->title,
48
                'sous-titre' => $this->subTitle,
49
                'langue' => $this->lang,
50
            ]
51
        );
52
    }
53
}
54