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.
Completed
Push — master ( debfd2...cfae8b )
by
unknown
12:32
created

BladeSkinTest.php ➔ view()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Xpressengine\Skin;
4
5
function view($view = null, $data = [], $mergeData = [])
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

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

Loading history...
Unused Code introduced by
The parameter $mergeData is not used and could be removed.

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

Loading history...
6
{
7
    return $view;
8
}
9
10
namespace Xpressengine\Tests\Skin;
11
12
use Xpressengine\Skin\BladeSkin;
0 ignored issues
show
Coding Style introduced by
USE declarations must go after the first namespace declaration
Loading history...
13
14
class BladeSkinTest extends \PHPUnit_Framework_TestCase
15
{
16 View Code Duplication
    public function testRender()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    {
18
        $skin = new TestBladeSkin();
19
        $data = 'data';
20
        $ret = $skin->setView('view')->setData($data)->render();
21
22
        $this->assertEquals('my.path.view', $ret);
23
    }
24
25
    public function testPath()
26
    {
27
        $skin = new TestBladeSkin();
28
29
        $this->assertEquals('my.path', $skin->getSkinPath());
30
        $this->assertEquals('my.path.a.b', $skin->getSkinPath('a.b'));
31
    }
32
33
    public function testRenderUsingMethod()
34
    {
35
        $skin = new TestBladeSkin();
36
        $skin->setView('my.list');
37
        $this->assertEquals('my.list', $skin->render());
38
    }
39
40
    /**
41
     * @expectedException \Xpressengine\Skin\Exceptions\PathNotAssignedException
42
     */
43
    public function testPathWhenPathNotAssigned()
44
    {
45
        $skin = new TestBladeSkinNotAssignPath();
46
        $skin->getSkinPath();
47
    }
48
49
    /**
50
     * @expectedException \Xpressengine\Skin\Exceptions\PathNotAssignedException
51
     */
52
    public function testRenderWhenPathNotAssigned()
53
    {
54
        $skin = new TestBladeSkinNotAssignPath();
55
        $skin->setView('list')->render();
56
    }
57
}
58
59
class TestBladeSkin extends BladeSkin
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
60
{
61
    protected static $id = 'test.skin';
62
    protected $path = 'my.path';
63
64
    protected function myList($view)
0 ignored issues
show
Unused Code introduced by
The parameter $view is not used and could be removed.

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

Loading history...
65
    {
66
        return 'my.list';
67
    }
68
}
69
70
class TestBladeSkinNotAssignPath extends BladeSkin
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
71
{
72
    protected static $id = 'test.skin';
73
}
74