Add the method Image\PerceptualHash::version()
This commit is contained in:
parent
b357936a84
commit
9a411b5087
@ -10,6 +10,8 @@ use Image\PerceptualHash\Algorithm\AverageHash;
|
|||||||
use Image\PerceptualHash\Exception\FileNotFoundException;
|
use Image\PerceptualHash\Exception\FileNotFoundException;
|
||||||
|
|
||||||
class PerceptualHash {
|
class PerceptualHash {
|
||||||
|
const VERSION = '0.1.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Algorithm Instance of Algorithm
|
* @var Algorithm Instance of Algorithm
|
||||||
*/
|
*/
|
||||||
@ -39,6 +41,14 @@ class PerceptualHash {
|
|||||||
$this->hex = $this->algorithm->hex($this->bin);
|
$this->hex = $this->algorithm->hex($this->bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string The version of Image\PerceptualHash.
|
||||||
|
*/
|
||||||
|
public static function version()
|
||||||
|
{
|
||||||
|
return (string) self::VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns binary hash.
|
* Returns binary hash.
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,14 @@ class BasicTest extends PHPUnit_Framework_TestCase
|
|||||||
$this->bin_inuo2 = '1111011111110011000000100000000011000011110000111100001111111111';
|
$this->bin_inuo2 = '1111011111110011000000100000000011000011110000111100001111111111';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testVersion()
|
||||||
|
{
|
||||||
|
$version = PerceptualHash::version();
|
||||||
|
$this->assertTrue(isset($version));
|
||||||
|
$this->assertTrue(is_string($version));
|
||||||
|
$this->assertSame(PerceptualHash::VERSION, $version);
|
||||||
|
}
|
||||||
|
|
||||||
public function testLoad()
|
public function testLoad()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user