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

TalkStopValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 1
b 0
f 1
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A validate() 0 5 1
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
}