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.

PasteTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 48
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testFilter() 0 11 1
A testGetExceptionWithInvalidStringXCoordinate() 0 7 1
A testGetExceptionWithInvalidStringYCoordinate() 0 7 1
A testConvertStringCoordinateToNumber() 0 10 1
A testGetExceptionWIthNegativeCoordinate() 0 6 1
1
<?php
2
namespace HtImgModuleTest\Imagine\Filter;
3
4
use Imagine\Gd\Imagine;
5
use HtImgModule\Imagine\Filter\Paste;
6
7
class PasteTest extends \PHPUnit_Framework_TestCase
8
{
9
   public function testFilter()
10
   {
11
       $imagine = new Imagine();
12
       $flowers = $imagine->open('resources/flowers.jpg');
13
       $archos = $imagine->open('resources/Archos.jpg');
14
       $paste = new Paste($archos, 10, 30);
15
       $newImage = $paste->apply($flowers);
0 ignored issues
show
Unused Code introduced by
$newImage is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
16
       $paste = new Paste($archos, 'right', 'middle');
17
       $newImage = $paste->apply($flowers);
0 ignored issues
show
Unused Code introduced by
$newImage is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
18
       //$newImage->save('resources/paste.jpg');
0 ignored issues
show
Unused Code Comprehensibility introduced by
86% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
19
   }
20
21
   public function testGetExceptionWithInvalidStringXCoordinate()
22
   {
23
       $this->setExpectedException('HtImgModule\Exception\InvalidArgumentException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0; use expectException() instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
24
       $imagine = new Imagine();
0 ignored issues
show
Unused Code introduced by
$imagine is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
25
       $archos = $this->createMock('Imagine\Image\ImageInterface');
26
       $paste = new Paste($archos, 'asdf', 'asdf');
0 ignored issues
show
Unused Code introduced by
$paste is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
27
   }
28
29
   public function testGetExceptionWithInvalidStringYCoordinate()
30
   {
31
       $this->setExpectedException('HtImgModule\Exception\InvalidArgumentException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0; use expectException() instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
32
       $imagine = new Imagine();
0 ignored issues
show
Unused Code introduced by
$imagine is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
33
       $archos = $this->createMock('Imagine\Image\ImageInterface');
34
       $paste = new Paste($archos, 546, 'asdf');
0 ignored issues
show
Unused Code introduced by
$paste is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
35
   }
36
37
   public function testConvertStringCoordinateToNumber()
38
   {
39
       $imagine = new Imagine();
40
       $flowers = $imagine->open('resources/flowers.jpg');
41
       $archos = $imagine->open('resources/Archos.jpg');
42
       $paste = new Paste($archos, 'center', 'top');
43
       $newImage = $paste->apply($flowers);
0 ignored issues
show
Unused Code introduced by
$newImage is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
44
       $paste = new Paste($archos, 'left', 'bottom');
45
       $newImage = $paste->apply($flowers);
0 ignored issues
show
Unused Code introduced by
$newImage is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
46
   }
47
48
   public function testGetExceptionWIthNegativeCoordinate()
49
   {
50
       $this->setExpectedException('HtImgModule\Exception\InvalidArgumentException');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0; use expectException() instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
51
       $image = $this->createMock('Imagine\Image\ImageInterface');
52
       $paste = new Paste($image, -100, 'top');
0 ignored issues
show
Unused Code introduced by
$paste is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
53
   }
54
}
55