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

Handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getContents() 0 25 3
1
<?php
2
3
namespace Modules\Extend\Utils {
4
5
	use Frames, Utils\View;
6
7
	abstract class Handler extends Frames\Admin\Area\Authorized {
8
9
		protected $loader = null;
10
11
		# Get contents
12
13
		protected function getContents() {
14
15
			$contents = View::get(static::$view_main);
16
17
			# Set items
18
19
			foreach ($this->loader->items() as $name => $data) {
20
21
				$contents->getBlock('items')->addItem($item = View::get(static::$view_item));
22
23
				foreach ($data as $property => $value) $item->$property = $value;
24
25
				# Process item
26
27
				$this->processItem($item, $data);
28
			}
29
30
			# Process contents
31
32
			$this->processContents($contents);
33
34
			# ------------------------
35
36
			return $contents;
37
		}
38
	}
39
}
40