diff --git a/lib/PerceptualHash/Algorithm/PerceptionHash.php b/lib/PerceptualHash/Algorithm/PerceptionHash.php index a2f0f3e..755a4ad 100644 --- a/lib/PerceptualHash/Algorithm/PerceptionHash.php +++ b/lib/PerceptualHash/Algorithm/PerceptionHash.php @@ -22,7 +22,6 @@ class PerceptionHash implements Algorithm $row = array(); $rows = array(); $col = array(); - $cols = array(); for ($y = 0; $y < static::SIZE; $y++) { for ($x = 0; $x < static::SIZE; $x++) { $rgb = imagecolorsforindex($resized, imagecolorat($resized, $x, $y)); @@ -89,7 +88,7 @@ class PerceptionHash implements Algorithm $sum += $pixels[$j] * cos($i * pi() * ($j + 0.5) / ($size)); } $sum *= sqrt(2 / $size); - if ($i == 0) { + if ($i === 0) { $sum *= 1 / sqrt(2); } $transformed[$i] = $sum; diff --git a/tests/PerceptionHashTest.php b/tests/PerceptionHashTest.php index e54f880..0e6cd4f 100644 --- a/tests/PerceptionHashTest.php +++ b/tests/PerceptionHashTest.php @@ -3,7 +3,7 @@ use Image\PerceptualHash; use Image\PerceptualHash\Algorithm\PerceptionHash; -class PerceptualHashTest extends PHPUnit_Framework_TestCase +class PerceptionHashTest extends PHPUnit_Framework_TestCase { public function setUp() {