SubscriptionsInModelSpecification   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 0 13 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/#poisk-podpisok
9
 */
10
class SubscriptionsInModelSpecification implements SpecificationInterface
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    public function isSatisfiedBy(array $response): bool
16
    {
17
        if (! is_array($response['Model'])) {
18
            return false;
19
        }
20
21
        foreach ($response['Model'] as $item) {
22
            if (empty($item['Id'])) {
23
                return false;
24
            }
25
        }
26
27
        return true;
28
    }
29
}
30