Passed
Push — master ( 1bcf8b...aa70d7 )
by Dispositif
05:36
created

Summary::isBotFlag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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
 * See also EditSummaryTrait
15
 */
16
class Summary
17
{
18
    public $taskName;
19
    public $prefix = '';
20
    public $citationNumber = 0;
21
    public $botFlag = false;
22
    public $minorFlag = false;
23
    public $memo = [];
24
25
    /**
26
     * Summary constructor.
27
     *
28
     * @param $taskName
29
     */
30
    public function __construct(string $taskName)
31
    {
32
        $this->taskName = $taskName;
33
    }
34
35
    public function serialize(): string
36
    {
37
        $prefixSummary = ($this->botFlag) ? 'bot: ' : '';
38
39
        return trim($prefixSummary.$this->taskName);
40
    }
41
42
    /**
43
     * @return bool
44
     */
45
    public function isBotFlag(): bool
46
    {
47
        return $this->botFlag;
48
    }
49
50
    /**
51
     * @param bool $botFlag
52
     */
53
    public function setBotFlag(bool $botFlag): void
54
    {
55
        $this->botFlag = $botFlag;
56
    }
57
58
    /**
59
     * @return bool
60
     */
61
    public function isMinorFlag(): bool
62
    {
63
        return $this->minorFlag;
64
    }
65
66
    /**
67
     * @param bool $minorFlag
68
     */
69
    public function setMinorFlag(bool $minorFlag): void
70
    {
71
        $this->minorFlag = $minorFlag;
72
    }
73
74
}
75