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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ensureLeft() 0 11 2
A ensureRight() 0 11 2
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