Passed
Push — master ( afe250...86c80a )
by Mr
08:24
created

MigrationTargetMap::getEnabledTargets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/dbal project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Dbal\Migration;
10
11
use Daikon\DataStructure\TypedMapInterface;
12
use Daikon\DataStructure\TypedMapTrait;
13
14
final class MigrationTargetMap implements TypedMapInterface
15
{
16
    use TypedMapTrait;
17
18
    public function __construct(iterable $migrationTargets = [])
19
    {
20
        $this->init($migrationTargets, [MigrationTargetInterface::class]);
21
    }
22
23
    public function getEnabledTargets(): self
24
    {
25
        return $this->filter(
26
            fn(string $name, MigrationTargetInterface $target): bool => $target->isEnabled()
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected ':', expecting T_DOUBLE_ARROW on line 26 at column 62
Loading history...
27
        );
28
    }
29
}
30