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.
Passed
Pull Request — 2.4 (#162)
by Alessandro
06:06 queued 01:52
created

StringParser::tokenize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Services;
4
5
class StringParser
6
{
7 31
    public function numberOfTokens(string $string)
8
    {
9 31
        return count($this->exploded($string));
10
    }
11
12 31
    private function exploded(string $string)
13
    {
14 31
        return explode('_', $string);
15
    }
16
17 31
    public function tokenize(string $string, int $position)
18
    {
19 31
        return $this->exploded($string)[$position];
20
    }
21
22 31
    public function camelize($string)
23
    {
24 31
        $camelized = $this->tokenize($string, 0);
25
26 31
        for ($i = 1; $i < $this->numberOfTokens($string); $i++) {
27 14
            $camelized .= ucfirst($this->tokenize($string, $i));
28
        }
29
30 31
        return $camelized;
31
    }
32
33 1
    public static function dotNotationFor(string $class)
34
    {
35 1
        $dottedFullyQualifiedClassName = str_replace( '\\', '.', $class);
36 1
        return strtolower($dottedFullyQualifiedClassName);
37
    }
38
}
39