Completed
Pull Request — 5.1 (#94)
by Kirill
02:58
created

Support::isTraversable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 2
nop 1
1
<?php
2
namespace Analogue\ORM\System;
3
4
/**
5
 * Class Support
6
 * @package Analogue\ORM\System
7
 */
8
class Support
9
{
10
    /**
11
     * Return true if an object is an array or iterator
12
     *
13
     * @param  mixed $argument
14
     * @return boolean
15
     */
16
    public static function isTraversable($argument)
17
    {
18
        return $argument instanceof \Traversable || is_array($argument);
19
    }
20
}
21