Passed
Push — master ( 2d0039...fd6b1a )
by Dispositif
02:43
created

OuvrageMixComposite   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 15 3
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\Domain\Transformers\Handlers;
12
13
14
use LogicException;
15
16
class OuvrageMixComposite extends AbstractMixHandler
17
{
18
    public function handle()
19
    {
20
        $components = [
21
            new MixAutoParams($this->origin, $this->book, $this->log, $this->optiStatus),
22
            new MixLienAuteur($this->origin, $this->book, $this->log, $this->optiStatus),
23
            new MixLireEnLigne($this->origin, $this->book, $this->log, $this->optiStatus),
24
            new MixTitle($this->origin, $this->book, $this->log, $this->optiStatus),
25
            new MixBnfCopyright($this->origin, $this->book, $this->log, $this->optiStatus),
26
        ];
27
28
        foreach ($components as $component) {
29
            if (!$component instanceof TransformHandlerInterface) {
30
                throw new LogicException('TransformHandlerInterface expected');
31
            }
32
            $component->handle();
33
        }
34
    }
35
}