Profile   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 1
ccs 0
cts 5
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 6 1
1
<?php
2
3
/**
4
 * Semantic representation of profile URLs
5
 *
6
 * @package   ElkArte Forum
7
 * @copyright ElkArte Forum contributors
8
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause (see accompanying LICENSE.txt file)
9
 *
10
 * @version 2.0 dev
11
 *
12
 */
13
14
namespace ElkArte\UrlGenerator\Semantic;
15
16
/**
17
 * Class Profile
18
 *
19
 * @package ElkArte\UrlGenerator\Semantic
20
 */
21
class Profile extends Standard
22
{
23
	/**
24
	 * {@inheritDoc}
25
	 */
26
	protected $_types = ['profile'];
27
28
	/**
29
	 * {@inheritDoc}
30
	 */
31
	public function generate($params)
32
	{
33
		$url = 'p/' . urlencode(strtr($params['name'], ' ', '-')) . '-' . $params['u'];
34
		unset($params['name'], $params['u'], $params['action']);
35
36
		return $url . $this->_separator . $this->generateQuery($params);
37
	}
38
}
39