Passed
Push — develop ( e3219b...3a1d34 )
by Laurent
01:38
created

ConfigureSettingsHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Company\Application\Settings\Handler;
15
16
use Company\Application\Settings\Command\ConfigureSettings;
17
use Company\Application\Settings\Factory\CreateSettings;
18
use Company\Domain\Storage\Settings\SaveSettings;
19
use Core\Domain\Common\Command\CommandHandlerInterface;
20
21
class ConfigureSettingsHandler implements CommandHandlerInterface
22
{
23
    private SaveSettings $saveSettings;
24
    private CreateSettings $createSettings;
25
26
    public function __construct(SaveSettings $saveSettings, CreateSettings $createSettings)
27
    {
28
        $this->saveSettings = $saveSettings;
29
        $this->createSettings = $createSettings;
30
    }
31
32
    public function __invoke(ConfigureSettings $command): void
33
    {
34
        $this->saveSettings->save(
35
            $this->createSettings->create($command)
36
        );
37
    }
38
}
39