Passed
Push — master ( a1929c...27d925 )
by Dispositif
02:28
created

GoogleBooksWorker::processWithDomainWorker()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
/*
4
 * This file is part of dispositif/wikibot application (@github)
5
 * 2019-2023 © Philippe M./Irønie  <[email protected]>
6
 * For the full copyright and MIT license information, view the license file.
7
 */
8
declare(strict_types=1);
9
10
namespace App\Application;
11
12
use App\Domain\GoogleTransformer;
13
use Throwable;
14
15
/**
16
 * externe goo
17
 * Class GoogleBooksWorker
18
 *
19
 * @package App\Application\Examples
20
 */
21
class GoogleBooksWorker extends AbstractBotTaskWorker
22
{
23
    public const SLEEP_AFTER_EDITION        = 60;
24
    public const TASK_BOT_FLAG              = true;
25
    public const ARTICLE_ANALYZED_FILENAME  = __DIR__.'/resources/gooBot_edited.txt';
26
    public const SKIP_LASTEDIT_BY_BOT       = false;
27
    public const SKIP_NOT_IN_MAIN_WIKISPACE = true;
28
    public const SKIP_ADQ                   = false;
29
30
    protected $modeAuto = true;
31
32
    /**
33
     * @param string      $title
34
     * @param string|null $text
35
     *
36
     * @return string|null
37
     * @throws Throwable
38
     */
39
    protected function processWithDomainWorker(string $title, string $text): ?string
40
    {
41
        $ref = new GoogleTransformer();
42
43
        return $ref->process($text);
44
    }
45
}
46
47
48
49
50
51
52
53
54