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

_Array   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B validate() 0 17 5
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