Passed
Push — 0.3.0 ( 0d73f1...9a02d7 )
by Anton
04:10
created

Menuitem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 3
1
<?php
2
3
namespace Modules\Entitizer\Dataset {
4
5
	use Modules\Entitizer, Utils\Validate;
6
7
	class Menuitem extends Entitizer\Utils\Dataset {
8
9
		use Entitizer\Common\Menuitem;
10
11
		# Init dataset
12
13
		protected function init() {
14
15
			$this->addHandler('link', function (array $data) {
16
17
				if ('' === $data['slug']) return '';
18
19
				if (false !== Validate::url($data['slug'])) return $data['slug'];
20
21
				return (INSTALL_PATH . '/' . $data['slug']);
22
			});
23
		}
24
	}
25
}
26