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.

Ensure::ensureRight()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php namespace Gears\String\Methods;
2
////////////////////////////////////////////////////////////////////////////////
3
// __________ __             ________                   __________
4
// \______   \  |__ ______  /  _____/  ____ _____ ______\______   \ _______  ___
5
//  |     ___/  |  \\____ \/   \  ____/ __ \\__  \\_  __ \    |  _//  _ \  \/  /
6
//  |    |   |   Y  \  |_> >    \_\  \  ___/ / __ \|  | \/    |   (  <_> >    <
7
//  |____|   |___|  /   __/ \______  /\___  >____  /__|  |______  /\____/__/\_ \
8
//                \/|__|           \/     \/     \/             \/            \/
9
// -----------------------------------------------------------------------------
10
//          Designed and Developed by Brad Jones <brad @="bjc.id.au" />
11
// -----------------------------------------------------------------------------
12
////////////////////////////////////////////////////////////////////////////////
13
14
use voku\helper\UTF8;
15
16
trait Ensure
17
{
18
    /**
19
     * Ensures that the string begins with $substring.
20
     *
21
     * @param  string $substring The substring to add if not present.
22
     *
23
     * @return static            The string prefixed by the $substring.
24
     */
25
    public function ensureLeft($substring)
26
    {
27
        if ($this->startsWith($substring))
28
        {
29
            return $this;
30
        }
31
        else
32
        {
33
            return $this->newSelf($substring.$this->scalarString);
34
        }
35
    }
36
37
    /**
38
     * Ensures that the string ends with $substring.
39
     *
40
     * @param  string $substring The substring to add if not present.
41
     *
42
     * @return static            The string suffixed by the $substring.
43
     */
44
    public function ensureRight($substring)
45
    {
46
        if ($this->endsWith($substring))
47
        {
48
            return $this;
49
        }
50
        else
51
        {
52
            return $this->newSelf($this->scalarString.$substring);
53
        }
54
    }
55
}
56