Completed
Push — master ( 4d01c3...1587a2 )
by Issei
12s
created

Assert::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Issei\StreamedCsvResponse;
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
    public static function isIterable($value, $message)
21
    {
22
        if (!$value instanceof \Traversable && !is_array($value)) {
23
            throw new \InvalidArgumentException($message);
24
        }
25
    }
26
27
    private function __construct() {}
28
}
29