Passed
Pull Request — master (#11)
by Anton
03:24
created

_Array::validate()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 17
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 7
nc 4
nop 1
1
<?php
2
3
namespace Utils\Schema {
4
5
	class _Array extends _Object {
6
7
		# Validate data
8
9
		public function validate($data) {
10
11
			if (!is_array($data)) return null;
12
13
			$result = [];
14
15
			foreach ($data as $item) {
16
17
				if (!is_array($item) || (null === ($item = parent::validate($item)))) return null;
18
19
				$result[] = $item;
20
			}
21
22
			# ------------------------
23
24
			return $result;
25
		}
26
	}
27
}
28