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

OuvrageMixComposite::handle()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 15
rs 9.9332
cc 3
nc 3
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\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
}