TransactionAcceptedSpecification   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 0 6 4
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Korobovn\CloudPayments\Message\Strategy\Specification;
6
7
/**
8
 * @see https://developers.cloudpayments.ru/#oplata-po-kriptogramme
9
 */
10
class TransactionAcceptedSpecification implements SpecificationInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function isSatisfiedBy(array $response): bool
16
    {
17
        return isset($response['Model']['ReasonCode']) &&
18
               $response['Model']['ReasonCode'] === 0 &&
19
               (new IsSuccessSpecification)->isSatisfiedBy($response) &&
20
               (new NotMessageSpecification)->isSatisfiedBy($response);
21
    }
22
}
23