Completed
Push — trunk ( 0d0bfe...e6cc80 )
by SuperNova.WS
03:47
created

is_iterable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
nc 2
nop 1
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * Created by Gorlum 14.02.2017 11:21
4
 */
5
6
/**
7
 * Back-compatibility functions
8
 */
9
if (!function_exists('is_iterable')) {
10
  /**
11
   * Check is variable iterable
12
   *
13
   * Compatibility function for PHP 5.x
14
   *
15
   * @param mixed $var
16
   *
17
   * @return bool
18
   */
19
  function is_iterable($var) {
20
    return is_array($var) || $var instanceof Traversable;
21
  }
22
}