Passed
Branch dev3 (ae391d)
by Dispositif
02:29
created

TalkStopValidator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of dispositif/wikibot application (@github)
4
 * 2019-2023 © Philippe M./Irønie  <[email protected]>
5
 * For the full copyright and MIT license information, view the license file.
6
 */
7
8
declare(strict_types=1);
9
10
11
namespace App\Application\OuvrageEdit\Validators;
12
13
14
use App\Application\WikiBotConfig;
15
use Mediawiki\Api\UsageException;
16
17
class TalkStopValidator implements ValidatorInterface
18
{
19
    /**
20
     * @var WikiBotConfig
21
     */
22
    protected $botConfig;
23
24
    public function __construct(WikiBotConfig $botConfig)
25
    {
26
        $this->botConfig = $botConfig;
27
    }
28
29
    /**
30
     * @throws UsageException
31
     */
32
    public function validate(): bool
33
    {
34
        $this->botConfig->checkStopOnTalkpage();
35
36
        return true;
37
    }
38
}