Passed
Branch dev3 (6039a0)
by Dispositif
02:46
created

BnfHandler::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
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
namespace App\Domain\WikiOptimizer\Handlers;
11
12
class BnfHandler extends AbstractOuvrageHandler
13
{
14
    public function handle()
15
    {
16
        $bnf = $this->getParam('bnf');
17
        if (!$bnf) {
18
            return;
19
        }
20
        $bnf = str_ireplace('FRBNF', '', $bnf);
21
        $this->setParam('bnf', $bnf);
0 ignored issues
show
Bug introduced by
It seems like $bnf can also be of type array; however, parameter $value of App\Domain\WikiOptimizer...rageHandler::setParam() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

21
        $this->setParam('bnf', /** @scrutinizer ignore-type */ $bnf);
Loading history...
22
    }
23
}