From 28f1d98260c693f392e6c68ba528db181d5353d4 Mon Sep 17 00:00:00 2001 From: Fahmi Ardi Date: Sat, 28 Jun 2014 18:54:53 +0700 Subject: [PATCH 01/27] add branch alias --- composer.json | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index beeb25a..cbfc170 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,24 @@ { - "name": "hasbridge/php-color", + "name": "fahmiardi/php-color", "description": "Color utility class for PHP 5.3 that allows for easy conversion between RGB, HSV, XYZ, and Lab colorspaces, as well as color comparison", "license": "MIT", "autoload": { - "psr-0": {"Color": ""} + "psr-0": { + "Color": "" + } }, "require": { "php": "~5.3" - } + }, + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/fahmiardi/php-color.git" + } + ] } From eefe63c1dc4a4487bdd7d462ffddcc1023a9588e Mon Sep 17 00:00:00 2001 From: Daniel Holzmann Date: Thu, 14 Aug 2014 17:29:35 +0200 Subject: [PATCH 02/27] fixed invalid annoation --- Color.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Color.php b/Color.php index ad00457..9be892f 100644 --- a/Color.php +++ b/Color.php @@ -372,7 +372,7 @@ public function getDistanceLabFrom(Color $color) /** * Detect if color is grayscale * - * @param int @threshold + * @param int $threshold * * @return bool */ From f25ddaa57fbf8fe305bc4c1fd1b0115288c4e4d8 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 08:43:07 +0000 Subject: [PATCH 03/27] Assumption of maintainance. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cbfc170..ce82a0c 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "fahmiardi/php-color", + "name": "matthewbaggett/php-color", "description": "Color utility class for PHP 5.3 that allows for easy conversion between RGB, HSV, XYZ, and Lab colorspaces, as well as color comparison", "license": "MIT", "autoload": { @@ -18,7 +18,7 @@ "repositories": [ { "type": "git", - "url": "https://github.com/fahmiardi/php-color.git" + "url": "https://github.com/matthewbaggett/php-color" } ] } From cfe9cb660684a090cc3b6fd1c76280d049f0ba8c Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 09:41:43 +0000 Subject: [PATCH 04/27] Add support for Hex Strings and CIE XYBri values. --- Color.php | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 3 deletions(-) diff --git a/Color.php b/Color.php index 9be892f..270ca94 100644 --- a/Color.php +++ b/Color.php @@ -71,6 +71,29 @@ public function fromRgbHex($red, $green, $blue) { return $this->fromRgbInt(hexdec($red), hexdec($green), hexdec($blue)); } + + /** + * Init color from a hex RGB string (#00FF00) + * + * @param $hex + * @return Color + */ + public function fromRgbString($hex) + { + $hex = str_replace("#", "", $hex); + + if(strlen($hex) == 3) { + $r = hexdec(substr($hex,0,1).substr($hex,0,1)); + $g = hexdec(substr($hex,1,1).substr($hex,1,1)); + $b = hexdec(substr($hex,2,1).substr($hex,2,1)); + } else { + $r = hexdec(substr($hex,0,2)); + $g = hexdec(substr($hex,2,2)); + $b = hexdec(substr($hex,4,2)); + } + + return $this->fromRgbInt($r, $g, $b); + } /** * Init color from integer value @@ -85,7 +108,37 @@ public function fromInt($intValue) return $this; } - + + /** + * Init color from a CIE XYBri value + * + * @param $x + * @param $y + * @param $brightness + * @return Color + */ + public function fromXYBri($x, $y, $brightness) + { + $_x = ($x * $brightness) / $y; + $_y = $brightness; + $_z = ((1 - $x - $y) * $brightness) / $y; + + $r = $_x * 3.2406 + $_y * -1.5372 + $_z * -0.4986; + $g = $_x * -0.9689 + $_y * 1.8758 + $_z * 0.0415; + $b = $_x * 0.0557 + $_y * -0.2040 + $_z * 1.0570; + + $r = $r > 0.0031308 ? 1.055 * pow($r, 1 / 2.4) - 0.055 : 12.92 * $r; + $g = $g > 0.0031308 ? 1.055 * pow($g, 1 / 2.4) - 0.055 : 12.92 * $g; + $b = $b > 0.0031308 ? 1.055 * pow($b, 1 / 2.4) - 0.055 : 12.92 * $b; + + $r = $r > 0 ? round($r * 255) : 0; + $g = $g > 0 ? round($g * 255) : 0; + $b = $b > 0 ? round($b * 255) : 0; + + return $this->fromRgbInt($r, $g, $b); + } + + /** * Convert color to hex * @@ -121,6 +174,20 @@ public function toRgbHex() return dechex($item); }, $this->toRgbInt()); } + + /** + * Convert color to an RGB Hex string (#00FF00) + * + * @return string + */ + public function toRgbString() + { + $hexes = $this->toRgbHex(); + array_walk($hexes, function(&$hex, $key){ + $hex = str_pad($hex,2,"0",STR_PAD_LEFT); + }); + return "#" . implode('', $hexes); + } /** * Get Hue/Saturation/Value for the current color @@ -292,7 +359,7 @@ public function toLabCie() return $lab; } - + /** * Convert color to integer * @@ -302,7 +369,43 @@ public function toInt() { return $this->color; } - + + /** + * Convert color to a CIE XYBri array. + * + * @return array + * @throws Exception + */ + public function toXYBri(){ + $rgb = $this->toRgbInt(); + + $r = $rgb['red']; + $g = $rgb['green']; + $b = $rgb['blue']; + + $r = $r / 255; + $g = $g / 255; + $b = $b / 255; + + if ($r < 0 || $r > 1 || $g < 0 || $g > 1 || $b < 0 || $b > 1) { + throw new \Exception("Invalid RGB array. [{$r},{$b},{$g}]"); + } + + $rt = ($r > 0.04045) ? pow(($r + 0.055) / (1.0 + 0.055), 2.4) : ($r / 12.92); + $gt = ($g > 0.04045) ? pow(($g + 0.055) / (1.0 + 0.055), 2.4) : ($g / 12.92); + $bt = ($b > 0.04045) ? pow(($b + 0.055) / (1.0 + 0.055), 2.4) : ($b / 12.92); + + $cie_x = $rt * 0.649926 + $gt * 0.103455 + $bt * 0.197109; + $cie_y = $rt * 0.234327 + $gt * 0.743075 + $bt * 0.022598; + $cie_z = $rt * 0.0000000 + $gt * 0.053077 + $bt * 1.035763; + + $hue_x = $cie_x / ($cie_x + $cie_y + $cie_z); + $hue_y = $cie_y / ($cie_x + $cie_y + $cie_z); + + return array('x'=>$hue_x,'y'=>$hue_y,'bri'=>$cie_y); + } + + /** * Alias of toString() * From cfa985b45b1b3000213f9f18a8d442d806aadcee Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 09:49:06 +0000 Subject: [PATCH 05/27] Initial test code.. doesn't work yet. --- composer.json | 3 +++ tests/CIETest.php | 11 +++++++++++ tests/HexTest.php | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/CIETest.php create mode 100644 tests/HexTest.php diff --git a/composer.json b/composer.json index ce82a0c..5a8983e 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,9 @@ "require": { "php": "~5.3" }, + "require-dev": { + "phpunit/phpunit": "*" + }, "extra": { "branch-alias": { "dev-master": "0.1-dev" diff --git a/tests/CIETest.php b/tests/CIETest.php new file mode 100644 index 0000000..bb99e1c --- /dev/null +++ b/tests/CIETest.php @@ -0,0 +1,11 @@ + Date: Sun, 8 Feb 2015 10:14:28 +0000 Subject: [PATCH 06/27] caps output --- Color.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Color.php b/Color.php index 270ca94..349ea09 100644 --- a/Color.php +++ b/Color.php @@ -186,7 +186,7 @@ public function toRgbString() array_walk($hexes, function(&$hex, $key){ $hex = str_pad($hex,2,"0",STR_PAD_LEFT); }); - return "#" . implode('', $hexes); + return "#" . strtoupper(implode('', $hexes)); } /** From eaa081315b54ddb0ab02131c3391ad8901ae23ab Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:17:32 +0000 Subject: [PATCH 07/27] Test hex input/output. --- tests/HexTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/HexTest.php b/tests/HexTest.php index 300f351..1687f42 100644 --- a/tests/HexTest.php +++ b/tests/HexTest.php @@ -7,5 +7,29 @@ */ class HexTest extends PHPUnit_Framework_TestCase { + private $array_of_colours; + private $color; + public function setUp(){ + $this->color = new Color(); + $this->array_of_colours = [ + "16711680" => "FF0000", "12529712" => "BF3030", "10878976" => "A60000", "16728128" => "FF4040", "16741235" => "FF7373", "16741376" => "FF7400", "12546352" => "BF7130", "10898176" => "A64B00", "16750144" => "FF9640", "16757363" => "FFB273", "13434996" => "CD0074", "10036839" => "992667", "8716363" => "85004B", "15088027" => "E6399B", "15099823" => "E667AF", "8448000" => "80E800", "7581228" => "73AE2C", "5478144" => "539700", "10613821" => "A1F43D", "12055662" => "B7F46E", "46922" => "00B74A", "2263628" => "228A4C", "30512" => "007730", "3660665" => "37DB79", "6544275" => "63DB93", "14678528" => "DFFA00", "11320111" => "ACBB2F", "9544192" => "91A200", "15268927" => "E8FC3F", "15596658" => "EDFC72", "1196203" => "1240AB", "2770048" => "2A4480", "403055" => "06266F", "4616661" => "4671D5", "7113941" => "6C8CD5", "3740847" => "3914AF", "4271236" => "412C84", "2099058" => "200772", "6965463" => "6A48D7", "8875735" => "876ED7", "39321" => "009999", "1930099" => "1D7373", "25443" => "006363", "3394764" => "33CCCC", "6081740" => "5CCCCC", "7408042" => "7109AA", "6235520" => "5F2580", "4719471" => "48036F", "10436309" => "9F3ED5", "11364053" => "AD66D5", "16750336" => "FF9700", "12551472" => "BF8530", "10904064" => "A66200", "16757056" => "FFB140", "16762483" => "FFC673", "16761600" => "FFC300", "12557872" => "BF9E30", "10911488" => "A67F00", "16765504" => "FFD240", "16768627" => "FFDE73", "16732928" => "FF5300", "12541488" => "BF5E30", "10892800" => "A63600", "16744000" => "FF7E40", "16752755" => "FFA073", "16776960" => "FFFF00", "12566320" => "BFBF30", "10921472" => "A6A600", "16777024" => "FFFF40", "16777075" => "FFFF73", "10481152" => "9FEE00", "8827693" => "86B32D", "6789888" => "679B00", "12187454" => "B9F73E", "13236079" => "C9F76F", "16765696" => "FFD300", "12560176" => "BFA730", "10914048" => "A68900", "16768576" => "FFDE40", "16770931" => "FFE773" + ]; + } + + public function testHexInput(){ + foreach($this->array_of_colours as $int => $hex) { + $color = new Color(); + $color->fromInt($int); + $this->assertEquals("#" . $hex, $color->toRgbString()); + } + } + + public function testHexOutput(){ + foreach($this->array_of_colours as $int => $hex) { + $color = new Color(); + $color->fromRgbString($hex); + $this->assertEquals($int, $color->toInt()); + } + } } From deb8d7ab105bfa37cf6be0c2efafa4d4622ad92e Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:20:40 +0000 Subject: [PATCH 08/27] Add Travis YML. Remove CIETest for now. --- .travis.yml | 27 +++++++++++++++++++++++++++ tests/CIETest.php | 11 ----------- 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 .travis.yml delete mode 100644 tests/CIETest.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9f3382e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +# see http://about.travis-ci.org/docs/user/languages/php/ for more hints +language: php + +# list any PHP version you want to test against +php: + # aliased to a recent 5.3.x version + - 5.3 + # aliased to a recent 5.4.x version + - 5.4 + # aliased to a recent 5.5.x version + - 5.5 + # aliased to a recent 5.6.x version + - 5.6 + + +# execute any number of scripts before the test run, custom env's are available as variables +before_script: + +# omitting "script:" will default to phpunit +# use the $DB env variable to determine the phpunit.xml to use +#script: phpunit --configuration phpunit_$DB.xml --coverage-text +script: phpunit --configuration phpunit.xml --coverage-text + +# configure notifications (email, IRC, campfire etc) +notifications: + email: + - matthew@baggett.me \ No newline at end of file diff --git a/tests/CIETest.php b/tests/CIETest.php deleted file mode 100644 index bb99e1c..0000000 --- a/tests/CIETest.php +++ /dev/null @@ -1,11 +0,0 @@ - Date: Sun, 8 Feb 2015 10:23:48 +0000 Subject: [PATCH 09/27] Almost-bare phpunit.xml --- phpunit.xml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 phpunit.xml diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..869f6a1 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,7 @@ + + + + tests/HexTest.php + + + \ No newline at end of file From c2467d58c71d0f5a54a8bc9c6951dd8df04ec1e4 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:27:43 +0000 Subject: [PATCH 10/27] remove short array syntax for 5.3 support --- tests/HexTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/HexTest.php b/tests/HexTest.php index 1687f42..9b0e566 100644 --- a/tests/HexTest.php +++ b/tests/HexTest.php @@ -12,9 +12,9 @@ class HexTest extends PHPUnit_Framework_TestCase { public function setUp(){ $this->color = new Color(); - $this->array_of_colours = [ + $this->array_of_colours = array( "16711680" => "FF0000", "12529712" => "BF3030", "10878976" => "A60000", "16728128" => "FF4040", "16741235" => "FF7373", "16741376" => "FF7400", "12546352" => "BF7130", "10898176" => "A64B00", "16750144" => "FF9640", "16757363" => "FFB273", "13434996" => "CD0074", "10036839" => "992667", "8716363" => "85004B", "15088027" => "E6399B", "15099823" => "E667AF", "8448000" => "80E800", "7581228" => "73AE2C", "5478144" => "539700", "10613821" => "A1F43D", "12055662" => "B7F46E", "46922" => "00B74A", "2263628" => "228A4C", "30512" => "007730", "3660665" => "37DB79", "6544275" => "63DB93", "14678528" => "DFFA00", "11320111" => "ACBB2F", "9544192" => "91A200", "15268927" => "E8FC3F", "15596658" => "EDFC72", "1196203" => "1240AB", "2770048" => "2A4480", "403055" => "06266F", "4616661" => "4671D5", "7113941" => "6C8CD5", "3740847" => "3914AF", "4271236" => "412C84", "2099058" => "200772", "6965463" => "6A48D7", "8875735" => "876ED7", "39321" => "009999", "1930099" => "1D7373", "25443" => "006363", "3394764" => "33CCCC", "6081740" => "5CCCCC", "7408042" => "7109AA", "6235520" => "5F2580", "4719471" => "48036F", "10436309" => "9F3ED5", "11364053" => "AD66D5", "16750336" => "FF9700", "12551472" => "BF8530", "10904064" => "A66200", "16757056" => "FFB140", "16762483" => "FFC673", "16761600" => "FFC300", "12557872" => "BF9E30", "10911488" => "A67F00", "16765504" => "FFD240", "16768627" => "FFDE73", "16732928" => "FF5300", "12541488" => "BF5E30", "10892800" => "A63600", "16744000" => "FF7E40", "16752755" => "FFA073", "16776960" => "FFFF00", "12566320" => "BFBF30", "10921472" => "A6A600", "16777024" => "FFFF40", "16777075" => "FFFF73", "10481152" => "9FEE00", "8827693" => "86B32D", "6789888" => "679B00", "12187454" => "B9F73E", "13236079" => "C9F76F", "16765696" => "FFD300", "12560176" => "BFA730", "10914048" => "A68900", "16768576" => "FFDE40", "16770931" => "FFE773" - ]; + ); } public function testHexInput(){ From a594316e587680ac7c75b4aa45f9f6ee329f59f9 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:33:33 +0000 Subject: [PATCH 11/27] Add composer.lock --- composer.lock | 971 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 971 insertions(+) create mode 100644 composer.lock diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..d93cfa6 --- /dev/null +++ b/composer.lock @@ -0,0 +1,971 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "257b0b481f25c0b73b27a1374e173ccb", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Instantiator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2014-10-13 12:58:55" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03 12:10:50" + }, + { + "name": "phpspec/prophecy", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9ca52329bcdd1500de24427542577ebf3fc2f1c9", + "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.2", + "phpdocumentor/reflection-docblock": "~2.0" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "http://phpspec.org", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2014-11-17 16:23:49" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", + "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-01-24 10:06:35" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", + "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-01-17 09:51:32" + }, + { + "name": "phpunit/phpunit", + "version": "4.5.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "5b578d3865a9128b9c209b011fda6539ec06e7a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5b578d3865a9128b9c209b011fda6539ec06e7a5", + "reference": "5b578d3865a9128b9c209b011fda6539ec06e7a5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "~1.3.1", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.2", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.2", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2015-02-05 15:51:19" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "c63d2367247365f688544f0d500af90a11a44c65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", + "reference": "c63d2367247365f688544f0d500af90a11a44c65", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.1", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2014-10-03 05:12:11" + }, + { + "name": "sebastian/comparator", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-01-29 16:28:08" + }, + { + "name": "sebastian/diff", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2014-08-15 10:29:00" + }, + { + "name": "sebastian/environment", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2014-10-25 08:00:45" + }, + { + "name": "sebastian/exporter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "84839970d05254c73cde183a721c7af13aede943" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", + "reference": "84839970d05254c73cde183a721c7af13aede943", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-01-27 07:23:06" + }, + { + "name": "sebastian/global-state", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2014-10-06 09:23:50" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-01-24 09:48:32" + }, + { + "name": "sebastian/version", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", + "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2014-12-15 14:25:24" + }, + { + "name": "symfony/yaml", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "~5.3" + }, + "platform-dev": [] +} From ea4a4c16ac448ecdb0e5df96455892da40c3031f Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:33:41 +0000 Subject: [PATCH 12/27] Adding phpunit.xml --- phpunit.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 869f6a1..510abbb 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,8 @@ - + - + tests/HexTest.php From 50eb070a156758f97819977b4d7d50475523c492 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:36:23 +0000 Subject: [PATCH 13/27] Bad Travis config --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f3382e..12c6cf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ language: php # list any PHP version you want to test against php: # aliased to a recent 5.3.x version - - 5.3 + - 5.3 # aliased to a recent 5.4.x version - - 5.4 + - 5.4 # aliased to a recent 5.5.x version - 5.5 # aliased to a recent 5.6.x version @@ -14,7 +14,7 @@ php: # execute any number of scripts before the test run, custom env's are available as variables -before_script: +#before_script: # omitting "script:" will default to phpunit # use the $DB env variable to determine the phpunit.xml to use From fd047f6a2f7c53cbed2c1755fae00ac79623fb1e Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:37:46 +0000 Subject: [PATCH 14/27] Add build icon. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4b04659..b13d9b1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # PHP Color Utility Class +![Travis CI](https://travis-ci.org/matthewbaggett/php-color.svg) + This class is intended to make it easier to convert between colorspaces, as well as compare one color to another. From aa3fbbe656aed5483e5e5535e256922723f4affc Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 10:41:41 +0000 Subject: [PATCH 15/27] add composer install step. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 12c6cf7..a0fde58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,8 @@ php: # execute any number of scripts before the test run, custom env's are available as variables -#before_script: +before_script: + - composer install # omitting "script:" will default to phpunit # use the $DB env variable to determine the phpunit.xml to use From 77d2276dc12d81f0c1230740d7deecaa454bbf21 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 11:29:46 +0000 Subject: [PATCH 16/27] Survive /0 --- Color.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Color.php b/Color.php index 349ea09..b032dfb 100644 --- a/Color.php +++ b/Color.php @@ -399,9 +399,13 @@ public function toXYBri(){ $cie_y = $rt * 0.234327 + $gt * 0.743075 + $bt * 0.022598; $cie_z = $rt * 0.0000000 + $gt * 0.053077 + $bt * 1.035763; - $hue_x = $cie_x / ($cie_x + $cie_y + $cie_z); - $hue_y = $cie_y / ($cie_x + $cie_y + $cie_z); - + if($cie_x + $cie_y + $cie_z == 0){ + $hue_x = 0.1; + $hue_y = 0.1; + }else { + $hue_x = $cie_x / ($cie_x + $cie_y + $cie_z); + $hue_y = $cie_y / ($cie_x + $cie_y + $cie_z); + } return array('x'=>$hue_x,'y'=>$hue_y,'bri'=>$cie_y); } From 92cc2dbb9e0d8d5a3421b24fc2718e5871be9ce2 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 11:57:20 +0000 Subject: [PATCH 17/27] Actual tests! Need to work out why XYBri has such a sucky accuracy issue once you start pushing towards extremely bright colours. --- phpunit.xml | 4 +- tests/GenerateTest.php | 103 +++++++++++++++++++++++++++++++++++++++++ tests/HexTest.php | 35 -------------- 3 files changed, 105 insertions(+), 37 deletions(-) create mode 100644 tests/GenerateTest.php delete mode 100644 tests/HexTest.php diff --git a/phpunit.xml b/phpunit.xml index 510abbb..ad9939f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,9 @@ + stopOnFailure="false"> - tests/HexTest.php + tests/GenerateTest.php \ No newline at end of file diff --git a/tests/GenerateTest.php b/tests/GenerateTest.php new file mode 100644 index 0000000..a657df6 --- /dev/null +++ b/tests/GenerateTest.php @@ -0,0 +1,103 @@ +color = new Color(); + } + + public function testHexInput(){ + $color = new Color(); + $this->assertEquals('#000000', $color->fromInt(0)->toRgbString()); + $this->assertEquals('#FF0000', $color->fromInt(hexdec('FF0000'))->toRgbString()); + $this->assertEquals('#00FF00', $color->fromInt(hexdec('00FF00'))->toRgbString()); + $this->assertEquals('#0000FF', $color->fromInt(hexdec('0000FF'))->toRgbString()); + $this->assertEquals('#F0F0F0', $color->fromInt(hexdec('F0F0F0'))->toRgbString()); + $this->assertEquals('#0F0F0F', $color->fromInt(hexdec('0F0F0F'))->toRgbString()); + $this->assertEquals('#123456', $color->fromInt(hexdec('123456'))->toRgbString()); + $this->assertEquals('#654321', $color->fromInt(hexdec('654321'))->toRgbString()); + } + + public function testExport(){ + // Generate an export of data. + $min = hexdec("000000"); + $max = hexdec("FFFFFF"); + $step = round($max/pow(2,self::step_density)); + #$step = 1; + $array_of_colours = array(); + echo "Taking " . $max - $min . " colours in {$step} steps\n"; + for($i = $min; $i <= $max; $i = $i + $step){ + $color = new Color(); + $color->fromInt($i); + $array_of_colours[$i]['hex'] = $color->toRgbString(); + $array_of_colours[$i]['HsvFloat'] = $color->toHsvFloat(); + $array_of_colours[$i]['XYBri'] = $color->toXYBri(); + } + return $array_of_colours; + } + + /** + * @depends testExport + */ + public function testExpectedFields($array_of_colours){ + $element = end($array_of_colours); + + // Test HEX + $this->assertEquals(7, strlen($element['hex']), "Hex string is long enough"); + $this->assertStringMatchesFormat("#%x", $element['hex'], "Hex string is valid"); + + // Test XYBri + $this->assertArrayHasKey("x", $element['XYBri']); + $this->assertArrayHasKey("y", $element['XYBri']); + $this->assertArrayHasKey("bri", $element['XYBri']); + $this->assertGreaterThanOrEqual(0, $element['XYBri']['x']); + $this->assertGreaterThanOrEqual(0, $element['XYBri']['y']); + $this->assertGreaterThanOrEqual(0, $element['XYBri']['bri']); + + // Test HSV + $this->assertArrayHasKey("hue", $element['HsvFloat']); + $this->assertArrayHasKey("sat", $element['HsvFloat']); + $this->assertArrayHasKey("val", $element['HsvFloat']); + + } + + /** + * @depends testExport + */ + public function testOutput($array_of_colours){ + foreach($array_of_colours as $int => $export) { + $color_from_hex = new Color(); + $color_from_hex->fromRgbString($export['hex']); + + $color_from_xybri = new Color(); + $color_from_xybri->fromXYBri($export['XYBri']['x'], $export['XYBri']['y'], $export['XYBri']['bri']); + + $distance_rgb_between_hex_and_xybri = $color_from_hex->getDistanceRgbFrom($color_from_xybri); + $distance_lab_between_hex_and_xybri = $color_from_hex->getDistanceLabFrom($color_from_xybri); + + #if($distance_lab_between_hex_and_xybri > 3.3) { + # echo "{$int} => {$export['hex']} ... Distance = {$distance_rgb_between_hex_and_xybri} or {$distance_lab_between_hex_and_xybri} ({$color_from_hex->toRgbString()} vs {$color_from_xybri->toRgbString()})\n"; + # echo " > {$export['XYBri']['x']}, {$export['XYBri']['y']}, {$export['XYBri']['bri']}\n"; + # echo "\n"; + #} + + // Assert that the Integer we have matches the one from the hex + $this->assertEquals($int, $color_from_hex->toInt()); + + // Assert that the delta between hex and xybri isn't too vast. + $this->assertLessThanOrEqual(self::accuracy_loss_limit, $distance_rgb_between_hex_and_xybri, "Assure colour Accuracy loss is less than " . self::accuracy_loss_limit . ". {$int} => {$export['hex']} ... Distance = {$distance_rgb_between_hex_and_xybri} or {$distance_lab_between_hex_and_xybri} ({$color_from_hex->toRgbString()} vs {$color_from_xybri->toRgbString()})"); + + } + } + +} diff --git a/tests/HexTest.php b/tests/HexTest.php deleted file mode 100644 index 9b0e566..0000000 --- a/tests/HexTest.php +++ /dev/null @@ -1,35 +0,0 @@ -color = new Color(); - $this->array_of_colours = array( - "16711680" => "FF0000", "12529712" => "BF3030", "10878976" => "A60000", "16728128" => "FF4040", "16741235" => "FF7373", "16741376" => "FF7400", "12546352" => "BF7130", "10898176" => "A64B00", "16750144" => "FF9640", "16757363" => "FFB273", "13434996" => "CD0074", "10036839" => "992667", "8716363" => "85004B", "15088027" => "E6399B", "15099823" => "E667AF", "8448000" => "80E800", "7581228" => "73AE2C", "5478144" => "539700", "10613821" => "A1F43D", "12055662" => "B7F46E", "46922" => "00B74A", "2263628" => "228A4C", "30512" => "007730", "3660665" => "37DB79", "6544275" => "63DB93", "14678528" => "DFFA00", "11320111" => "ACBB2F", "9544192" => "91A200", "15268927" => "E8FC3F", "15596658" => "EDFC72", "1196203" => "1240AB", "2770048" => "2A4480", "403055" => "06266F", "4616661" => "4671D5", "7113941" => "6C8CD5", "3740847" => "3914AF", "4271236" => "412C84", "2099058" => "200772", "6965463" => "6A48D7", "8875735" => "876ED7", "39321" => "009999", "1930099" => "1D7373", "25443" => "006363", "3394764" => "33CCCC", "6081740" => "5CCCCC", "7408042" => "7109AA", "6235520" => "5F2580", "4719471" => "48036F", "10436309" => "9F3ED5", "11364053" => "AD66D5", "16750336" => "FF9700", "12551472" => "BF8530", "10904064" => "A66200", "16757056" => "FFB140", "16762483" => "FFC673", "16761600" => "FFC300", "12557872" => "BF9E30", "10911488" => "A67F00", "16765504" => "FFD240", "16768627" => "FFDE73", "16732928" => "FF5300", "12541488" => "BF5E30", "10892800" => "A63600", "16744000" => "FF7E40", "16752755" => "FFA073", "16776960" => "FFFF00", "12566320" => "BFBF30", "10921472" => "A6A600", "16777024" => "FFFF40", "16777075" => "FFFF73", "10481152" => "9FEE00", "8827693" => "86B32D", "6789888" => "679B00", "12187454" => "B9F73E", "13236079" => "C9F76F", "16765696" => "FFD300", "12560176" => "BFA730", "10914048" => "A68900", "16768576" => "FFDE40", "16770931" => "FFE773" - ); - } - - public function testHexInput(){ - foreach($this->array_of_colours as $int => $hex) { - $color = new Color(); - $color->fromInt($int); - $this->assertEquals("#" . $hex, $color->toRgbString()); - } - } - - public function testHexOutput(){ - foreach($this->array_of_colours as $int => $hex) { - $color = new Color(); - $color->fromRgbString($hex); - $this->assertEquals($int, $color->toInt()); - } - } -} From 60c44ae8cd06fec005e03424229c5cb18f1c5239 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 12:00:18 +0000 Subject: [PATCH 18/27] Remove Comment. --- tests/GenerateTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GenerateTest.php b/tests/GenerateTest.php index a657df6..bfa3950 100644 --- a/tests/GenerateTest.php +++ b/tests/GenerateTest.php @@ -35,7 +35,7 @@ public function testExport(){ $step = round($max/pow(2,self::step_density)); #$step = 1; $array_of_colours = array(); - echo "Taking " . $max - $min . " colours in {$step} steps\n"; + #echo "Taking " . ($max - $min) . " colours in {$step} steps\n"; for($i = $min; $i <= $max; $i = $i + $step){ $color = new Color(); $color->fromInt($i); From 5d4a3ec07ae0ea79c25cdbc360245514abcf1037 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 12:03:08 +0000 Subject: [PATCH 19/27] Not using $this->color --- tests/GenerateTest.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/GenerateTest.php b/tests/GenerateTest.php index bfa3950..0bce23f 100644 --- a/tests/GenerateTest.php +++ b/tests/GenerateTest.php @@ -10,12 +10,6 @@ class HexTest extends PHPUnit_Framework_TestCase { const accuracy_loss_limit = 500; const step_density = 12; - private $color; - - public function setUp(){ - $this->color = new Color(); - } - public function testHexInput(){ $color = new Color(); $this->assertEquals('#000000', $color->fromInt(0)->toRgbString()); From e55d92717fc99ef874cced7e20d0032a3481597e Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 12:12:26 +0000 Subject: [PATCH 20/27] This could have never worked. Neat. Tests ftw. --- Color.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Color.php b/Color.php index b032dfb..9eec340 100644 --- a/Color.php +++ b/Color.php @@ -436,9 +436,9 @@ public function toString() /** * Get the distance between this color and the given color - * - * @param Color $color - * + * + * @param Color $color + * * @return int */ public function getDistanceRgbFrom(Color $color) @@ -457,9 +457,9 @@ public function getDistanceRgbFrom(Color $color) /** * Get distance from the given color using the Delta E method - * - * @param Color $color - * + * + * @param Color $color + * * @return float */ public function getDistanceLabFrom(Color $color) @@ -508,9 +508,9 @@ public function getClosestMatch(array $colors) $matchKey = null; foreach($colors as $key => $color) { if (false === ($color instanceof Color)) { - $c = new Color($color); + $color = new Color($color); } - $dist = $this->getDistanceLabFrom($c); + $dist = $this->getDistanceLabFrom($color); if ($dist < $matchDist) { $matchDist = $dist; $matchKey = $key; From 9f5946376a815cc7b8b2196158b0e9dbf26ca2b6 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 12:26:50 +0000 Subject: [PATCH 21/27] Improving code coverage --- tests/GenerateTest.php | 86 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/tests/GenerateTest.php b/tests/GenerateTest.php index 0bce23f..a0ae4cb 100644 --- a/tests/GenerateTest.php +++ b/tests/GenerateTest.php @@ -35,6 +35,7 @@ public function testExport(){ $color->fromInt($i); $array_of_colours[$i]['hex'] = $color->toRgbString(); $array_of_colours[$i]['HsvFloat'] = $color->toHsvFloat(); + $array_of_colours[$i]['HsvInt'] = $color->toHsvInt(); $array_of_colours[$i]['XYBri'] = $color->toXYBri(); } return $array_of_colours; @@ -58,11 +59,16 @@ public function testExpectedFields($array_of_colours){ $this->assertGreaterThanOrEqual(0, $element['XYBri']['y']); $this->assertGreaterThanOrEqual(0, $element['XYBri']['bri']); - // Test HSV + // Test HSV Float $this->assertArrayHasKey("hue", $element['HsvFloat']); $this->assertArrayHasKey("sat", $element['HsvFloat']); $this->assertArrayHasKey("val", $element['HsvFloat']); + // Test HSV Int + $this->assertArrayHasKey("hue", $element['HsvInt']); + $this->assertArrayHasKey("sat", $element['HsvInt']); + $this->assertArrayHasKey("val", $element['HsvInt']); + } /** @@ -90,8 +96,86 @@ public function testOutput($array_of_colours){ // Assert that the delta between hex and xybri isn't too vast. $this->assertLessThanOrEqual(self::accuracy_loss_limit, $distance_rgb_between_hex_and_xybri, "Assure colour Accuracy loss is less than " . self::accuracy_loss_limit . ". {$int} => {$export['hex']} ... Distance = {$distance_rgb_between_hex_and_xybri} or {$distance_lab_between_hex_and_xybri} ({$color_from_hex->toRgbString()} vs {$color_from_xybri->toRgbString()})"); + } + } + public function testIsGrayscale(){ + $colours = array("FFFFFF", "F0F0F0", "BBBBBB", "EFEFEF", "A8A8A8", "0F0F0F"); + foreach($colours as $grayscale_colour){ + $color = new Color(); + $color->fromHex($grayscale_colour); + $this->assertTrue($color->isGrayscale()); } } + public function testIsNotGrayscale(){ + $colours = array("FF0000", "FFFF00", "0000FF"); + foreach($colours as $not_grayscale_colour){ + $color = new Color(); + $color->fromHex($not_grayscale_colour); + $this->assertFalse($color->isGrayscale()); + } + } + + public function testGetClosestMatchWithColorObjects(){ + $red = new Color(); + $red->fromRgbString("FF0000"); + $green = new Color(); + $green->fromRgbString("00FF00"); + $blue = new Color(); + $blue->fromRgbString("0000FF"); + + $options = array($red, $green, $blue); + + $color = new Color(); + $color->fromRgbString("CCFEDD"); + + $closest_key = $color->getClosestMatch($options); + + $closest = $options[$closest_key]; + + $this->assertEquals($green->toInt(), $closest->toInt(), "Closest should be green"); + } + + public function testGetClosestMatchWithIntegers(){ + $red = 16711680; + $green = 65280; + $blue = 255; + + $options = array($red, $green, $blue); + + $color = new Color(14496682); + + $closest_key = $color->getClosestMatch($options); + + $closest = $options[$closest_key]; + + $this->assertEquals($red, $closest, "Closest should be red"); + } + + public function testToRgbHex(){ + $color = new Color(14496682); + $rgb_hex = $color->toRgbHex(); + + $this->assertArrayHasKey("red", $rgb_hex); + $this->assertArrayHasKey("green", $rgb_hex); + $this->assertArrayHasKey("blue", $rgb_hex); + + $this->assertEquals("dd", $rgb_hex['red']); + $this->assertEquals("33", $rgb_hex['green']); + $this->assertEquals("aa", $rgb_hex['blue']); + } + + public function testFromRgbStringShort(){ + $color = new Color(); + $color->fromRgbString("123"); + $this->assertEquals("#112233", $color->toRgbString()); + } + + public function testFromRgbHex(){ + $color = new Color(); + $color->fromRgbHex("ab", "cd", "ef"); + $this->assertEquals("#ABCDEF", $color->toRgbString()); + } + } From 3e0f61557965f5b52794b924ded9351877203923 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 12:27:06 +0000 Subject: [PATCH 22/27] Refactor - This is already implemented. --- Color.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Color.php b/Color.php index 9eec340..af236b7 100644 --- a/Color.php +++ b/Color.php @@ -182,11 +182,7 @@ public function toRgbHex() */ public function toRgbString() { - $hexes = $this->toRgbHex(); - array_walk($hexes, function(&$hex, $key){ - $hex = str_pad($hex,2,"0",STR_PAD_LEFT); - }); - return "#" . strtoupper(implode('', $hexes)); + return $this->toString(); } /** From d7fe90d6cde2762edab48ba756da318d571d43e7 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 8 Feb 2015 20:25:52 +0000 Subject: [PATCH 23/27] gitignore added --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..331c58f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +vendor \ No newline at end of file From 829fe2b999b559ff6f47479adf4c21c0ab28735f Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 9 Feb 2015 00:09:29 +0000 Subject: [PATCH 24/27] Turns out the existing way to do toRgbString() is bad. --- Color.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Color.php b/Color.php index af236b7..65aaa57 100644 --- a/Color.php +++ b/Color.php @@ -182,9 +182,13 @@ public function toRgbHex() */ public function toRgbString() { - return $this->toString(); + $hexes = $this->toRgbHex(); + array_walk($hexes, function(&$hex, $key){ + $hex = str_pad($hex,2,"0",STR_PAD_LEFT); + }); + return "#" . strtoupper(implode('', $hexes)); } - + /** * Get Hue/Saturation/Value for the current color * (float values, slow but accurate) @@ -423,11 +427,7 @@ public function __toString() */ public function toString() { - $str = (string)$this->toHex(); - if (strlen($str) < 6) { - $str = str_pad($str, 6, '0', STR_PAD_LEFT); - } - return strtoupper("#{$str}"); + return $this->toRgbString(); } /** From a55f71774582807eb50328098e3ae20c5a84dc38 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 9 Feb 2015 13:53:46 +0000 Subject: [PATCH 25/27] Updated to support code-climate. --- .travis.yml | 24 ++++++------------------ README.md | 2 +- composer.json | 3 ++- composer.lock | 3 +-- phpunit.xml | 4 ++++ 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0fde58..c006fb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,16 @@ -# see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php -# list any PHP version you want to test against -php: - # aliased to a recent 5.3.x version - - 5.3 - # aliased to a recent 5.4.x version - - 5.4 - # aliased to a recent 5.5.x version - - 5.5 - # aliased to a recent 5.6.x version - - 5.6 +php: 5.3 - -# execute any number of scripts before the test run, custom env's are available as variables -before_script: +before_script : - composer install -# omitting "script:" will default to phpunit -# use the $DB env variable to determine the phpunit.xml to use -#script: phpunit --configuration phpunit_$DB.xml --coverage-text +after_script: + - CODECLIMATE_REPO_TOKEN="34ea4cdfa1a1b0da0a5bf10664b2dccf295c5bde0932bf7dd4e4fd39d590d28d" vendor/bin/test-reporter --stdout > codeclimate.json + - "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports" + script: phpunit --configuration phpunit.xml --coverage-text -# configure notifications (email, IRC, campfire etc) notifications: email: - matthew@baggett.me \ No newline at end of file diff --git a/README.md b/README.md index b13d9b1..8a3d68b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP Color Utility Class -![Travis CI](https://travis-ci.org/matthewbaggett/php-color.svg) +![Travis CI](https://travis-ci.org/matthewbaggett/php-color.svg) [![Code Climate](https://codeclimate.com/github/matthewbaggett/php-color/badges/gpa.svg)](https://codeclimate.com/github/matthewbaggett/php-color) [![Test Coverage](https://codeclimate.com/github/matthewbaggett/php-color/badges/coverage.svg)](https://codeclimate.com/github/matthewbaggett/php-color) This class is intended to make it easier to convert between colorspaces, as well as compare one color to another. diff --git a/composer.json b/composer.json index 5a8983e..5bd9615 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ }, "extra": { "branch-alias": { - "dev-master": "0.1-dev" + "dev-master": "0.1-dev", + "codeclimate/php-test-reporter": "dev-master" } }, "repositories": [ diff --git a/composer.lock b/composer.lock index d93cfa6..d040709 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "257b0b481f25c0b73b27a1374e173ccb", + "hash": "38d93d1a30297f6051862de23655ad88", "packages": [], "packages-dev": [ { @@ -963,7 +963,6 @@ "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, - "prefer-lowest": false, "platform": { "php": "~5.3" }, diff --git a/phpunit.xml b/phpunit.xml index ad9939f..55e1278 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,3 +1,4 @@ + @@ -6,4 +7,7 @@ tests/GenerateTest.php + + + \ No newline at end of file From 81d1b29d65f178da117f884ab1660940a538ff36 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 9 Feb 2015 13:56:49 +0000 Subject: [PATCH 26/27] Put dependency in the wrong place. Oops. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5bd9615..380349b 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ "php": "~5.3" }, "require-dev": { - "phpunit/phpunit": "*" + "phpunit/phpunit": "*", + "codeclimate/php-test-reporter": "dev-master" }, "extra": { "branch-alias": { - "dev-master": "0.1-dev", - "codeclimate/php-test-reporter": "dev-master" + "dev-master": "0.1-dev" } }, "repositories": [ From d576bd3e0d3d429930d795b03b22d3dd088dad29 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 9 Feb 2015 14:06:09 +0000 Subject: [PATCH 27/27] Add codeclimate/php-test-reporter to composer.lock --- composer.lock | 518 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 516 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index d040709..d7c1c08 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,66 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "38d93d1a30297f6051862de23655ad88", + "hash": "86b5c2597dbcbff816ae522a5187f774", "packages": [], "packages-dev": [ + { + "name": "codeclimate/php-test-reporter", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/codeclimate/php-test-reporter.git", + "reference": "2dd8395f81874333d15de3a598f722997ba42fb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/2dd8395f81874333d15de3a598f722997ba42fb5", + "reference": "2dd8395f81874333d15de3a598f722997ba42fb5", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3", + "satooshi/php-coveralls": "0.6.*", + "symfony/console": ">=2.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@stable" + }, + "bin": [ + "composer/bin/test-reporter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "CodeClimate\\Component": "src/", + "CodeClimate\\Bundle": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Code Climate", + "email": "hello@codeclimate.com", + "homepage": "https://codeclimate.com" + } + ], + "description": "PHP client for reporting test coverage to Code Climate", + "homepage": "https://github.com/codeclimate/php-test-reporter", + "keywords": [ + "codeclimate", + "coverage" + ], + "time": "2014-12-29 16:17:04" + }, { "name": "doctrine/instantiator", "version": "1.0.4", @@ -61,6 +118,98 @@ ], "time": "2014-10-13 12:58:55" }, + { + "name": "guzzle/guzzle", + "version": "v3.9.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "54991459675c1a2924122afbb0e5609ade581155" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155", + "reference": "54991459675c1a2924122afbb0e5609ade581155", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2014-08-11 04:32:36" + }, { "name": "phpdocumentor/reflection-docblock", "version": "2.0.4", @@ -540,6 +689,112 @@ ], "time": "2014-10-03 05:12:11" }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "satooshi/php-coveralls", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/satooshi/php-coveralls.git", + "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", + "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": ">=3.0", + "php": ">=5.3", + "psr/log": "1.0.0", + "symfony/config": ">=2.0", + "symfony/console": ">=2.0", + "symfony/stopwatch": ">=2.2", + "symfony/yaml": ">=2.0" + }, + "require-dev": { + "apigen/apigen": "2.8.*@stable", + "pdepend/pdepend": "dev-master", + "phpmd/phpmd": "dev-master", + "phpunit/php-invoker": ">=1.1.0,<1.2.0", + "phpunit/phpunit": "3.7.*@stable", + "sebastian/finder-facade": "dev-master", + "sebastian/phpcpd": "1.4.*@stable", + "squizlabs/php_codesniffer": "1.4.*@stable", + "theseer/fdomdocument": "dev-master" + }, + "bin": [ + "composer/bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-0": { + "Contrib\\Component": "src/", + "Contrib\\Bundle": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/satooshi/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2013-05-04 08:07:33" + }, { "name": "sebastian/comparator", "version": "1.1.1", @@ -911,6 +1166,263 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2014-12-15 14:25:24" }, + { + "name": "symfony/config", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/a9f781ba1221067d1f07c8cec0bc50f81b8d7408", + "reference": "a9f781ba1221067d1f07c8cec0bc50f81b8d7408", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2015-01-21 20:57:55" + }, + { + "name": "symfony/console", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:39:26" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.6.4", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/f75989f3ab2743a82fe0b03ded2598a2b1546813", + "reference": "f75989f3ab2743a82fe0b03ded2598a2b1546813", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/stopwatch": "~2.3" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2015-02-01 16:10:57" + }, + { + "name": "symfony/filesystem", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 21:13:09" + }, + { + "name": "symfony/stopwatch", + "version": "v2.6.4", + "target-dir": "Symfony/Component/Stopwatch", + "source": { + "type": "git", + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Stopwatch\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 08:01:59" + }, { "name": "symfony/yaml", "version": "v2.6.4", @@ -961,7 +1473,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "codeclimate/php-test-reporter": 20 + }, "prefer-stable": false, "platform": { "php": "~5.3"