Test Failed
Push — dev ( d4c172...a63c79 )
by Janko
09:28
created

HandleManagers   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
A __construct() 0 1 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\SpacecraftManagement;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Stu\Lib\SpacecraftManagement\Manager\ManagerInterface;
9
use Stu\Lib\SpacecraftManagement\Provider\ManagerProviderInterface;
10
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperInterface;
11
12
class HandleManagers implements HandleManagersInterface
13
{
14
    /**
15
     * @param array<ManagerInterface> $managers
16
     */
17
    public function __construct(private array $managers) {}
18
19
    #[Override]
20
    public function handle(SpacecraftWrapperInterface $wrapper, array $values, ManagerProviderInterface $managerProvider): array
21
    {
22
        $msg = [];
23
24
        foreach ($this->managers as $manager) {
25
            $msg = array_merge($msg, $manager->manage($wrapper, $values, $managerProvider));
26
        }
27
28
        return $msg;
29
    }
30
}
31