Passed
Branch tests1.5 (59f3fd)
by Wanderson
02:32
created

Arr   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isFirst() 0 2 1
A isLast() 0 2 1
A isAssoc() 0 2 1
1
<?php
2
3
namespace Win\Format;
4
5
/**
6
 * Manipulador de Arrays
7
 *
8
 */
9
class Arr {
10
11
	/**
12
	 * @param int $i
13
	 * @return boolean
14
	 */
15
	public static function isFirst($i) {
16
		return ($i == 0);
17
	}
18
19
	/**
20
	 * @param int $i
21
	 * @param mixed[] $array
22
	 * @return boolean
23
	 */
24
	public static function isLast($i, $array) {
25
		return ($i == count($array) - 1);
26
	}
27
28
	/**
29
	 * @param mixed[] $array
30
	 * @return boolean
31
	 */
32
	public static function isAssoc($array) {
33
		return array_keys($array) !== range(0, count($array) - 1);
34
	}
35
36
}
37