Assert   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isIterable() 0 6 3
A __construct() 0 1 1
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 15
    public static function isIterable($value, $message)
21
    {
22 15
        if (!$value instanceof \Traversable && !is_array($value)) {
23 2
            throw new \InvalidArgumentException($message);
24
        }
25 13
    }
26
27
    private function __construct() {}
28
}
29