Completed
Push — master ( b12741...03b4a1 )
by Kirill
01:38
created

ArrayTypeHint   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A match() 0 14 4
1
<?php
2
/**
3
 * This file is part of Properties package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Serafim\Properties\Attribute;
11
12
/**
13
 * Class ArrayTypeHint
14
 */
15
class ArrayTypeHint extends TypeHint
16
{
17
    /**
18
     * @param iterable|mixed $values
19
     * @return bool
20
     */
21
    public function match($values): bool
22
    {
23
        if (! \is_iterable($values)) {
24
            return false;
25
        }
26
27
        foreach ($values as $value) {
28
            if (! parent::match($value)) {
29
                return false;
30
            }
31
        }
32
33
        return true;
34
    }
35
}
36