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 — master (#52)
by Simone
03:32
created

testSplitStringInTokenViaUnderscore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Tests\Services;
4
5
use Mado\QueryBundle\Services\StringParser;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * @coversDefaultClass \Mado\QueryBundle\Services\StringParser
10
 */
11
class StringParserTest extends TestCase
12
{
13
    public function setUp()
14
    {
15
        $this->parser = new StringParser();
0 ignored issues
show
Bug Best Practice introduced by
The property parser does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
16
    }
17
18
    /**
19
     * @covers \Mado\QueryBundle\Services\StringParser::numberOfTokens
20
     * @covers \Mado\QueryBundle\Services\StringParser::exploded
21
     * @covers Mado\QueryBundle\Services\StringParser::numberOfTokens
22
     * @covers Mado\QueryBundle\Services\StringParser::tokenize
23
     * @dataProvider tokens
24
     */
25
    public function testSplitStringInTokenViaUnderscore(
26
        int $numberOfTokens,
27
        string $string
28
    ) {
29
        $this->assertEquals(
30
            $numberOfTokens,
31
            $this->parser->numberOfTokens($string)
32
        );
33
    }
34
35
    /**
36
     * @covers \Mado\QueryBundle\Services\StringParser::tokenize
37
     * @covers \Mado\QueryBundle\Services\StringParser::exploded
38
     * @covers Mado\QueryBundle\Services\StringParser::numberOfTokens
39
     * @covers Mado\QueryBundle\Services\StringParser::tokenize
40
     * @dataProvider tokens
41
     */
42
    public function testTo(
43
        int $numberOfTokens,
0 ignored issues
show
Unused Code introduced by
The parameter $numberOfTokens is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

43
        /** @scrutinizer ignore-unused */ int $numberOfTokens,

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
        string $string,
45
        int $tokenPosition,
46
        string $token
47
    ) {
48
        $this->assertEquals(
49
            $token,
50
            $this->parser->tokenize($string, $tokenPosition)
51
        );
52
    }
53
54
    public function tokens()
55
    {
56
        return [
57
            [1, 'foo', 0, 'foo'],
58
            [2, 'foo_bar', 0, 'foo'],
59
            [2, 'foo_bar', 1, 'bar'],
60
        ];
61
    }
62
63
    /**
64
     * @covers \Mado\QueryBundle\Services\StringParser::camelize
65
     * @covers \Mado\QueryBundle\Services\StringParser::exploded
66
     * @covers Mado\QueryBundle\Services\StringParser::numberOfTokens
67
     * @covers Mado\QueryBundle\Services\StringParser::tokenize
68
     * @dataProvider tokens
69
     */
70
    public function testCamelizeSnakeCaseToCamelCase()
71
    {
72
        $this->assertEquals(
73
            'lowerCamelCase',
74
            $this->parser->camelize('lower_camel_case')
75
        );
76
    }
77
}
78