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

PaymentServiceMap   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 10
wmc 1
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