Completed
Push — refactoring ( bfbba7...4b6f46 )
by Issei
02:22
created

Assert::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Issei;
4
5
/**
6
 * Assertion.
7
 *
8
 * {@internal Don't use this in user-land code }}
9
 *
10
 * @author Issei Murasawa <[email protected]>
11
 */
12
final class Assert
13
{
14
    /**
15
     * Throws an \InvalidArgumentException if given value is not iterable.
16
     *
17
     * @param mixed  $value
18
     * @param string $message
19
     *
20
     * @return bool
21
     */
22 15
    public static function isIterable($value, $message)
23
    {
24 15
        if (!$value instanceof \Traversable && !is_array($value)) {
25 2
            throw new \InvalidArgumentException($message);
26
        }
27 13
    }
28
29
    private function __construct()
30
    {
31
    }
32
}
33