MailHelper   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 25
ccs 0
cts 15
cp 0
rs 10
wmc 7

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefaultUrlParams() 0 2 1
A link() 0 15 5
A initialize() 0 2 1
1
<?php
2
declare(strict_types = 1);
0 ignored issues
show
Coding Style introduced by
Expected no space between directive and the equals sign in a declare statement
Loading history...
Coding Style introduced by
Expected no space between equal sign and the directive value in a declare statement
Loading history...
3
4
namespace Burzum\ZurbInky\View\Helper;
5
6
use Cake\View\Helper\HtmlHelper;
7
8
/**
9
 * Mail Helper
10
 */
11
class MailHelper extends HtmlHelper {
12
13
	public function initialize(array $config) {
0 ignored issues
show
introduced by
Missing doc comment for function initialize()
Loading history...
14
		parent::initialize($config);
15
	}
16
17
	public function setDefaultUrlParams($params, $merge = true) {
0 ignored issues
show
introduced by
Missing doc comment for function setDefaultUrlParams()
Loading history...
18
		$this->setConfig('urlParams', $params, $merge);
19
	}
20
21
	public function link($title, $url = null, array $options = []) {
0 ignored issues
show
introduced by
Missing doc comment for function link()
Loading history...
22
		if (is_array($url)) {
23
			if (!isset($url['?'])) {
24
				$url['?'] = [];
25
			}
26
			if (isset($options['urlParams'])) {
27
				if (is_array($options['urlParams'])) {
28
					$url['?'] = array_merge($url['?'], $options['urlParams']);
29
				}
30
			} else {
31
				$url['?'] = array_merge($url['?'], (array)$this->getConfig('urlParams'));
32
			}
33
		}
34
35
		return parent::link($title, $url, $options);
36
	}
37
38
}
39