Passed
Push — master ( 22568d...bebd68 )
by Mr
02:09
created

PaymentServiceMap::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/money-interop 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\Money\Service;
10
11
use Daikon\DataStructure\TypedMap;
12
13
final class PaymentServiceMap extends TypedMap
14
{
15 3
    public function __construct(iterable $services = [])
16
    {
17 3
        $this->init($services, [PaymentServiceInterface::class]);
18 3
    }
19
20 1
    public function enabledForRequest(): self
21
    {
22 1
        return $this->filter(
23 1
            fn(string $key, PaymentServiceInterface $paymentService): bool => $paymentService->canRequest()
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected ':', expecting T_DOUBLE_ARROW on line 23 at column 68
Loading history...
24 1
        );
25
    }
26
27 1
    public function enabledForSend(): self
28
    {
29 1
        return $this->filter(
30 1
            fn(string $key, PaymentServiceInterface $paymentService): bool => $paymentService->canSend()
31 1
        );
32
    }
33
}
34