Completed
Push — master ( fb692e...c26f50 )
by ignace nyamagana
03:48
created

User::getContent()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
/**
3
 * League.Uri (http://uri.thephpleague.com)
4
 *
5
 * @package   League.uri
6
 * @author    Ignace Nyamagana Butera <[email protected]>
7
 * @copyright 2013-2015 Ignace Nyamagana Butera
8
 * @license   https://github.com/thephpleague/uri/blob/master/LICENSE (MIT License)
9
 * @version   4.2.0
10
 * @link      https://github.com/thephpleague/uri/
11
 */
12
namespace League\Uri\Components;
13
14
use League\Uri\Interfaces\User as UserInterface;
15
16
/**
17
 * Value object representing a URI user component.
18
 *
19
 * @package League.uri
20
 * @author  Ignace Nyamagana Butera <[email protected]>
21
 * @since   1.0.0
22
 */
23
class User extends AbstractComponent implements UserInterface
24
{
25
    /**
26
     * @inheritdoc
27
     */
28 792
    public function getContent()
29
    {
30 792
        if (null === $this->data) {
31 615
            return $this->data;
32
        }
33
34 225
        return $this->encode((string) $this->data, self::$subdelimChars);
35
    }
36
37
    /**
38
     * Return the decoded string representation of the component
39
     *
40
     * @return string
41
     */
42 30
    public function getValue()
43
    {
44 30
        return (string) $this->data;
45
    }
46
}
47