Completed
Push — master ( 4de594...21f32b )
by ignace nyamagana
04:46
created

Pass   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 4
c 4
b 0
f 0
lcom 0
cbo 1
dl 0
loc 30
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A validate() 0 8 2
A __toString() 0 4 1
A __debugInfo() 0 4 1
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\Pass as PassInterface;
15
16
/**
17
 * Value object representing a URI pass component.
18
 *
19
 * @package League.uri
20
 * @author  Ignace Nyamagana Butera <[email protected]>
21
 * @since   1.0.0
22
 */
23
class Pass extends AbstractComponent implements PassInterface
24
{
25
    /**
26
     * @inheritdoc
27
     */
28 813
    protected function validate($data)
29
    {
30 813
        if (null === $data) {
31 642
            return $data;
32
        }
33
34 231
        return $this->decodeComponent($this->validateString($data));
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 405
    public function __toString()
41
    {
42 405
        return $this->encodePass((string) $this->data);
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 2
    public function __debugInfo()
49
    {
50 2
        return ['pass' => $this->__toString()];
51
    }
52
}
53