GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Value   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 109
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 109
rs 10
c 0
b 0
f 0
wmc 10
lcom 1
cbo 1

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 4 1
A prepend() 0 6 1
A append() 0 6 1
A deleteTrailing() 0 6 1
A deleteLeading() 0 6 1
A contains() 0 4 1
A starts() 0 4 1
A ends() 0 4 1
A explode() 0 4 1
1
<?php
2
/**
3
 * Util
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
namespace Pimf\Util;
9
10
/**
11
 * Value
12
 *
13
 * @package Util
14
 * @author  Gjero Krsteski <[email protected]>
15
 */
16
class Value
17
{
18
19
    /**
20
     * @var string
21
     */
22
    protected $value;
23
24
    /**
25
     * @param string $string
26
     */
27
    public function __construct($string)
28
    {
29
        $this->value = '' . $string;
30
    }
31
32
    public function __toString()
33
    {
34
        return $this->value;
35
    }
36
37
    /**
38
     * @param string $string
39
     *
40
     * @return $this
41
     */
42
    public function prepend($string)
43
    {
44
        $this->value = Character::ensureLeading($string, $this->value);
45
46
        return $this;
47
    }
48
49
    /**
50
     * @param string $string
51
     *
52
     * @return $this
53
     */
54
    public function append($string)
55
    {
56
        $this->value = Character::ensureTrailing($string, $this->value);
57
58
        return $this;
59
    }
60
61
    /**
62
     * @param string $string
63
     *
64
     * @return $this
65
     */
66
    public function deleteTrailing($string)
67
    {
68
        $this->value = Character::deleteTrailing($string, $this->value);
69
70
        return $this;
71
    }
72
73
    /**
74
     * @param string $string
75
     *
76
     * @return $this
77
     */
78
    public function deleteLeading($string)
79
    {
80
        $this->value = Character::deleteLeading($string, $this->value);
81
82
        return $this;
83
    }
84
85
    /**
86
     * @param string|array $mixed String or list of strings
87
     *
88
     * @return boolean
89
     */
90
    public function contains($mixed)
91
    {
92
        return Character::contains($this->value, $mixed);
93
    }
94
95
    /**
96
     * @param string|array $with String or list of strings
97
     *
98
     * @return boolean
99
     */
100
    public function starts($with)
101
    {
102
        return Character::startsWith($this->value, $with);
103
    }
104
105
    /**
106
     * @param string|array $with String or list of strings
107
     *
108
     * @return boolean
109
     */
110
    public function ends($with)
111
    {
112
        return Character::endsWith($this->value, $with);
113
    }
114
115
    /**
116
     * @param string $byString The delimiter string
117
     *
118
     * @return array
119
     */
120
    public function explode($byString)
121
    {
122
        return explode('' . $byString, $this->value);
123
    }
124
}
125