From 18c8373f3c0b27c5b7e17cc1e15fcd5992963088 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 11:25:07 +0100 Subject: [PATCH 01/22] - Refactored Complex Engineering Functions to use external complex number library - Added calculation engine support for the new complex number functions that were added in MS Excel 2013 - IMCOSH() Returns the hyperbolic cosine of a complex number - IMCOT() Returns the cotangent of a complex number - IMCSC() Returns the cosecant of a complex number - IMCSCH() Returns the hyperbolic cosecant of a complex number - IMSEC() Returns the secant of a complex number - IMSECH() Returns the hyperbolic secant of a complex number - IMSINH() Returns the hyperbolic sine of a complex number - IMTAN() Returns the tangent of a complex number --- CHANGELOG.md | 10 + composer.json | 3 +- composer.lock | 100 +++- .../Calculation/Calculation.php | 40 ++ .../Calculation/Engineering.php | 491 +++++++----------- .../Calculation/functionlist.txt | 8 + tests/PhpSpreadsheetTests/Custom/Complex.php | 147 ++++-- tests/data/Calculation/Engineering/IMREAL.php | 2 +- tests/data/Calculation/Engineering/IMSQRT.php | 6 +- 9 files changed, 463 insertions(+), 344 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58f117bc71..fb153ab3d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Support workbook view attributes for Xlsx format - [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523) +- Refactored Complex Engineering Functions to use external complex number library +- Added calculation engine support for the new complex number functions that were added in MS Excel 2013 + - IMCOSH() Returns the hyperbolic cosine of a complex number + - IMCOT() Returns the cotangent of a complex number + - IMCSC() Returns the cosecant of a complex number + - IMCSCH() Returns the hyperbolic cosecant of a complex number + - IMSEC() Returns the secant of a complex number + - IMSECH() Returns the hyperbolic secant of a complex number + - IMSINH() Returns the hyperbolic sine of a complex number + - IMTAN() Returns the tangent of a complex number ### Fixed diff --git a/composer.json b/composer.json index 1c033bb81d..39697b3f6d 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,8 @@ "ext-xmlwriter": "*", "ext-zip": "*", "ext-zlib": "*", - "psr/simple-cache": "^1.0" + "psr/simple-cache": "^1.0", + "markbaker/complex": "1.3" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", diff --git a/composer.lock b/composer.lock index 2991465789..1bfdd52e3a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,103 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e61a906bd83393400add286703f10557", + "content-hash": "8f4be7e036bd981a1d8aa946dac6defd", "packages": [ + { + "name": "markbaker/complex", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/MarkBaker/PHPComplex.git", + "reference": "ce35a2294a48d16904444c7edd7d15a65ef6cd45" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/ce35a2294a48d16904444c7edd7d15a65ef6cd45", + "reference": "ce35a2294a48d16904444c7edd7d15a65ef6cd45", + "shasum": "" + }, + "require": { + "php": "^5.6.0|^7.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpdocumentor/phpdocumentor": "2.*", + "phploc/phploc": "2.*", + "phpmd/phpmd": "2.*", + "phpunit/phpunit": "^4.8.35|^5.4.0", + "sebastian/phpcpd": "2.*", + "squizlabs/php_codesniffer": "^3.1.1", + "wimg/php-compatibility": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Complex\\": "classes/src/" + }, + "files": [ + "classes/src/functions/abs.php", + "classes/src/functions/acos.php", + "classes/src/functions/acosh.php", + "classes/src/functions/acot.php", + "classes/src/functions/acoth.php", + "classes/src/functions/acsc.php", + "classes/src/functions/acsch.php", + "classes/src/functions/argument.php", + "classes/src/functions/asec.php", + "classes/src/functions/asech.php", + "classes/src/functions/asin.php", + "classes/src/functions/asinh.php", + "classes/src/functions/atan.php", + "classes/src/functions/atanh.php", + "classes/src/functions/conjugate.php", + "classes/src/functions/cos.php", + "classes/src/functions/cosh.php", + "classes/src/functions/cot.php", + "classes/src/functions/coth.php", + "classes/src/functions/csc.php", + "classes/src/functions/csch.php", + "classes/src/functions/exp.php", + "classes/src/functions/inverse.php", + "classes/src/functions/ln.php", + "classes/src/functions/log2.php", + "classes/src/functions/log10.php", + "classes/src/functions/negative.php", + "classes/src/functions/pow.php", + "classes/src/functions/rho.php", + "classes/src/functions/sec.php", + "classes/src/functions/sech.php", + "classes/src/functions/sin.php", + "classes/src/functions/sinh.php", + "classes/src/functions/sqrt.php", + "classes/src/functions/tan.php", + "classes/src/functions/tanh.php", + "classes/src/functions/theta.php", + "classes/src/operations/add.php", + "classes/src/operations/subtract.php", + "classes/src/operations/multiply.php", + "classes/src/operations/divideby.php", + "classes/src/operations/divideinto.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Baker", + "email": "mark@lange.demon.co.uk" + } + ], + "description": "PHP Class for working with complex numbers", + "homepage": "https://github.com/MarkBaker/PHPComplex", + "keywords": [ + "complex", + "mathematics" + ], + "time": "2018-07-14T22:10:19+00:00" + }, { "name": "psr/simple-cache", "version": "1.0.0", @@ -835,6 +930,9 @@ ] }, "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause|MIT" + ], "authors": [ { "name": "Kore Nordmann", diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index cd269be251..f6842999bb 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -961,6 +961,26 @@ class Calculation 'functionCall' => [Engineering::class, 'IMCOS'], 'argumentCount' => '1', ], + 'IMCOSH' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMCOSH'], + 'argumentCount' => '1', + ], + 'IMCOT' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMCOT'], + 'argumentCount' => '1', + ], + 'IMCSC' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMCSC'], + 'argumentCount' => '1', + ], + 'IMCSCH' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMCSCH'], + 'argumentCount' => '1', + ], 'IMDIV' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'IMDIV'], @@ -1001,11 +1021,26 @@ class Calculation 'functionCall' => [Engineering::class, 'IMREAL'], 'argumentCount' => '1', ], + 'IMSEC' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMSEC'], + 'argumentCount' => '1', + ], + 'IMSECH' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMSECH'], + 'argumentCount' => '1', + ], 'IMSIN' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'IMSIN'], 'argumentCount' => '1', ], + 'IMSINH' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMSINH'], + 'argumentCount' => '1', + ], 'IMSQRT' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'IMSQRT'], @@ -1021,6 +1056,11 @@ class Calculation 'functionCall' => [Engineering::class, 'IMSUM'], 'argumentCount' => '1+', ], + 'IMTAN' => [ + 'category' => Category::CATEGORY_ENGINEERING, + 'functionCall' => [Engineering::class, 'IMTAN'], + 'argumentCount' => '1', + ], 'INDEX' => [ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => [LookupRef::class, 'INDEX'], diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index 2be5c50fd3..94bad134f1 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -2,6 +2,8 @@ namespace PhpOffice\PhpSpreadsheet\Calculation; +use Complex\Complex; + class Engineering { /** @@ -713,88 +715,6 @@ class Engineering ], ]; - /** - * parseComplex. - * - * Parses a complex number into its real and imaginary parts, and an I or J suffix - * - * @param string $complexNumber The complex number - * - * @return string[] Indexed on "real", "imaginary" and "suffix" - */ - public static function parseComplex($complexNumber) - { - $workString = (string) $complexNumber; - - $realNumber = $imaginary = 0; - // Extract the suffix, if there is one - $suffix = substr($workString, -1); - if (!is_numeric($suffix)) { - $workString = substr($workString, 0, -1); - } else { - $suffix = ''; - } - - // Split the input into its Real and Imaginary components - $leadingSign = 0; - if (strlen($workString) > 0) { - $leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0; - } - $power = ''; - $realNumber = strtok($workString, '+-'); - if (strtoupper(substr($realNumber, -1)) == 'E') { - $power = strtok('+-'); - ++$leadingSign; - } - - $realNumber = substr($workString, 0, strlen($realNumber) + strlen($power) + $leadingSign); - - if ($suffix != '') { - $imaginary = substr($workString, strlen($realNumber)); - - if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) { - $imaginary = $realNumber . '1'; - $realNumber = '0'; - } elseif ($imaginary == '') { - $imaginary = $realNumber; - $realNumber = '0'; - } elseif (($imaginary == '+') || ($imaginary == '-')) { - $imaginary .= '1'; - } - } - - return [ - 'real' => $realNumber, - 'imaginary' => $imaginary, - 'suffix' => $suffix, - ]; - } - - /** - * Cleans the leading characters in a complex number string. - * - * @param string $complexNumber The complex number to clean - * - * @return string The "cleaned" complex number - */ - private static function cleanComplex($complexNumber) - { - if ($complexNumber[0] == '+') { - $complexNumber = substr($complexNumber, 1); - } - if ($complexNumber[0] == '0') { - $complexNumber = substr($complexNumber, 1); - } - if ($complexNumber[0] == '.') { - $complexNumber = '0' . $complexNumber; - } - if ($complexNumber[0] == '+') { - $complexNumber = substr($complexNumber, 1); - } - - return $complexNumber; - } - /** * Formats a number base string value with leading zeroes. * @@ -1745,10 +1665,10 @@ public static function OCTTOHEX($x, $places = null) /** * COMPLEX. * - * Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj. + * Converts real and imaginary coefficients into a complex number of the form x +/- yi or x +/- yj. * * Excel Function: - * COMPLEX(realNumber,imaginary[,places]) + * COMPLEX(realNumber,imaginary[,suffix]) * * @category Engineering Functions * @@ -1768,34 +1688,9 @@ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i if (((is_numeric($realNumber)) && (is_numeric($imaginary))) && (($suffix == 'i') || ($suffix == 'j') || ($suffix == '')) ) { - $realNumber = (float) $realNumber; - $imaginary = (float) $imaginary; - - if ($suffix == '') { - $suffix = 'i'; - } - if ($realNumber == 0.0) { - if ($imaginary == 0.0) { - return (string) '0'; - } elseif ($imaginary == 1.0) { - return (string) $suffix; - } elseif ($imaginary == -1.0) { - return (string) '-' . $suffix; - } + $complex = new Complex($realNumber, $imaginary, $suffix); - return (string) $imaginary . $suffix; - } elseif ($imaginary == 0.0) { - return (string) $realNumber; - } elseif ($imaginary == 1.0) { - return (string) $realNumber . '+' . $suffix; - } elseif ($imaginary == -1.0) { - return (string) $realNumber . '-' . $suffix; - } - if ($imaginary > 0) { - $imaginary = (string) '+' . $imaginary; - } - - return (string) $realNumber . $imaginary . $suffix; + return (string) $complex; } return Functions::VALUE(); @@ -1820,9 +1715,7 @@ public static function IMAGINARY($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - return $parsedComplex['imaginary']; + return (new Complex($complexNumber))->getImaginary(); } /** @@ -1843,9 +1736,7 @@ public static function IMREAL($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - return $parsedComplex['real']; + return (new Complex($complexNumber))->getReal(); } /** @@ -1864,12 +1755,7 @@ public static function IMABS($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - return sqrt( - ($parsedComplex['real'] * $parsedComplex['real']) + - ($parsedComplex['imaginary'] * $parsedComplex['imaginary']) - ); + return (new Complex($complexNumber))->abs(); } /** @@ -1888,22 +1774,13 @@ public static function IMABS($complexNumber) public static function IMARGUMENT($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - if ($parsedComplex['real'] == 0.0) { - if ($parsedComplex['imaginary'] == 0.0) { - return Functions::DIV0(); - } elseif ($parsedComplex['imaginary'] < 0.0) { - return M_PI / -2; - } - return M_PI / 2; - } elseif ($parsedComplex['real'] > 0.0) { - return atan($parsedComplex['imaginary'] / $parsedComplex['real']); - } elseif ($parsedComplex['imaginary'] < 0.0) { - return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real']))); + $complex = new Complex($complexNumber); + if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { + return Functions::DIV0(); } - return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real'])); + return $complex->argument(); } /** @@ -1922,19 +1799,7 @@ public static function IMCONJUGATE($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - if ($parsedComplex['imaginary'] == 0.0) { - return $parsedComplex['real']; - } - - return self::cleanComplex( - self::COMPLEX( - $parsedComplex['real'], - 0 - $parsedComplex['imaginary'], - $parsedComplex['suffix'] - ) - ); + return (string) (new Complex($complexNumber))->conjugate(); } /** @@ -1953,19 +1818,83 @@ public static function IMCOS($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); + return (string) (new Complex($complexNumber))->cos(); + } - if ($parsedComplex['imaginary'] == 0.0) { - return cos($parsedComplex['real']); - } + /** + * IMCOSH. + * + * Returns the hyperbolic cosine of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCOSH(complexNumber) + * + * @param string $complexNumber the complex number for which you want the hyperbolic cosine + * + * @return float|string + */ + public static function IMCOSH($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->cosh(); + } - return self::IMCONJUGATE( - self::COMPLEX( - cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']), - sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']), - $parsedComplex['suffix'] - ) - ); + /** + * IMCOT. + * + * Returns the cotangent of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCOT(complexNumber) + * + * @param string $complexNumber the complex number for which you want the cotangent + * + * @return float|string + */ + public static function IMCOT($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->cot(); + } + + /** + * IMCSC. + * + * Returns the cosecant of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCSC(complexNumber) + * + * @param string $complexNumber the complex number for which you want the cosecant + * + * @return float|string + */ + public static function IMCSC($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->csc(); + } + + /** + * IMCSCH. + * + * Returns the hyperbolic cosecant of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMCSCH(complexNumber) + * + * @param string $complexNumber the complex number for which you want the hyperbolic cosecant + * + * @return float|string + */ + public static function IMCSCH($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->csch(); } /** @@ -1984,17 +1913,83 @@ public static function IMSIN($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); + return (string) (new Complex($complexNumber))->sin(); + } - if ($parsedComplex['imaginary'] == 0.0) { - return sin($parsedComplex['real']); - } + /** + * IMSINH. + * + * Returns the hyperbolic sine of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMSINH(complexNumber) + * + * @param string $complexNumber the complex number for which you want the hyperbolic sine + * + * @return float|string + */ + public static function IMSINH($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->sinh(); + } + + /** + * IMSEC. + * + * Returns the secant of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMSEC(complexNumber) + * + * @param string $complexNumber the complex number for which you want the secant + * + * @return float|string + */ + public static function IMSEC($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->sec(); + } + + /** + * IMSECH. + * + * Returns the hyperbolic secant of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMSECH(complexNumber) + * + * @param string $complexNumber the complex number for which you want the hyperbolic secant + * + * @return float|string + */ + public static function IMSECH($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); + + return (string) (new Complex($complexNumber))->sech(); + } + + /** + * IMTAN. + * + * Returns the tangent of a complex number in x + yi or x + yj text format. + * + * Excel Function: + * IMTAN(complexNumber) + * + * @param string $complexNumber the complex number for which you want the tangent + * + * @return float|string + */ + public static function IMTAN($complexNumber) + { + $complexNumber = Functions::flattenSingleValue($complexNumber); - return self::COMPLEX( - sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']), - cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']), - $parsedComplex['suffix'] - ); + return (string) (new Complex($complexNumber))->tan(); } /** @@ -2013,22 +2008,12 @@ public static function IMSQRT($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - $theta = self::IMARGUMENT($complexNumber); if ($theta === Functions::DIV0()) { return '0'; } - $d1 = cos($theta / 2); - $d2 = sin($theta / 2); - $r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($d1 * $r, $d2 * $r); - } - - return self::COMPLEX($d1 * $r, $d2 * $r, $parsedComplex['suffix']); + return (string) (new Complex($complexNumber))->sqrt(); } /** @@ -2047,20 +2032,12 @@ public static function IMLN($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + $complex = new Complex($complexNumber); + if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return Functions::NAN(); } - $logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); - $t = self::IMARGUMENT($complexNumber); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($logR, $t); - } - - return self::COMPLEX($logR, $t, $parsedComplex['suffix']); + return (string) (new Complex($complexNumber))->ln(); } /** @@ -2079,15 +2056,12 @@ public static function IMLOG10($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + $complex = new Complex($complexNumber); + if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return Functions::NAN(); - } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return log10($parsedComplex['real']); } - return self::IMPRODUCT(log10(self::EULER), self::IMLN($complexNumber)); + return (string) (new Complex($complexNumber))->log10(); } /** @@ -2106,15 +2080,12 @@ public static function IMLOG2($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { + $complex = new Complex($complexNumber); + if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) { return Functions::NAN(); - } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return log($parsedComplex['real'], 2); } - return self::IMPRODUCT(log(self::EULER, 2), self::IMLN($complexNumber)); + return (string) (new Complex($complexNumber))->log2(); } /** @@ -2133,21 +2104,7 @@ public static function IMEXP($complexNumber) { $complexNumber = Functions::flattenSingleValue($complexNumber); - $parsedComplex = self::parseComplex($complexNumber); - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return '1'; - } - - $e = exp($parsedComplex['real']); - $eX = $e * cos($parsedComplex['imaginary']); - $eY = $e * sin($parsedComplex['imaginary']); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($eX, $eY); - } - - return self::COMPLEX($eX, $eY, $parsedComplex['suffix']); + return (string) (new Complex($complexNumber))->exp(); } /** @@ -2172,18 +2129,7 @@ public static function IMPOWER($complexNumber, $realNumber) return Functions::VALUE(); } - $parsedComplex = self::parseComplex($complexNumber); - - $r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])); - $rPower = pow($r, $realNumber); - $theta = self::IMARGUMENT($complexNumber) * $realNumber; - if ($theta == 0) { - return 1; - } elseif ($parsedComplex['imaginary'] == 0.0) { - return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']); - } - - return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']); + return (string) (new Complex($complexNumber))->pow($realNumber); } /** @@ -2204,32 +2150,7 @@ public static function IMDIV($complexDividend, $complexDivisor) $complexDividend = Functions::flattenSingleValue($complexDividend); $complexDivisor = Functions::flattenSingleValue($complexDivisor); - $parsedComplexDividend = self::parseComplex($complexDividend); - $parsedComplexDivisor = self::parseComplex($complexDivisor); - - if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') && - ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix']) - ) { - return Functions::NAN(); - } - if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) { - $parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix']; - } - - $d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']); - $d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']); - $d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']); - - $r = $d1 / $d3; - $i = $d2 / $d3; - - if ($i > 0.0) { - return self::cleanComplex($r . '+' . $i . $parsedComplexDivisor['suffix']); - } elseif ($i < 0.0) { - return self::cleanComplex($r . $i . $parsedComplexDivisor['suffix']); - } - - return $r; + return (string) (new Complex($complexDividend))->divideby(new Complex($complexDivisor)); } /** @@ -2250,21 +2171,7 @@ public static function IMSUB($complexNumber1, $complexNumber2) $complexNumber1 = Functions::flattenSingleValue($complexNumber1); $complexNumber2 = Functions::flattenSingleValue($complexNumber2); - $parsedComplex1 = self::parseComplex($complexNumber1); - $parsedComplex2 = self::parseComplex($complexNumber2); - - if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) && - ($parsedComplex1['suffix'] != $parsedComplex2['suffix']) - ) { - return Functions::NAN(); - } elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) { - $parsedComplex1['suffix'] = $parsedComplex2['suffix']; - } - - $d1 = $parsedComplex1['real'] - $parsedComplex2['real']; - $d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary']; - - return self::COMPLEX($d1, $d2, $parsedComplex1['suffix']); + return (string) (new Complex($complexNumber1))->subtract(new Complex($complexNumber2)); } /** @@ -2282,29 +2189,23 @@ public static function IMSUB($complexNumber1, $complexNumber2) public static function IMSUM(...$complexNumbers) { // Return value - $returnValue = self::parseComplex('0'); + $returnValue = new Complex(0.0); $activeSuffix = ''; // Loop through the arguments $aArgs = Functions::flattenArray($complexNumbers); - foreach ($aArgs as $arg) { - $parsedComplex = self::parseComplex($arg); - + foreach ($aArgs as $complex) { + $complex = new Complex($complex); if ($activeSuffix == '') { - $activeSuffix = $parsedComplex['suffix']; - } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { + $activeSuffix = $complex->getSuffix(); + } elseif (($complex->getSuffix() != '') && ($activeSuffix != $complex->getSuffix())) { return Functions::NAN(); } - $returnValue['real'] += $parsedComplex['real']; - $returnValue['imaginary'] += $parsedComplex['imaginary']; + $returnValue = $returnValue->add($complex); } - if ($returnValue['imaginary'] == 0.0) { - $activeSuffix = ''; - } - - return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix); + return (string) $returnValue; } /** @@ -2322,29 +2223,23 @@ public static function IMSUM(...$complexNumbers) public static function IMPRODUCT(...$complexNumbers) { // Return value - $returnValue = self::parseComplex('1'); + $returnValue = new Complex(1.0); $activeSuffix = ''; // Loop through the arguments $aArgs = Functions::flattenArray($complexNumbers); - foreach ($aArgs as $arg) { - $parsedComplex = self::parseComplex($arg); - - $workValue = $returnValue; - if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) { - $activeSuffix = $parsedComplex['suffix']; - } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { + foreach ($aArgs as $complex) { + $complex = new Complex($complex); + if ($activeSuffix == '') { + $activeSuffix = $complex->getSuffix(); + } elseif (($complex->getSuffix() != '') && ($activeSuffix != $complex->getSuffix())) { return Functions::NAN(); } - $returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']); - $returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']); - } - if ($returnValue['imaginary'] == 0.0) { - $activeSuffix = ''; + $returnValue = $returnValue->multiply($complex); } - return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix); + return (string) $returnValue; } /** diff --git a/src/PhpSpreadsheet/Calculation/functionlist.txt b/src/PhpSpreadsheet/Calculation/functionlist.txt index 5ac6cf4181..1a17bddaca 100644 --- a/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -149,6 +149,10 @@ IMAGINARY IMARGUMENT IMCONJUGATE IMCOS +IMCOSH +IMCOT +IMCSC +IMCSCH IMEXP IMLN IMLOG10 @@ -156,10 +160,14 @@ IMLOG2 IMPOWER IMPRODUCT IMREAL +IMSEC +IMSECH IMSIN +IMSINH IMSQRT IMSUB IMSUM +IMTAN INDEX INDIRECT INFO diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index d83af1bace..c34a2ab931 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -6,106 +6,168 @@ class Complex { - private $realPart = 0; - - private $imaginaryPart = 0; - - private $suffix; - - public static function _parseComplex($complexNumber) + /** + * @constant Euler's Number. + */ + const EULER = 2.7182818284590452353602874713526624977572; + + /** + * @constant Regexp to split an input string into real and imaginary components and suffix + */ + const NUMBER_SPLIT_REGEXP = + '` ^ + ( # Real part + [-+]?(\d+\.?\d*|\d*\.?\d+) # Real value (integer or float) + ([Ee][-+]?[0-2]?\d{1,3})? # Optional real exponent for scientific format + ) + ( # Imaginary part + [-+]?(\d+\.?\d*|\d*\.?\d+) # Imaginary value (integer or float) + ([Ee][-+]?[0-2]?\d{1,3})? # Optional imaginary exponent for scientific format + )? + ( # Imaginary part is optional + ([-+]?) # Imaginary (implicit 1 or -1) only + ([ij]?) # Imaginary i or j - depending on whether mathematical or engineering + ) + $`uix'; + + /** + * @var float $realPart The value of of this complex number on the real plane. + */ + protected $realPart = 0.0; + + /** + * @var float $imaginaryPart The value of of this complex number on the imaginary plane. + */ + protected $imaginaryPart = 0.0; + + /** + * @var string $suffix The suffix for this complex number (i or j). + */ + protected $suffix; + + + /** + * Validates whether the argument is a valid complex number, converting scalar or array values if possible + * + * @param mixed $complexNumber The value to parse + * @return array + * @throws Exception If the argument isn't a Complex number or cannot be converted to one + */ + private static function parseComplex($complexNumber) { - // Test for real number, with no imaginary part + // Test for real number, with no imaginary part if (is_numeric($complexNumber)) { return [$complexNumber, 0, null]; } - // Fix silly human errors - if (strpos($complexNumber, '+-') !== false) { - $complexNumber = str_replace('+-', '-', $complexNumber); - } - if (strpos($complexNumber, '++') !== false) { - $complexNumber = str_replace('++', '+', $complexNumber); - } - if (strpos($complexNumber, '--') !== false) { - $complexNumber = str_replace('--', '-', $complexNumber); - } + // Fix silly human errors + $complexNumber = str_replace( + ['+-', '-+', '++', '--'], + ['-', '-', '+', '+'], + $complexNumber + ); - // Basic validation of string, to parse out real and imaginary parts, and any suffix - $validComplex = preg_match('/^([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)?(([\-\+]?)([ij]?))$/ui', $complexNumber, $complexParts); + // Basic validation of string, to parse out real and imaginary parts, and any suffix + $validComplex = preg_match( + self::NUMBER_SPLIT_REGEXP, + $complexNumber, + $complexParts + ); if (!$validComplex) { - // Neither real nor imaginary part, so test to see if we actually have a suffix + // Neither real nor imaginary part, so test to see if we actually have a suffix $validComplex = preg_match('/^([\-\+]?)([ij])$/ui', $complexNumber, $complexParts); if (!$validComplex) { - throw new Exception('COMPLEX: Invalid complex number'); + throw new Exception('Invalid complex number'); } - // We have a suffix, so set the real to 0, the imaginary to either 1 or -1 (as defined by the sign) + // We have a suffix, so set the real to 0, the imaginary to either 1 or -1 (as defined by the sign) $imaginary = 1; if ($complexParts[1] === '-') { $imaginary = 0 - $imaginary; } - return [0, $imaginary, $complexParts[2]]; } - // If we don't have an imaginary part, identify whether it should be +1 or -1... + // If we don't have an imaginary part, identify whether it should be +1 or -1... if (($complexParts[4] === '') && ($complexParts[9] !== '')) { if ($complexParts[7] !== $complexParts[9]) { $complexParts[4] = 1; if ($complexParts[8] === '-') { $complexParts[4] = -1; } - // ... or if we have only the real and no imaginary part (in which case our real should be the imaginary) } else { + // ... or if we have only the real and no imaginary part + // (in which case our real should be the imaginary) $complexParts[4] = $complexParts[1]; $complexParts[1] = 0; } } - // Return real and imaginary parts and suffix as an array, and set a default suffix if user input lazily - return [$complexParts[1], $complexParts[4], !empty($complexParts[9]) ? $complexParts[9] : 'i']; + // Return real and imaginary parts and suffix as an array, and set a default suffix if user input lazily + return [ + $complexParts[1], + $complexParts[4], + !empty($complexParts[9]) ? $complexParts[9] : 'i' + ]; } - // function _parseComplex() - public function __construct($realPart, $imaginaryPart = null, $suffix = 'i') + public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i') { if ($imaginaryPart === null) { if (is_array($realPart)) { - // We have an array of (potentially) real and imaginary parts, and any suffix - list($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i']; + // We have an array of (potentially) real and imaginary parts, and any suffix + list ($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i']; + if ($suffix === null) { + $suffix = 'i'; + } } elseif ((is_string($realPart)) || (is_numeric($realPart))) { - // We've been given a string to parse to extract the real and imaginary parts, and any suffix - list($realPart, $imaginaryPart, $suffix) = self::_parseComplex($realPart); + // We've been given a string to parse to extract the real and imaginary parts, and any suffix + list($realPart, $imaginaryPart, $suffix) = self::parseComplex($realPart); } } - // Set parsed values in our properties + // Set parsed values in our properties $this->realPart = (float) $realPart; $this->imaginaryPart = (float) $imaginaryPart; $this->suffix = strtolower($suffix); } + /** + * Gets the real part of this complex number + * + * @return Float + */ public function getReal() { return $this->realPart; } + /** + * Gets the imaginary part of this complex number + * + * @return Float + */ public function getImaginary() { return $this->imaginaryPart; } + /** + * Gets the suffix of this complex number + * + * @return String + */ public function getSuffix() { return $this->suffix; } - public function __toString() + public function format() { - $str = ''; + $str = ""; if ($this->imaginaryPart != 0.0) { - if (abs($this->imaginaryPart) != 1.0) { + if (\abs($this->imaginaryPart) != 1.0) { $str .= $this->imaginaryPart . $this->suffix; } else { $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix; @@ -113,14 +175,19 @@ public function __toString() } if ($this->realPart != 0.0) { if (($str) && ($this->imaginaryPart > 0.0)) { - $str = '+' . $str; + $str = "+" . $str; } $str = $this->realPart . $str; } if (!$str) { - $str = '0.0'; + $str = "0.0"; } return $str; } + + public function __toString() + { + return $this->format(); + } } diff --git a/tests/data/Calculation/Engineering/IMREAL.php b/tests/data/Calculation/Engineering/IMREAL.php index 477268db52..8ed0fa8820 100644 --- a/tests/data/Calculation/Engineering/IMREAL.php +++ b/tests/data/Calculation/Engineering/IMREAL.php @@ -3,7 +3,7 @@ return [ [ 12.34, - '12.34+5.67j"', + '12.34+5.67j', ], [ -1.234E-5, diff --git a/tests/data/Calculation/Engineering/IMSQRT.php b/tests/data/Calculation/Engineering/IMSQRT.php index b372d9f8e2..67511ec056 100644 --- a/tests/data/Calculation/Engineering/IMSQRT.php +++ b/tests/data/Calculation/Engineering/IMSQRT.php @@ -78,8 +78,8 @@ '-1+i', ], [ - '6.12303176911189E-017+i', - '-1', + '0.923879532511287+0.382683432365089i', + '0.707106781186548+0.707106781186547i', ], [ '0.455089860562227-1.09868411346781i', @@ -98,7 +98,7 @@ '-3.5+i', ], [ - '1.14551435241745E-016+1.87082869338697i', + '1.14602144155088E-16+1.87082869338697i', '-3.5', ], [ From 8a3754f6abca001a98f42150269a2e52cb4e8386 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 11:38:49 +0100 Subject: [PATCH 02/22] CS fixes in tests --- tests/PhpSpreadsheetTests/Custom/Complex.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index c34a2ab931..fbd3843007 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -31,17 +31,17 @@ class Complex $`uix'; /** - * @var float $realPart The value of of this complex number on the real plane. + * @var float $realPart The value of of this complex number on the real plane. */ protected $realPart = 0.0; /** - * @var float $imaginaryPart The value of of this complex number on the imaginary plane. + * @var float $imaginaryPart The value of of this complex number on the imaginary plane. */ protected $imaginaryPart = 0.0; /** - * @var string $suffix The suffix for this complex number (i or j). + * @var string $suffix The suffix for this complex number (i or j). */ protected $suffix; @@ -49,9 +49,9 @@ class Complex /** * Validates whether the argument is a valid complex number, converting scalar or array values if possible * - * @param mixed $complexNumber The value to parse - * @return array - * @throws Exception If the argument isn't a Complex number or cannot be converted to one + * @param mixed $complexNumber The value to parse + * @return array + * @throws Exception If the argument isn't a Complex number or cannot be converted to one */ private static function parseComplex($complexNumber) { From 0584e30600ac44f9314d3a48a63ffbd67d86e760 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 11:55:05 +0100 Subject: [PATCH 03/22] CS tweaks --- tests/PhpSpreadsheetTests/Custom/Complex.php | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index fbd3843007..60deed3eba 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -31,27 +31,29 @@ class Complex $`uix'; /** - * @var float $realPart The value of of this complex number on the real plane. + * @var float The value of of this complex number on the real plane. */ protected $realPart = 0.0; /** - * @var float $imaginaryPart The value of of this complex number on the imaginary plane. + * @var float The value of of this complex number on the imaginary plane. */ protected $imaginaryPart = 0.0; /** - * @var string $suffix The suffix for this complex number (i or j). + * @var string The suffix for this complex number (i or j). */ protected $suffix; /** - * Validates whether the argument is a valid complex number, converting scalar or array values if possible + * Validates whether the argument is a valid complex number, converting scalar or array values if possible. * * @param mixed $complexNumber The value to parse - * @return array + * * @throws Exception If the argument isn't a Complex number or cannot be converted to one + * + * @return array */ private static function parseComplex($complexNumber) { @@ -107,7 +109,7 @@ private static function parseComplex($complexNumber) return [ $complexParts[1], $complexParts[4], - !empty($complexParts[9]) ? $complexParts[9] : 'i' + !empty($complexParts[9]) ? $complexParts[9] : 'i', ]; } @@ -117,7 +119,7 @@ public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i if ($imaginaryPart === null) { if (is_array($realPart)) { // We have an array of (potentially) real and imaginary parts, and any suffix - list ($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i']; + list($realPart, $imaginaryPart, $suffix) = array_values($realPart) + [0.0, 0.0, 'i']; if ($suffix === null) { $suffix = 'i'; } @@ -134,7 +136,7 @@ public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i } /** - * Gets the real part of this complex number + * Gets the real part of this complex number. * * @return Float */ @@ -144,7 +146,7 @@ public function getReal() } /** - * Gets the imaginary part of this complex number + * Gets the imaginary part of this complex number. * * @return Float */ @@ -154,7 +156,7 @@ public function getImaginary() } /** - * Gets the suffix of this complex number + * Gets the suffix of this complex number. * * @return String */ @@ -165,7 +167,7 @@ public function getSuffix() public function format() { - $str = ""; + $str = ''; if ($this->imaginaryPart != 0.0) { if (\abs($this->imaginaryPart) != 1.0) { $str .= $this->imaginaryPart . $this->suffix; @@ -175,12 +177,12 @@ public function format() } if ($this->realPart != 0.0) { if (($str) && ($this->imaginaryPart > 0.0)) { - $str = "+" . $str; + $str = '+' . $str } $str = $this->realPart . $str; } if (!$str) { - $str = "0.0"; + $str = '0.0'; } return $str; From d933ce46e31b80b3703f37ac35d2605b1cb9e842 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 11:57:57 +0100 Subject: [PATCH 04/22] Fixed missing ; accidentally deleted when fixing cs sniffs --- tests/PhpSpreadsheetTests/Custom/Complex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index 60deed3eba..aa62e84238 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -177,7 +177,7 @@ public function format() } if ($this->realPart != 0.0) { if (($str) && ($this->imaginaryPart > 0.0)) { - $str = '+' . $str + $str = '+' . $str; } $str = $this->realPart . $str; } From a1b7f841c303844118ed6dc8272a6ded03ee942e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 12:07:36 +0100 Subject: [PATCH 05/22] Really am getting annoyed with phpcs complaints about English grammar --- tests/PhpSpreadsheetTests/Custom/Complex.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index aa62e84238..ab21d8731b 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -31,17 +31,17 @@ class Complex $`uix'; /** - * @var float The value of of this complex number on the real plane. + * @var float the value of of this complex number on the real plane */ protected $realPart = 0.0; /** - * @var float The value of of this complex number on the imaginary plane. + * @var float the value of of this complex number on the imaginary plane */ protected $imaginaryPart = 0.0; /** - * @var string The suffix for this complex number (i or j). + * @var string the suffix for this complex number (i or j) */ protected $suffix; @@ -138,7 +138,7 @@ public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i /** * Gets the real part of this complex number. * - * @return Float + * @return float */ public function getReal() { @@ -148,7 +148,7 @@ public function getReal() /** * Gets the imaginary part of this complex number. * - * @return Float + * @return float */ public function getImaginary() { @@ -158,7 +158,7 @@ public function getImaginary() /** * Gets the suffix of this complex number. * - * @return String + * @return string */ public function getSuffix() { From a495b6c68b7c0abb3e0d80e986beaf029843ae6b Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 12:20:00 +0100 Subject: [PATCH 06/22] And cs issues with numbers of blank lines --- tests/PhpSpreadsheetTests/Custom/Complex.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index ab21d8731b..040e9350b9 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -45,7 +45,6 @@ class Complex */ protected $suffix; - /** * Validates whether the argument is a valid complex number, converting scalar or array values if possible. * @@ -113,7 +112,6 @@ private static function parseComplex($complexNumber) ]; } - public function __construct($realPart = 0.0, $imaginaryPart = null, $suffix = 'i') { if ($imaginaryPart === null) { From 0143a6037087cb7866e76f84a71474268981678a Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 12:28:17 +0100 Subject: [PATCH 07/22] Feels like I'm trying to fix more trivial (and arguable) cs issues that's taking more time away from writing the more important unit tests :( --- tests/PhpSpreadsheetTests/Custom/Complex.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php index 040e9350b9..1406f01de1 100644 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ b/tests/PhpSpreadsheetTests/Custom/Complex.php @@ -86,6 +86,7 @@ private static function parseComplex($complexNumber) if ($complexParts[1] === '-') { $imaginary = 0 - $imaginary; } + return [0, $imaginary, $complexParts[2]]; } From f41609932e764aa354245d7265ae9c53b7ee6190 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 15 Jul 2018 22:36:22 +0100 Subject: [PATCH 08/22] Unit tests for the new Complex functions --- .../Calculation/EngineeringTest.php | 128 ++++++++++++++++++ .../Custom/ComplexAssert.php | 4 +- tests/data/Calculation/Engineering/IMCOSH.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMCOT.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMCSC.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMCSCH.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMSEC.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMSECH.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMSINH.php | 112 +++++++++++++++ tests/data/Calculation/Engineering/IMTAN.php | 112 +++++++++++++++ 10 files changed, 1027 insertions(+), 1 deletion(-) create mode 100644 tests/data/Calculation/Engineering/IMCOSH.php create mode 100644 tests/data/Calculation/Engineering/IMCOT.php create mode 100644 tests/data/Calculation/Engineering/IMCSC.php create mode 100644 tests/data/Calculation/Engineering/IMCSCH.php create mode 100644 tests/data/Calculation/Engineering/IMSEC.php create mode 100644 tests/data/Calculation/Engineering/IMSECH.php create mode 100644 tests/data/Calculation/Engineering/IMSINH.php create mode 100644 tests/data/Calculation/Engineering/IMTAN.php diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index ae79d1042e..f13e3a70cc 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -201,6 +201,102 @@ public function providerIMCOS() return require 'data/Calculation/Engineering/IMCOS.php'; } + /** + * @dataProvider providerIMCOSH + * + * @param mixed $expectedResult + */ + public function testIMCOSH($expectedResult, ...$args) + { + $result = Engineering::IMCOSH(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMCOSH() + { + return require 'data/Calculation/Engineering/IMCOSH.php'; + } + + /** + * @dataProvider providerIMCOT + * + * @param mixed $expectedResult + */ + public function testIMCOT($expectedResult, ...$args) + { + $result = Engineering::IMCOT(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMCOT() + { + return require 'data/Calculation/Engineering/IMCOT.php'; + } + + /** + * @dataProvider providerIMCSC + * + * @param mixed $expectedResult + */ + public function testIMCSC($expectedResult, ...$args) + { + $result = Engineering::IMCSC(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMCSC() + { + return require 'data/Calculation/Engineering/IMCSC.php'; + } + + /** + * @dataProvider providerIMCSCH + * + * @param mixed $expectedResult + */ + public function testIMCSCH($expectedResult, ...$args) + { + $result = Engineering::IMCSCH(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMCSCH() + { + return require 'data/Calculation/Engineering/IMCSCH.php'; + } + + /** + * @dataProvider providerIMSEC + * + * @param mixed $expectedResult + */ + public function testIMSEC($expectedResult, ...$args) + { + $result = Engineering::IMSEC(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMSEC() + { + return require 'data/Calculation/Engineering/IMSEC.php'; + } + + /** + * @dataProvider providerIMSECH + * + * @param mixed $expectedResult + */ + public function testIMSECH($expectedResult, ...$args) + { + $result = Engineering::IMSECH(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMSECH() + { + return require 'data/Calculation/Engineering/IMSECH.php'; + } + /** * @dataProvider providerIMDIV * @@ -333,6 +429,38 @@ public function providerIMSIN() return require 'data/Calculation/Engineering/IMSIN.php'; } + /** + * @dataProvider providerIMSINH + * + * @param mixed $expectedResult + */ + public function testIMSINH($expectedResult, ...$args) + { + $result = Engineering::IMSINH(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMSINH() + { + return require 'data/Calculation/Engineering/IMSINH.php'; + } + + /** + * @dataProvider providerIMTAN + * + * @param mixed $expectedResult + */ + public function testIMTAN($expectedResult, ...$args) + { + $result = Engineering::IMTAN(...$args); + self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + } + + public function providerIMTAN() + { + return require 'data/Calculation/Engineering/IMTAN.php'; + } + /** * @dataProvider providerIMSQRT * diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index 112d43360b..76502cef89 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -8,10 +8,12 @@ class ComplexAssert public function assertComplexEquals($expected, $actual, $delta = 0) { - if ($expected[0] === '#') { + if ($expected === INF || $expected[0] === '#') { // Expecting an error, so we do a straight string comparison if ($expected === $actual) { return true; + } elseif ($expected === INF && $actual === 'INF') { + return true; } $this->errorMessage = 'Expected Error: ' . $actual . ' !== ' . $expected; diff --git a/tests/data/Calculation/Engineering/IMCOSH.php b/tests/data/Calculation/Engineering/IMCOSH.php new file mode 100644 index 0000000000..dd394787d0 --- /dev/null +++ b/tests/data/Calculation/Engineering/IMCOSH.php @@ -0,0 +1,112 @@ + Date: Mon, 16 Jul 2018 00:06:43 +0100 Subject: [PATCH 09/22] Ensure latest comlex library release is composer'd in --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 39697b3f6d..d4d20ac4b4 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "1.3" + "markbaker/complex": "^1.3" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", From f50d1e9dbf42e0e33fe0c1e7df5f4c9da447b6b1 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 16 Jul 2018 00:17:15 +0100 Subject: [PATCH 10/22] Ensure latest comlex library release is composer'd in --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d4d20ac4b4..07bc1519f8 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "^1.3" + "markbaker/complex": "1.3.1" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", diff --git a/composer.lock b/composer.lock index 1bfdd52e3a..7f0d5ffd6d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "8f4be7e036bd981a1d8aa946dac6defd", + "content-hash": "bf26aae26dc5df3508d86630cceb0984", "packages": [ { "name": "markbaker/complex", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "ce35a2294a48d16904444c7edd7d15a65ef6cd45" + "reference": "9a3439777816f0b2584c4a458cf35759c519db6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/ce35a2294a48d16904444c7edd7d15a65ef6cd45", - "reference": "ce35a2294a48d16904444c7edd7d15a65ef6cd45", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9a3439777816f0b2584c4a458cf35759c519db6c", + "reference": "9a3439777816f0b2584c4a458cf35759c519db6c", "shasum": "" }, "require": { @@ -99,7 +99,7 @@ "complex", "mathematics" ], - "time": "2018-07-14T22:10:19+00:00" + "time": "2018-07-15T17:15:28+00:00" }, { "name": "psr/simple-cache", From 7a1db9feda89164d696f003e08f217908143eb8e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 22 Jul 2018 23:03:35 +0100 Subject: [PATCH 11/22] Restored the parseComplex() method in the PhpOffice\PhpSpreadsheet\Calculation\Engineering class, but using Complex\Complex and docblock flagged as deprecated --- .../Calculation/Engineering.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index e1cee0e64c..dc346a9e9c 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -715,6 +715,28 @@ class Engineering ], ]; + /** + * parseComplex. + * + * Parses a complex number into its real and imaginary parts, and an I or J suffix + * + * @deprecated 2.0.0 No longer used by internal code. Please use the Complex\Complex class instead + * + * @param string $complexNumber The complex number + * + * @return string[] Indexed on "real", "imaginary" and "suffix" + */ + public static function parseComplex($complexNumber) + { + $complex = new Complex($complexNumber); + + return [ + 'real' => $complex->getReal(), + 'imaginary' => $complex->getImaginary(), + 'suffix' => $complex->getSuffix(), + ]; + } + /** * Formats a number base string value with leading zeroes. * From 636e4c7adc0a46f190789b2e292dc51772c761f1 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 23 Jul 2018 20:04:30 +0100 Subject: [PATCH 12/22] Handling for incompatible suffixes --- composer.json | 2 +- .../Calculation/Engineering.php | 51 ++++++++++--------- .../Calculation/EngineeringTest.php | 4 -- tests/data/Calculation/Engineering/IMDIV.php | 15 ------ tests/data/Calculation/Engineering/IMSUB.php | 15 ------ 5 files changed, 27 insertions(+), 60 deletions(-) diff --git a/composer.json b/composer.json index 07bc1519f8..a6eb5f4d20 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "1.3.1" + "markbaker/complex": "1.4" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index dc346a9e9c..7405e714ed 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -3,6 +3,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation; use Complex\Complex; +use Complex\Exception as ComplexException; class Engineering { @@ -1791,7 +1792,7 @@ public static function IMABS($complexNumber) * * @param string $complexNumber the complex number for which you want the argument theta * - * @return float + * @return float|string */ public static function IMARGUMENT($complexNumber) { @@ -2172,7 +2173,11 @@ public static function IMDIV($complexDividend, $complexDivisor) $complexDividend = Functions::flattenSingleValue($complexDividend); $complexDivisor = Functions::flattenSingleValue($complexDivisor); - return (string) (new Complex($complexDividend))->divideby(new Complex($complexDivisor)); + try { + return (string) (new Complex($complexDividend))->divideby(new Complex($complexDivisor)); + } catch (ComplexException $e) { + return Functions::NAN(); + } } /** @@ -2193,7 +2198,11 @@ public static function IMSUB($complexNumber1, $complexNumber2) $complexNumber1 = Functions::flattenSingleValue($complexNumber1); $complexNumber2 = Functions::flattenSingleValue($complexNumber2); - return (string) (new Complex($complexNumber1))->subtract(new Complex($complexNumber2)); + try { + return (string) (new Complex($complexNumber1))->subtract(new Complex($complexNumber2)); + } catch (ComplexException $e) { + return Functions::NAN(); + } } /** @@ -2212,19 +2221,15 @@ public static function IMSUM(...$complexNumbers) { // Return value $returnValue = new Complex(0.0); - $activeSuffix = ''; - - // Loop through the arguments $aArgs = Functions::flattenArray($complexNumbers); - foreach ($aArgs as $complex) { - $complex = new Complex($complex); - if ($activeSuffix == '') { - $activeSuffix = $complex->getSuffix(); - } elseif (($complex->getSuffix() != '') && ($activeSuffix != $complex->getSuffix())) { - return Functions::NAN(); - } - $returnValue = $returnValue->add($complex); + try { + // Loop through the arguments + foreach ($aArgs as $complex) { + $returnValue = $returnValue->add(new Complex($complex)); + } + } catch (ComplexException $e) { + return Functions::NAN(); } return (string) $returnValue; @@ -2246,19 +2251,15 @@ public static function IMPRODUCT(...$complexNumbers) { // Return value $returnValue = new Complex(1.0); - $activeSuffix = ''; - - // Loop through the arguments $aArgs = Functions::flattenArray($complexNumbers); - foreach ($aArgs as $complex) { - $complex = new Complex($complex); - if ($activeSuffix == '') { - $activeSuffix = $complex->getSuffix(); - } elseif (($complex->getSuffix() != '') && ($activeSuffix != $complex->getSuffix())) { - return Functions::NAN(); - } - $returnValue = $returnValue->multiply($complex); + try { + // Loop through the arguments + foreach ($aArgs as $complex) { + $returnValue = $returnValue->multiply(new Complex($complex)); + } + } catch (ComplexException $e) { + return Functions::NAN(); } return (string) $returnValue; diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 9f09766b50..c0dd48c1f2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -304,8 +304,6 @@ public function providerIMSECH() */ public function testIMDIV($expectedResult, ...$args) { - $this->markTestIncomplete('TODO: This test should be fixed'); - $result = Engineering::IMDIV(...$args); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -484,8 +482,6 @@ public function providerIMSQRT() */ public function testIMSUB($expectedResult, ...$args) { - $this->markTestIncomplete('TODO: This test should be fixed'); - $result = Engineering::IMSUB(...$args); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } diff --git a/tests/data/Calculation/Engineering/IMDIV.php b/tests/data/Calculation/Engineering/IMDIV.php index d53562ac7a..e1f5b33142 100644 --- a/tests/data/Calculation/Engineering/IMDIV.php +++ b/tests/data/Calculation/Engineering/IMDIV.php @@ -71,21 +71,6 @@ '-12.34-5.67i', '123.45-67.89i', ], - [ - '#NUM!', - '-12.34-5.67i', - '123.45-67.89', - ], - [ - '#NUM!', - '-12.34-5.67j', - '123.45-67.89', - ], - [ - '#NUM!', - '-12.34-5.67', - '123.45-67.89j', - ], [ '1', '-12.34-5.67i', diff --git a/tests/data/Calculation/Engineering/IMSUB.php b/tests/data/Calculation/Engineering/IMSUB.php index c5cd7d92bf..8d7fe6516d 100644 --- a/tests/data/Calculation/Engineering/IMSUB.php +++ b/tests/data/Calculation/Engineering/IMSUB.php @@ -37,19 +37,4 @@ '-12.34-5.67i', '-123.45-67.89i', ], - [ - '#NUM!', - '-12.34-5.67i', - '-123.45-67.89', - ], - [ - '#NUM!', - '-12.34-5.67j', - '-123.45-67.89', - ], - [ - '#NUM!', - '-12.34-5.67', - '-123.45-67.89j', - ], ]; From 1f67f68a1106aa6bbe318aff5fa395c13d0ea7c4 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 23 Jul 2018 20:25:45 +0100 Subject: [PATCH 13/22] Trying to ensure that composer pulls the correct version of the complex library --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a6eb5f4d20..5443c8a9e2 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "1.4" + "markbaker/complex": "^1.4" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", From 06873f17d4ad8ffe6eb4b8bf1a87a1f90ae6c94a Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 23 Jul 2018 23:44:19 +0100 Subject: [PATCH 14/22] Travis is a real pita with composer --- composer.json | 2 +- composer.lock | 814 +++++++++++++++++++++----------------------------- 2 files changed, 339 insertions(+), 477 deletions(-) diff --git a/composer.json b/composer.json index 5443c8a9e2..b92cfb61d5 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "^1.4" + "markbaker/complex": "^1.4.0" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", diff --git a/composer.lock b/composer.lock index 7f0d5ffd6d..6b62690264 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "bf26aae26dc5df3508d86630cceb0984", + "content-hash": "c46adaaa5883b6e359fae0c32c0b489e", "packages": [ { "name": "markbaker/complex", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "9a3439777816f0b2584c4a458cf35759c519db6c" + "reference": "77d01e85d064ab9ec1c7bc20fe9383de2f27367b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9a3439777816f0b2584c4a458cf35759c519db6c", - "reference": "9a3439777816f0b2584c4a458cf35759c519db6c", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/77d01e85d064ab9ec1c7bc20fe9383de2f27367b", + "reference": "77d01e85d064ab9ec1c7bc20fe9383de2f27367b", "shasum": "" }, "require": { @@ -99,20 +99,20 @@ "complex", "mathematics" ], - "time": "2018-07-15T17:15:28+00:00" + "time": "2018-07-23T12:00:43+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { @@ -147,7 +147,7 @@ "psr-16", "simple-cache" ], - "time": "2017-01-02T13:31:39+00:00" + "time": "2017-10-23T01:57:42+00:00" } ], "packages-dev": [ @@ -213,6 +213,50 @@ ], "time": "2016-08-30T16:08:34+00:00" }, + { + "name": "composer/xdebug-handler", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2018-04-11T15:42:36+00:00" + }, { "name": "doctrine/annotations", "version": "v1.6.0", @@ -283,32 +327,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -333,7 +377,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "doctrine/lexer", @@ -391,16 +435,16 @@ }, { "name": "dompdf/dompdf", - "version": "v0.8.0", + "version": "v0.8.2", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c" + "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", - "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6", + "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6", "shasum": "" }, "require": { @@ -408,8 +452,8 @@ "ext-gd": "*", "ext-mbstring": "*", "phenx/php-font-lib": "0.5.*", - "phenx/php-svg-lib": "0.2.*", - "php": ">=5.3.0" + "phenx/php-svg-lib": "0.3.*", + "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "4.8.*", @@ -449,30 +493,30 @@ ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2017-02-16T02:40:40+00:00" + "time": "2017-11-26T14:49:08+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.10.0", + "version": "v2.12.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "513a3765b56dd029175f9f32995566657ee89dda" + "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/513a3765b56dd029175f9f32995566657ee89dda", - "reference": "513a3765b56dd029175f9f32995566657ee89dda", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/dcc87d5414e9d0bd316fce81a5bedb9ce720b183", + "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183", "shasum": "" }, "require": { "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.0", "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "gecko-packages/gecko-php-unit": "^2.0 || ^3.0", "php": "^5.6 || >=7.0 <7.3", - "php-cs-fixer/diff": "^1.2", + "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.2 || ^4.0", "symfony/event-dispatcher": "^3.0 || ^4.0", "symfony/filesystem": "^3.0 || ^4.0", @@ -487,39 +531,41 @@ "hhvm": "*" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0@dev", + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.0", + "keradus/cli-executor": "^1.1", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.0", + "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "phpunitgoodpractices/traits": "^1.0", - "symfony/phpunit-bridge": "^3.2.2 || ^4.0" + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", + "phpunitgoodpractices/traits": "^1.5.1", + "symfony/phpunit-bridge": "^4.0" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, "bin": [ "php-cs-fixer" ], "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.10-dev" - } - }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" }, "classmap": [ "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", "tests/Test/AbstractIntegrationTestCase.php", "tests/Test/Assert/AssertTokensTrait.php", "tests/Test/IntegrationCase.php", "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", "tests/TestCase.php" ] }, @@ -538,98 +584,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2018-01-10T17:16:15+00:00" - }, - { - "name": "gecko-packages/gecko-php-unit", - "version": "v3.0", - "source": { - "type": "git", - "url": "https://github.com/GeckoPackages/GeckoPHPUnit.git", - "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GeckoPackages/GeckoPHPUnit/zipball/6a866551dffc2154c1b091bae3a7877d39c25ca3", - "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-dom": "When testing with xml.", - "ext-libxml": "When testing with xml.", - "phpunit/phpunit": "This is an extension for it so make sure you have it some way." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GeckoPackages\\PHPUnit\\": "src/PHPUnit" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Additional PHPUnit asserts and constraints.", - "homepage": "https://github.com/GeckoPackages", - "keywords": [ - "extension", - "filesystem", - "phpunit" - ], - "time": "2017-08-23T07:46:41+00:00" - }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ], - "time": "2014-11-20T16:49:30+00:00" + "time": "2018-07-06T10:37:40+00:00" }, { "name": "jpgraph/jpgraph", @@ -673,22 +628,23 @@ }, { "name": "mpdf/mpdf", - "version": "v7.0.0", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/mpdf/mpdf.git", - "reference": "375a79a575fde762a7c390766837e78e8dfe97bf" + "reference": "800a7f9d93474988cc2ffb8c155497ca5910fb09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/375a79a575fde762a7c390766837e78e8dfe97bf", - "reference": "375a79a575fde762a7c390766837e78e8dfe97bf", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/800a7f9d93474988cc2ffb8c155497ca5910fb09", + "reference": "800a7f9d93474988cc2ffb8c155497ca5910fb09", "shasum": "" }, "require": { "ext-gd": "*", "ext-mbstring": "*", - "paragonie/random_compat": "^2.0", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0", "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0", "psr/log": "^1.0", "setasign/fpdi": "1.6.*" @@ -717,7 +673,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0" + "GPL-2.0-only" ], "authors": [ { @@ -736,41 +692,47 @@ "php", "utf-8" ], - "time": "2017-10-19T16:38:45+00:00" + "time": "2018-07-02T14:26:48+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.6.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -778,20 +740,20 @@ "object", "object graph" ], - "time": "2017-01-26T22:05:40+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.11", + "version": "v2.0.17", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", "shasum": "" }, "require": { @@ -823,23 +785,24 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", + "polyfill", "pseudorandom", "random" ], - "time": "2017-09-27T21:40:39+00:00" + "time": "2018-07-04T16:31:37+00:00" }, { "name": "phenx/php-font-lib", - "version": "0.5", + "version": "0.5.1", "source": { "type": "git", "url": "https://github.com/PhenX/php-font-lib.git", - "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962" + "reference": "760148820110a1ae0936e5cc35851e25a938bc97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/19ad2bebc35be028fcc0221025fcbf3d436a3962", - "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/760148820110a1ae0936e5cc35851e25a938bc97", + "reference": "760148820110a1ae0936e5cc35851e25a938bc97", "shasum": "" }, "require-dev": { @@ -863,24 +826,27 @@ ], "description": "A library to read, parse, export and make subsets of different types of font files.", "homepage": "https://github.com/PhenX/php-font-lib", - "time": "2017-02-11T10:58:43+00:00" + "time": "2017-09-13T16:14:37+00:00" }, { "name": "phenx/php-svg-lib", - "version": "v0.2", + "version": "v0.3.2", "source": { "type": "git", "url": "https://github.com/PhenX/php-svg-lib.git", - "reference": "de291bec8449b89acfe85691b5c71434797959dc" + "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/de291bec8449b89acfe85691b5c71434797959dc", - "reference": "de291bec8449b89acfe85691b5c71434797959dc", + "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/ccc46ef6340d4b8a4a68047e68d8501ea961442c", + "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c", "shasum": "" }, "require": { - "sabberworm/php-css-parser": "6.0.*" + "sabberworm/php-css-parser": "8.1.*" + }, + "require-dev": { + "phpunit/phpunit": "~5.0" }, "type": "library", "autoload": { @@ -900,27 +866,27 @@ ], "description": "A library to read, parse and export to PDF SVG files.", "homepage": "https://github.com/PhenX/php-svg-lib", - "time": "2016-12-13T20:25:45+00:00" + "time": "2018-06-03T10:10:03+00:00" }, { "name": "php-cs-fixer/diff", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "f0ef6133d674137e902fdf8a6f2e8e97e14a087b" + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/f0ef6133d674137e902fdf8a6f2e8e97e14a087b", - "reference": "f0ef6133d674137e902fdf8a6f2e8e97e14a087b", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3", + "phpunit/phpunit": "^5.7.23 || ^6.4.3", "symfony/process": "^3.3" }, "type": "library", @@ -931,7 +897,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause|MIT" + "BSD-3-Clause" ], "authors": [ { @@ -951,20 +917,20 @@ "keywords": [ "diff" ], - "time": "2017-10-19T09:58:18+00:00" + "time": "2018-02-15T16:58:55+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -1005,33 +971,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -1050,24 +1022,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -1097,37 +1069,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.7.6", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1|^2.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -1160,20 +1132,20 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2018-04-18T13:57:24+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.7", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", - "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { @@ -1223,20 +1195,20 @@ "testing", "xunit" ], - "time": "2017-03-01T09:12:17+00:00" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -1270,7 +1242,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1364,29 +1336,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1409,20 +1381,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.17", + "version": "5.7.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf" + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf", - "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { @@ -1440,14 +1412,14 @@ "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "^1.2.4", - "sebastian/diff": "~1.2", + "sebastian/diff": "^1.4.3", "sebastian/environment": "^1.3.4 || ^2.0", "sebastian/exporter": "~2.0", "sebastian/global-state": "^1.1", "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2" @@ -1491,20 +1463,20 @@ "testing", "xunit" ], - "time": "2017-03-19T16:52:12+00:00" + "time": "2018-02-01T05:50:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { @@ -1550,7 +1522,7 @@ "mock", "xunit" ], - "time": "2016-12-08T20:27:08+00:00" + "time": "2017-06-30T09:13:00+00:00" }, { "name": "psr/log", @@ -1601,21 +1573,24 @@ }, { "name": "sabberworm/php-css-parser", - "version": "6.0.1", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", - "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2" + "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/9ea4b00c569b19f731d0c2e0e802055877ff40c2", - "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2", + "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/850cbbcbe7fbb155387a151ea562897a67e242ef", + "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "*" + }, "type": "library", "autoload": { "psr-0": { @@ -1638,7 +1613,7 @@ "parser", "stylesheet" ], - "time": "2015-08-24T08:48:52+00:00" + "time": "2016-07-19T19:14:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1751,23 +1726,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1799,7 +1774,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08T07:14:41+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -2204,16 +2179,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", - "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", "shasum": "" }, "require": { @@ -2278,20 +2253,20 @@ "phpcs", "standards" ], - "time": "2017-03-01T22:17:45+00:00" + "time": "2017-05-22T02:43:20+00:00" }, { "name": "symfony/console", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e" + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", - "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", + "url": "https://api.github.com/repos/symfony/console/zipball/5c31f6a97c1c240707f6d786e7e59bfacdbc0219", + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219", "shasum": "" }, "require": { @@ -2311,7 +2286,7 @@ "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2319,7 +2294,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2346,20 +2321,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-07-16T14:05:40+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb" + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74d33aac36208c4d6757807d9f598f0133a3a4eb", - "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", "shasum": "" }, "require": { @@ -2382,7 +2357,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2409,29 +2384,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-07-10T11:02:47+00:00" }, { "name": "symfony/filesystem", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed" + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/760e47a4ee64b4c48f4b30017011e09d4c0f05ed", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2458,20 +2434,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/finder", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", "shasum": "" }, "require": { @@ -2480,7 +2456,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2507,20 +2483,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-06-19T21:38:16+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b" + "reference": "0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/30d9240b30696a69e893534c9fc4a5c72ab6689b", - "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56", + "reference": "0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56", "shasum": "" }, "require": { @@ -2529,7 +2505,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2561,37 +2537,34 @@ "configuration", "options" ], - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-07-07T16:00:36+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.6.0", + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" @@ -2602,111 +2575,54 @@ "MIT" ], "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2017-10-11T12:05:26+00:00" - }, - { - "name": "symfony/polyfill-php54", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/90e085822963fdcc9d1c5b73deb3d2e5783b16a0", - "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php54\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" } ], - "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2018-04-30T19:57:29+00:00" }, { - "name": "symfony/polyfill-php55", - "version": "v1.3.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "3296adf6a6454a050679cde90f95350ad604b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { - "ircmaxell/password-compat": "~1.0", "php": ">=5.3.3" }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.8-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php55\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -2726,28 +2642,29 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "mbstring", "polyfill", "portable", "shim" ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.6.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff" + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", - "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", "shasum": "" }, "require": { @@ -2757,7 +2674,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -2793,20 +2710,20 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" + "time": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.6.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254" + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/6de4f4884b97abbbed9f0a84a95ff2ff77254254", - "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", "shasum": "" }, "require": { @@ -2815,7 +2732,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -2848,78 +2765,20 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" - }, - { - "name": "symfony/polyfill-xml", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-xml.git", - "reference": "64b6a864f18ab4fddad49f5025f805f6781dfabd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-xml/zipball/64b6a864f18ab4fddad49f5025f805f6781dfabd", - "reference": "64b6a864f18ab4fddad49f5025f805f6781dfabd", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-xml": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Xml\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for xml's utf8_encode and utf8_decode functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2016-11-14T01:06:16+00:00" + "time": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/process", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2145b3e8137e463b1051b79440a59b38220944f0" + "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2145b3e8137e463b1051b79440a59b38220944f0", - "reference": "2145b3e8137e463b1051b79440a59b38220944f0", + "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", + "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", "shasum": "" }, "require": { @@ -2928,7 +2787,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2955,20 +2814,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-05-31T10:17:53+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.0.3", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704" + "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d52321f0e2b596bd03b5d1dd6eebe71caa925704", - "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/07463bbbbbfe119045a24c4a516f92ebd2752784", + "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784", "shasum": "" }, "require": { @@ -2977,7 +2836,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3004,27 +2863,31 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-02-19T16:51:42+00:00" }, { "name": "symfony/yaml", - "version": "v3.2.6", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", - "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "url": "https://api.github.com/repos/symfony/yaml/zipball/80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -3032,7 +2895,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3059,20 +2922,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-07T16:47:02+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "tecnickcom/tcpdf", - "version": "6.2.12", + "version": "6.2.17", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f" + "reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f", - "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/64fc19439863e1b1314487a72a74d9bfd0b55a53", + "reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53", "shasum": "" }, "require": { @@ -3081,7 +2944,6 @@ "type": "library", "autoload": { "classmap": [ - "fonts", "config", "include", "tcpdf.php", @@ -3102,13 +2964,13 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPLv3" + "LGPL-3.0" ], "authors": [ { "name": "Nicola Asuni", "email": "info@tecnick.com", - "homepage": "http://nicolaasuni.tecnick.com" + "role": "lead" } ], "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", @@ -3122,20 +2984,20 @@ "pdf417", "qrcode" ], - "time": "2015-09-12T10:08:34+00:00" + "time": "2018-02-24T11:48:20+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { @@ -3172,7 +3034,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], From 4e3f7695337c5829f554871d759bd399f8190a01 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 00:05:38 +0100 Subject: [PATCH 15/22] D*** composer lock file --- composer.lock | 805 +++++++++++++++++++++++++++++--------------------- 1 file changed, 470 insertions(+), 335 deletions(-) diff --git a/composer.lock b/composer.lock index 6b62690264..db9dfb58c2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c46adaaa5883b6e359fae0c32c0b489e", + "content-hash": "4317eac63959b226b73aa73441b25038", "packages": [ { "name": "markbaker/complex", @@ -103,16 +103,16 @@ }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", + "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", "shasum": "" }, "require": { @@ -147,7 +147,7 @@ "psr-16", "simple-cache" ], - "time": "2017-10-23T01:57:42+00:00" + "time": "2017-01-02T13:31:39+00:00" } ], "packages-dev": [ @@ -213,50 +213,6 @@ ], "time": "2016-08-30T16:08:34+00:00" }, - { - "name": "composer/xdebug-handler", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "time": "2018-04-11T15:42:36+00:00" - }, { "name": "doctrine/annotations", "version": "v1.6.0", @@ -327,32 +283,32 @@ }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -377,7 +333,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "doctrine/lexer", @@ -435,16 +391,16 @@ }, { "name": "dompdf/dompdf", - "version": "v0.8.2", + "version": "v0.8.0", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6" + "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6", - "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", + "reference": "0f418c6b58fdeafc2a0e80eb1fa5e644e185089c", "shasum": "" }, "require": { @@ -452,8 +408,8 @@ "ext-gd": "*", "ext-mbstring": "*", "phenx/php-font-lib": "0.5.*", - "phenx/php-svg-lib": "0.3.*", - "php": ">=5.4.0" + "phenx/php-svg-lib": "0.2.*", + "php": ">=5.3.0" }, "require-dev": { "phpunit/phpunit": "4.8.*", @@ -493,30 +449,30 @@ ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2017-11-26T14:49:08+00:00" + "time": "2017-02-16T02:40:40+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.12.2", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183" + "reference": "513a3765b56dd029175f9f32995566657ee89dda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/dcc87d5414e9d0bd316fce81a5bedb9ce720b183", - "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/513a3765b56dd029175f9f32995566657ee89dda", + "reference": "513a3765b56dd029175f9f32995566657ee89dda", "shasum": "" }, "require": { "composer/semver": "^1.4", - "composer/xdebug-handler": "^1.0", "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", + "gecko-packages/gecko-php-unit": "^2.0 || ^3.0", "php": "^5.6 || >=7.0 <7.3", - "php-cs-fixer/diff": "^1.3", + "php-cs-fixer/diff": "^1.2", "symfony/console": "^3.2 || ^4.0", "symfony/event-dispatcher": "^3.0 || ^4.0", "symfony/filesystem": "^3.0 || ^4.0", @@ -531,41 +487,39 @@ "hhvm": "*" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0@dev", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.1", + "keradus/cli-executor": "^1.0", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.1", + "php-coveralls/php-coveralls": "^2.0", "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", - "phpunitgoodpractices/traits": "^1.5.1", - "symfony/phpunit-bridge": "^4.0" + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "phpunitgoodpractices/traits": "^1.0", + "symfony/phpunit-bridge": "^3.2.2 || ^4.0" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, "bin": [ "php-cs-fixer" ], "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.10-dev" + } + }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" }, "classmap": [ "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", "tests/Test/AbstractIntegrationTestCase.php", "tests/Test/Assert/AssertTokensTrait.php", "tests/Test/IntegrationCase.php", "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", "tests/TestCase.php" ] }, @@ -584,7 +538,98 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2018-07-06T10:37:40+00:00" + "time": "2018-01-10T17:16:15+00:00" + }, + { + "name": "gecko-packages/gecko-php-unit", + "version": "v3.0", + "source": { + "type": "git", + "url": "https://github.com/GeckoPackages/GeckoPHPUnit.git", + "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GeckoPackages/GeckoPHPUnit/zipball/6a866551dffc2154c1b091bae3a7877d39c25ca3", + "reference": "6a866551dffc2154c1b091bae3a7877d39c25ca3", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-dom": "When testing with xml.", + "ext-libxml": "When testing with xml.", + "phpunit/phpunit": "This is an extension for it so make sure you have it some way." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "GeckoPackages\\PHPUnit\\": "src/PHPUnit" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Additional PHPUnit asserts and constraints.", + "homepage": "https://github.com/GeckoPackages", + "keywords": [ + "extension", + "filesystem", + "phpunit" + ], + "time": "2017-08-23T07:46:41+00:00" + }, + { + "name": "ircmaxell/password-compat", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2014-11-20T16:49:30+00:00" }, { "name": "jpgraph/jpgraph", @@ -628,23 +673,22 @@ }, { "name": "mpdf/mpdf", - "version": "v7.1.1", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/mpdf/mpdf.git", - "reference": "800a7f9d93474988cc2ffb8c155497ca5910fb09" + "reference": "375a79a575fde762a7c390766837e78e8dfe97bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/800a7f9d93474988cc2ffb8c155497ca5910fb09", - "reference": "800a7f9d93474988cc2ffb8c155497ca5910fb09", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/375a79a575fde762a7c390766837e78e8dfe97bf", + "reference": "375a79a575fde762a7c390766837e78e8dfe97bf", "shasum": "" }, "require": { "ext-gd": "*", "ext-mbstring": "*", - "myclabs/deep-copy": "^1.7", - "paragonie/random_compat": "^1.4|^2.0", + "paragonie/random_compat": "^2.0", "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0", "psr/log": "^1.0", "setasign/fpdi": "1.6.*" @@ -673,7 +717,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-only" + "GPL-2.0" ], "authors": [ { @@ -692,47 +736,41 @@ "php", "utf-8" ], - "time": "2018-07-02T14:26:48+00:00" + "time": "2017-10-19T16:38:45+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": ">=5.4.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -740,20 +778,20 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2017-01-26T22:05:40+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.17", + "version": "v2.0.11", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", "shasum": "" }, "require": { @@ -785,24 +823,23 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", - "polyfill", "pseudorandom", "random" ], - "time": "2018-07-04T16:31:37+00:00" + "time": "2017-09-27T21:40:39+00:00" }, { "name": "phenx/php-font-lib", - "version": "0.5.1", + "version": "0.5", "source": { "type": "git", "url": "https://github.com/PhenX/php-font-lib.git", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97" + "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/760148820110a1ae0936e5cc35851e25a938bc97", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/19ad2bebc35be028fcc0221025fcbf3d436a3962", + "reference": "19ad2bebc35be028fcc0221025fcbf3d436a3962", "shasum": "" }, "require-dev": { @@ -826,27 +863,24 @@ ], "description": "A library to read, parse, export and make subsets of different types of font files.", "homepage": "https://github.com/PhenX/php-font-lib", - "time": "2017-09-13T16:14:37+00:00" + "time": "2017-02-11T10:58:43+00:00" }, { "name": "phenx/php-svg-lib", - "version": "v0.3.2", + "version": "v0.2", "source": { "type": "git", "url": "https://github.com/PhenX/php-svg-lib.git", - "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c" + "reference": "de291bec8449b89acfe85691b5c71434797959dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/ccc46ef6340d4b8a4a68047e68d8501ea961442c", - "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c", + "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/de291bec8449b89acfe85691b5c71434797959dc", + "reference": "de291bec8449b89acfe85691b5c71434797959dc", "shasum": "" }, "require": { - "sabberworm/php-css-parser": "8.1.*" - }, - "require-dev": { - "phpunit/phpunit": "~5.0" + "sabberworm/php-css-parser": "6.0.*" }, "type": "library", "autoload": { @@ -866,27 +900,27 @@ ], "description": "A library to read, parse and export to PDF SVG files.", "homepage": "https://github.com/PhenX/php-svg-lib", - "time": "2018-06-03T10:10:03+00:00" + "time": "2016-12-13T20:25:45+00:00" }, { "name": "php-cs-fixer/diff", - "version": "v1.3.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + "reference": "f0ef6133d674137e902fdf8a6f2e8e97e14a087b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/f0ef6133d674137e902fdf8a6f2e8e97e14a087b", + "reference": "f0ef6133d674137e902fdf8a6f2e8e97e14a087b", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "phpunit/phpunit": "^4.8.35 || ^5.4.3", "symfony/process": "^3.3" }, "type": "library", @@ -896,9 +930,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], "authors": [ { "name": "Kore Nordmann", @@ -917,20 +948,20 @@ "keywords": [ "diff" ], - "time": "2018-02-15T16:58:55+00:00" + "time": "2017-10-19T09:58:18+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "shasum": "" }, "require": { @@ -971,39 +1002,33 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -1022,24 +1047,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", + "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -1069,37 +1094,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpspec/prophecy", - "version": "1.7.6", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -1132,20 +1157,20 @@ "spy", "stub" ], - "time": "2018-04-18T13:57:24+00:00" + "time": "2017-03-02T20:05:34+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "4.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/09e2277d14ea467e5a984010f501343ef29ffc69", + "reference": "09e2277d14ea467e5a984010f501343ef29ffc69", "shasum": "" }, "require": { @@ -1195,20 +1220,20 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-03-01T09:12:17+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -1242,7 +1267,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -1336,29 +1361,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "1.4.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "~4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1381,20 +1406,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2017-02-27T10:12:30+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.27", + "version": "5.7.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68752b665d3875f9a38a357e3ecb35c79f8673bf", + "reference": "68752b665d3875f9a38a357e3ecb35c79f8673bf", "shasum": "" }, "require": { @@ -1412,14 +1437,14 @@ "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", + "sebastian/diff": "~1.2", "sebastian/environment": "^1.3.4 || ^2.0", "sebastian/exporter": "~2.0", "sebastian/global-state": "^1.1", "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" + "sebastian/version": "~1.0.3|~2.0", + "symfony/yaml": "~2.1|~3.0" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2" @@ -1463,20 +1488,20 @@ "testing", "xunit" ], - "time": "2018-02-01T05:50:59+00:00" + "time": "2017-03-19T16:52:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", "shasum": "" }, "require": { @@ -1522,7 +1547,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2016-12-08T20:27:08+00:00" }, { "name": "psr/log", @@ -1573,24 +1598,21 @@ }, { "name": "sabberworm/php-css-parser", - "version": "8.1.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", - "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef" + "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/850cbbcbe7fbb155387a151ea562897a67e242ef", - "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef", + "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/9ea4b00c569b19f731d0c2e0e802055877ff40c2", + "reference": "9ea4b00c569b19f731d0c2e0e802055877ff40c2", "shasum": "" }, "require": { "php": ">=5.3.2" }, - "require-dev": { - "phpunit/phpunit": "*" - }, "type": "library", "autoload": { "psr-0": { @@ -1613,7 +1635,7 @@ "parser", "stylesheet" ], - "time": "2016-07-19T19:14:21+00:00" + "time": "2015-08-24T08:48:52+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1726,23 +1748,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { @@ -1774,7 +1796,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", @@ -2179,16 +2201,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.1", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", + "reference": "d7cf0d894e8aa4c73712ee4a331cc1eaa37cdc7d", "shasum": "" }, "require": { @@ -2253,20 +2275,20 @@ "phpcs", "standards" ], - "time": "2017-05-22T02:43:20+00:00" + "time": "2017-03-01T22:17:45+00:00" }, { "name": "symfony/console", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219" + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5c31f6a97c1c240707f6d786e7e59bfacdbc0219", - "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219", + "url": "https://api.github.com/repos/symfony/console/zipball/fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", + "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", "shasum": "" }, "require": { @@ -2286,7 +2308,7 @@ "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2294,7 +2316,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2321,20 +2343,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-16T14:05:40+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f" + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", - "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74d33aac36208c4d6757807d9f598f0133a3a4eb", + "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb", "shasum": "" }, "require": { @@ -2357,7 +2379,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2384,30 +2406,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-10T11:02:47+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c" + "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", - "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/760e47a4ee64b4c48f4b30017011e09d4c0f05ed", + "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2434,20 +2455,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/finder", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", + "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", "shasum": "" }, "require": { @@ -2456,7 +2477,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2483,20 +2504,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56" + "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56", - "reference": "0aec9f9c5d2447ae7ea5ea31bc82f1d43f9a8a56", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/30d9240b30696a69e893534c9fc4a5c72ab6689b", + "reference": "30d9240b30696a69e893534c9fc4a5c72ab6689b", "shasum": "" }, "require": { @@ -2505,7 +2526,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2537,34 +2558,37 @@ "configuration", "options" ], - "time": "2018-07-07T16:00:36+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.6-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -2575,54 +2599,111 @@ "MIT" ], "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/polyfill-php54", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php54.git", + "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/90e085822963fdcc9d1c5b73deb3d2e5783b16a0", + "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php54\\": "" }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", "polyfill", - "portable" + "portable", + "shim" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2016-11-14T01:06:16+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "name": "symfony/polyfill-php55", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "03e3f0350bca2220e3623a0e340eef194405fc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", + "reference": "03e3f0350bca2220e3623a0e340eef194405fc67", "shasum": "" }, "require": { + "ircmaxell/password-compat": "~1.0", "php": ">=5.3.3" }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Php55\\": "" }, "files": [ "bootstrap.php" @@ -2642,29 +2723,28 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.8.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" + "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", + "reference": "0442b9c0596610bd24ae7b5f0a6cdbbc16d9fcff", "shasum": "" }, "require": { @@ -2674,7 +2754,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -2710,20 +2790,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.8.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" + "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", - "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/6de4f4884b97abbbed9f0a84a95ff2ff77254254", + "reference": "6de4f4884b97abbbed9f0a84a95ff2ff77254254", "shasum": "" }, "require": { @@ -2732,7 +2812,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -2765,20 +2845,78 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2017-10-11T12:05:26+00:00" + }, + { + "name": "symfony/polyfill-xml", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-xml.git", + "reference": "64b6a864f18ab4fddad49f5025f805f6781dfabd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-xml/zipball/64b6a864f18ab4fddad49f5025f805f6781dfabd", + "reference": "64b6a864f18ab4fddad49f5025f805f6781dfabd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-xml": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Xml\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for xml's utf8_encode and utf8_decode functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a" + "reference": "2145b3e8137e463b1051b79440a59b38220944f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", - "reference": "1d1677391ecf00d1c5b9482d6050c0c27aa3ac3a", + "url": "https://api.github.com/repos/symfony/process/zipball/2145b3e8137e463b1051b79440a59b38220944f0", + "reference": "2145b3e8137e463b1051b79440a59b38220944f0", "shasum": "" }, "require": { @@ -2787,7 +2925,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2814,20 +2952,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.1.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784" + "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/07463bbbbbfe119045a24c4a516f92ebd2752784", - "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d52321f0e2b596bd03b5d1dd6eebe71caa925704", + "reference": "d52321f0e2b596bd03b5d1dd6eebe71caa925704", "shasum": "" }, "require": { @@ -2836,7 +2974,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2863,31 +3001,27 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-02-19T16:51:42+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/yaml", - "version": "v4.1.2", + "version": "v3.2.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e" + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/80e4bfa9685fc4a09acc4a857ec16974a9cd944e", - "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/093e416ad096355149e265ea2e4cc1f9ee40ab1a", + "reference": "093e416ad096355149e265ea2e4cc1f9ee40ab1a", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" + "php": ">=5.5.9" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "~2.8|~3.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -2895,7 +3029,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2922,20 +3056,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2017-03-07T16:47:02+00:00" }, { "name": "tecnickcom/tcpdf", - "version": "6.2.17", + "version": "6.2.12", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53" + "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/64fc19439863e1b1314487a72a74d9bfd0b55a53", - "reference": "64fc19439863e1b1314487a72a74d9bfd0b55a53", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f", + "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f", "shasum": "" }, "require": { @@ -2944,6 +3078,7 @@ "type": "library", "autoload": { "classmap": [ + "fonts", "config", "include", "tcpdf.php", @@ -2964,13 +3099,13 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPLv3" ], "authors": [ { "name": "Nicola Asuni", "email": "info@tecnick.com", - "role": "lead" + "homepage": "http://nicolaasuni.tecnick.com" } ], "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", @@ -2984,20 +3119,20 @@ "pdf417", "qrcode" ], - "time": "2018-02-24T11:48:20+00:00" + "time": "2015-09-12T10:08:34+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { @@ -3034,7 +3169,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], From 1793fb6a1e65b1d229c51567de5ccf7e76c281ee Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 09:57:16 +0100 Subject: [PATCH 16/22] Cleanup of scrutinizer issues --- .../Calculation/EngineeringTest.php | 100 +++++++++++------- .../Custom/ComplexAssert.php | 23 ++-- 2 files changed, 74 insertions(+), 49 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index c0dd48c1f2..75a60decb4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -109,10 +109,11 @@ public function providerCOMPLEX() * @dataProvider providerIMAGINARY * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMAGINARY($expectedResult, ...$args) + public function testIMAGINARY($expectedResult, $value) { - $result = Engineering::IMAGINARY(...$args); + $result = Engineering::IMAGINARY($value); self::assertEquals($expectedResult, $result, null, 1E-8); } @@ -125,10 +126,11 @@ public function providerIMAGINARY() * @dataProvider providerIMREAL * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMREAL($expectedResult, ...$args) + public function testIMREAL($expectedResult, $value) { - $result = Engineering::IMREAL(...$args); + $result = Engineering::IMREAL($value); self::assertEquals($expectedResult, $result, null, 1E-8); } @@ -141,10 +143,11 @@ public function providerIMREAL() * @dataProvider providerIMABS * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMABS($expectedResult, ...$args) + public function testIMABS($expectedResult, $value) { - $result = Engineering::IMABS(...$args); + $result = Engineering::IMABS($value); self::assertEquals($expectedResult, $result, null, 1E-8); } @@ -157,10 +160,11 @@ public function providerIMABS() * @dataProvider providerIMARGUMENT * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMARGUMENT($expectedResult, ...$args) + public function testIMARGUMENT($expectedResult, $value) { - $result = Engineering::IMARGUMENT(...$args); + $result = Engineering::IMARGUMENT($value); self::assertEquals($expectedResult, $result, null, 1E-8); } @@ -173,10 +177,11 @@ public function providerIMARGUMENT() * @dataProvider providerIMCONJUGATE * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCONJUGATE($expectedResult, ...$args) + public function testIMCONJUGATE($expectedResult, $value) { - $result = Engineering::IMCONJUGATE(...$args); + $result = Engineering::IMCONJUGATE($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -189,10 +194,11 @@ public function providerIMCONJUGATE() * @dataProvider providerIMCOS * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCOS($expectedResult, ...$args) + public function testIMCOS($expectedResult, $value) { - $result = Engineering::IMCOS(...$args); + $result = Engineering::IMCOS($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -205,10 +211,11 @@ public function providerIMCOS() * @dataProvider providerIMCOSH * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCOSH($expectedResult, ...$args) + public function testIMCOSH($expectedResult, $value) { - $result = Engineering::IMCOSH(...$args); + $result = Engineering::IMCOSH($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -221,10 +228,11 @@ public function providerIMCOSH() * @dataProvider providerIMCOT * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCOT($expectedResult, ...$args) + public function testIMCOT($expectedResult, $value) { - $result = Engineering::IMCOT(...$args); + $result = Engineering::IMCOT($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -237,10 +245,11 @@ public function providerIMCOT() * @dataProvider providerIMCSC * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCSC($expectedResult, ...$args) + public function testIMCSC($expectedResult, $value) { - $result = Engineering::IMCSC(...$args); + $result = Engineering::IMCSC($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -253,10 +262,11 @@ public function providerIMCSC() * @dataProvider providerIMCSCH * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMCSCH($expectedResult, ...$args) + public function testIMCSCH($expectedResult, $value) { - $result = Engineering::IMCSCH(...$args); + $result = Engineering::IMCSCH($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -269,10 +279,11 @@ public function providerIMCSCH() * @dataProvider providerIMSEC * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMSEC($expectedResult, ...$args) + public function testIMSEC($expectedResult, $value) { - $result = Engineering::IMSEC(...$args); + $result = Engineering::IMSEC($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -285,10 +296,11 @@ public function providerIMSEC() * @dataProvider providerIMSECH * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMSECH($expectedResult, ...$args) + public function testIMSECH($expectedResult, $value) { - $result = Engineering::IMSECH(...$args); + $result = Engineering::IMSECH($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -317,10 +329,11 @@ public function providerIMDIV() * @dataProvider providerIMEXP * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMEXP($expectedResult, ...$args) + public function testIMEXP($expectedResult, $value) { - $result = Engineering::IMEXP(...$args); + $result = Engineering::IMEXP($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -333,10 +346,11 @@ public function providerIMEXP() * @dataProvider providerIMLN * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMLN($expectedResult, ...$args) + public function testIMLN($expectedResult, $value) { - $result = Engineering::IMLN(...$args); + $result = Engineering::IMLN($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -349,10 +363,11 @@ public function providerIMLN() * @dataProvider providerIMLOG2 * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMLOG2($expectedResult, ...$args) + public function testIMLOG2($expectedResult, $value) { - $result = Engineering::IMLOG2(...$args); + $result = Engineering::IMLOG2($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -365,10 +380,11 @@ public function providerIMLOG2() * @dataProvider providerIMLOG10 * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMLOG10($expectedResult, ...$args) + public function testIMLOG10($expectedResult, $value) { - $result = Engineering::IMLOG10(...$args); + $result = Engineering::IMLOG10($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -415,10 +431,11 @@ public function providerIMPRODUCT() * @dataProvider providerIMSIN * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMSIN($expectedResult, ...$args) + public function testIMSIN($expectedResult, $value) { - $result = Engineering::IMSIN(...$args); + $result = Engineering::IMSIN($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -431,10 +448,11 @@ public function providerIMSIN() * @dataProvider providerIMSINH * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMSINH($expectedResult, ...$args) + public function testIMSINH($expectedResult, $value) { - $result = Engineering::IMSINH(...$args); + $result = Engineering::IMSINH($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -447,10 +465,11 @@ public function providerIMSINH() * @dataProvider providerIMTAN * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMTAN($expectedResult, ...$args) + public function testIMTAN($expectedResult, $value) { - $result = Engineering::IMTAN(...$args); + $result = Engineering::IMTAN($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } @@ -463,10 +482,11 @@ public function providerIMTAN() * @dataProvider providerIMSQRT * * @param mixed $expectedResult + * @param mixed $value */ - public function testIMSQRT($expectedResult, ...$args) + public function testIMSQRT($expectedResult, $value) { - $result = Engineering::IMSQRT(...$args); + $result = Engineering::IMSQRT($value); self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); } diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index 76502cef89..c7bfb51ba2 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -6,18 +6,23 @@ class ComplexAssert { private $errorMessage = ''; + private function testExceptions($expected, $actual) + { + // Expecting an error, so we do a straight string comparison + if ($expected === $actual) { + return true; + } elseif ($expected === INF && $actual === 'INF') { + return true; + } + $this->errorMessage = 'Expected Error: ' . $actual . ' !== ' . $expected; + + return false; + } + public function assertComplexEquals($expected, $actual, $delta = 0) { if ($expected === INF || $expected[0] === '#') { - // Expecting an error, so we do a straight string comparison - if ($expected === $actual) { - return true; - } elseif ($expected === INF && $actual === 'INF') { - return true; - } - $this->errorMessage = 'Expected Error: ' . $actual . ' !== ' . $expected; - - return false; + return $this->testExceptions($expected, $actual); } $expectedComplex = new Complex($expected); From 04462a7d02ba903ed9f18621208501dea55576ba Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 12:24:03 +0100 Subject: [PATCH 17/22] Simplify unit tests using the Complex\Complex class rather than a custom parser --- .../Calculation/EngineeringTest.php | 131 +++++++++--- tests/PhpSpreadsheetTests/Custom/Complex.php | 194 ------------------ .../Custom/ComplexAssert.php | 12 +- 3 files changed, 105 insertions(+), 232 deletions(-) delete mode 100644 tests/PhpSpreadsheetTests/Custom/Complex.php diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 75a60decb4..3d4000a3e3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -14,6 +14,10 @@ class EngineeringTest extends TestCase */ protected $complexAssert; + const BESSEL_PRECISION = 1E-8; + const COMPLEX_PRECISION = 1E-8; + const ERF_PRECISION = 1E-12; + public function setUp() { $this->complexAssert = new ComplexAssert(); @@ -33,7 +37,7 @@ public function tearDown() public function testBESSELI($expectedResult, ...$args) { $result = Engineering::BESSELI(...$args); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION); } public function providerBESSELI() @@ -49,7 +53,7 @@ public function providerBESSELI() public function testBESSELJ($expectedResult, ...$args) { $result = Engineering::BESSELJ(...$args); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION); } public function providerBESSELJ() @@ -65,7 +69,7 @@ public function providerBESSELJ() public function testBESSELK($expectedResult, ...$args) { $result = Engineering::BESSELK(...$args); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION); } public function providerBESSELK() @@ -81,7 +85,7 @@ public function providerBESSELK() public function testBESSELY($expectedResult, ...$args) { $result = Engineering::BESSELY(...$args); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION); } public function providerBESSELY() @@ -114,7 +118,7 @@ public function providerCOMPLEX() public function testIMAGINARY($expectedResult, $value) { $result = Engineering::IMAGINARY($value); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION); } public function providerIMAGINARY() @@ -131,7 +135,7 @@ public function providerIMAGINARY() public function testIMREAL($expectedResult, $value) { $result = Engineering::IMREAL($value); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION); } public function providerIMREAL() @@ -148,7 +152,7 @@ public function providerIMREAL() public function testIMABS($expectedResult, $value) { $result = Engineering::IMABS($value); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION); } public function providerIMABS() @@ -165,7 +169,7 @@ public function providerIMABS() public function testIMARGUMENT($expectedResult, $value) { $result = Engineering::IMARGUMENT($value); - self::assertEquals($expectedResult, $result, null, 1E-8); + self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION); } public function providerIMARGUMENT() @@ -182,7 +186,10 @@ public function providerIMARGUMENT() public function testIMCONJUGATE($expectedResult, $value) { $result = Engineering::IMCONJUGATE($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCONJUGATE() @@ -199,7 +206,10 @@ public function providerIMCONJUGATE() public function testIMCOS($expectedResult, $value) { $result = Engineering::IMCOS($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCOS() @@ -216,7 +226,10 @@ public function providerIMCOS() public function testIMCOSH($expectedResult, $value) { $result = Engineering::IMCOSH($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCOSH() @@ -233,7 +246,10 @@ public function providerIMCOSH() public function testIMCOT($expectedResult, $value) { $result = Engineering::IMCOT($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCOT() @@ -250,7 +266,10 @@ public function providerIMCOT() public function testIMCSC($expectedResult, $value) { $result = Engineering::IMCSC($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCSC() @@ -267,7 +286,10 @@ public function providerIMCSC() public function testIMCSCH($expectedResult, $value) { $result = Engineering::IMCSCH($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMCSCH() @@ -284,7 +306,10 @@ public function providerIMCSCH() public function testIMSEC($expectedResult, $value) { $result = Engineering::IMSEC($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSEC() @@ -301,7 +326,10 @@ public function providerIMSEC() public function testIMSECH($expectedResult, $value) { $result = Engineering::IMSECH($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSECH() @@ -317,7 +345,10 @@ public function providerIMSECH() public function testIMDIV($expectedResult, ...$args) { $result = Engineering::IMDIV(...$args); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMDIV() @@ -334,7 +365,10 @@ public function providerIMDIV() public function testIMEXP($expectedResult, $value) { $result = Engineering::IMEXP($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMEXP() @@ -351,7 +385,10 @@ public function providerIMEXP() public function testIMLN($expectedResult, $value) { $result = Engineering::IMLN($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMLN() @@ -368,7 +405,10 @@ public function providerIMLN() public function testIMLOG2($expectedResult, $value) { $result = Engineering::IMLOG2($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMLOG2() @@ -385,7 +425,10 @@ public function providerIMLOG2() public function testIMLOG10($expectedResult, $value) { $result = Engineering::IMLOG10($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMLOG10() @@ -403,7 +446,10 @@ public function testIMPOWER($expectedResult, ...$args) $this->markTestIncomplete('TODO: This test should be fixed'); $result = Engineering::IMPOWER(...$args); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMPOWER() @@ -419,7 +465,10 @@ public function providerIMPOWER() public function testIMPRODUCT($expectedResult, ...$args) { $result = Engineering::IMPRODUCT(...$args); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMPRODUCT() @@ -436,7 +485,10 @@ public function providerIMPRODUCT() public function testIMSIN($expectedResult, $value) { $result = Engineering::IMSIN($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSIN() @@ -453,7 +505,10 @@ public function providerIMSIN() public function testIMSINH($expectedResult, $value) { $result = Engineering::IMSINH($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSINH() @@ -470,7 +525,10 @@ public function providerIMSINH() public function testIMTAN($expectedResult, $value) { $result = Engineering::IMTAN($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMTAN() @@ -487,7 +545,10 @@ public function providerIMTAN() public function testIMSQRT($expectedResult, $value) { $result = Engineering::IMSQRT($value); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSQRT() @@ -503,7 +564,10 @@ public function providerIMSQRT() public function testIMSUB($expectedResult, ...$args) { $result = Engineering::IMSUB(...$args); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSUB() @@ -519,7 +583,10 @@ public function providerIMSUB() public function testIMSUM($expectedResult, ...$args) { $result = Engineering::IMSUM(...$args); - self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); + self::assertTrue( + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->getErrorMessage() + ); } public function providerIMSUM() @@ -535,7 +602,7 @@ public function providerIMSUM() public function testERF($expectedResult, ...$args) { $result = Engineering::ERF(...$args); - self::assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION); } public function providerERF() @@ -551,7 +618,7 @@ public function providerERF() public function testERFPRECISE($expectedResult, ...$args) { $result = Engineering::ERFPRECISE(...$args); - self::assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION); } public function providerERFPRECISE() @@ -567,7 +634,7 @@ public function providerERFPRECISE() public function testERFC($expectedResult, ...$args) { $result = Engineering::ERFC(...$args); - self::assertEquals($expectedResult, $result, null, 1E-12); + self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION); } public function providerERFC() diff --git a/tests/PhpSpreadsheetTests/Custom/Complex.php b/tests/PhpSpreadsheetTests/Custom/Complex.php deleted file mode 100644 index 1406f01de1..0000000000 --- a/tests/PhpSpreadsheetTests/Custom/Complex.php +++ /dev/null @@ -1,194 +0,0 @@ -realPart = (float) $realPart; - $this->imaginaryPart = (float) $imaginaryPart; - $this->suffix = strtolower($suffix); - } - - /** - * Gets the real part of this complex number. - * - * @return float - */ - public function getReal() - { - return $this->realPart; - } - - /** - * Gets the imaginary part of this complex number. - * - * @return float - */ - public function getImaginary() - { - return $this->imaginaryPart; - } - - /** - * Gets the suffix of this complex number. - * - * @return string - */ - public function getSuffix() - { - return $this->suffix; - } - - public function format() - { - $str = ''; - if ($this->imaginaryPart != 0.0) { - if (\abs($this->imaginaryPart) != 1.0) { - $str .= $this->imaginaryPart . $this->suffix; - } else { - $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix; - } - } - if ($this->realPart != 0.0) { - if (($str) && ($this->imaginaryPart > 0.0)) { - $str = '+' . $str; - } - $str = $this->realPart . $str; - } - if (!$str) { - $str = '0.0'; - } - - return $str; - } - - public function __toString() - { - return $this->format(); - } -} diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index c7bfb51ba2..95d07030d8 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -2,11 +2,13 @@ namespace PhpOffice\PhpSpreadsheetTests\Custom; +use Complex\Complex; + class ComplexAssert { private $errorMessage = ''; - private function testExceptions($expected, $actual) + private function testExpectedExceptions($expected, $actual) { // Expecting an error, so we do a straight string comparison if ($expected === $actual) { @@ -22,7 +24,7 @@ private function testExceptions($expected, $actual) public function assertComplexEquals($expected, $actual, $delta = 0) { if ($expected === INF || $expected[0] === '#') { - return $this->testExceptions($expected, $actual); + return $this->testExpectedExceptions($expected, $actual); } $expectedComplex = new Complex($expected); @@ -38,15 +40,13 @@ public function assertComplexEquals($expected, $actual, $delta = 0) return true; } - if ($actualComplex->getReal() < ($expectedComplex->getReal() - $delta) || - $actualComplex->getReal() > ($expectedComplex->getReal() + $delta)) { + if (abs($actualComplex->getReal() - $expectedComplex->getReal()) > $delta) { $this->errorMessage = 'Mismatched Real part: ' . $actualComplex->getReal() . ' != ' . $expectedComplex->getReal(); return false; } - if ($actualComplex->getImaginary() < ($expectedComplex->getImaginary() - $delta) || - $actualComplex->getImaginary() > ($expectedComplex->getImaginary() + $delta)) { + if (abs($actualComplex->getImaginary() - $expectedComplex->getImaginary()) > $delta) { $this->errorMessage = 'Mismatched Imaginary part: ' . $actualComplex->getImaginary() . ' != ' . $expectedComplex->getImaginary(); return false; From 450ad982da7fa5ff83f83f6af48fb4f9fd6b45b4 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 15:17:36 +0100 Subject: [PATCH 18/22] Fix assertions for power() tests --- .../Calculation/EngineeringTest.php | 4 +--- .../Custom/ComplexAssert.php | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 3d4000a3e3..3f61029a68 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -443,11 +443,9 @@ public function providerIMLOG10() */ public function testIMPOWER($expectedResult, ...$args) { - $this->markTestIncomplete('TODO: This test should be fixed'); - $result = Engineering::IMPOWER(...$args); self::assertTrue( - $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION, true), $this->complexAssert->getErrorMessage() ); } diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index 95d07030d8..32d0594ce6 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -21,7 +21,19 @@ private function testExpectedExceptions($expected, $actual) return false; } - public function assertComplexEquals($expected, $actual, $delta = 0) + private function adjustDelta($expected, $actual, $delta) + { + $adjustedDelta = $delta; + + if (abs($actual) > 10 && abs($expected) > 10) { + $variance = floor(log10(abs($expected))); + $adjustedDelta *= pow(10, $variance); + } + + return $adjustedDelta > 1.0 ? 1.0 : $adjustedDelta; + } + + public function assertComplexEquals($expected, $actual, $delta = 0, $log = false) { if ($expected === INF || $expected[0] === '#') { return $this->testExpectedExceptions($expected, $actual); @@ -40,13 +52,15 @@ public function assertComplexEquals($expected, $actual, $delta = 0) return true; } - if (abs($actualComplex->getReal() - $expectedComplex->getReal()) > $delta) { + $adjustedDelta = $this->adjustDelta($expectedComplex->getReal(), $actualComplex->getReal(), $delta); + if (abs($actualComplex->getReal() - $expectedComplex->getReal()) > $adjustedDelta) { $this->errorMessage = 'Mismatched Real part: ' . $actualComplex->getReal() . ' != ' . $expectedComplex->getReal(); return false; } - if (abs($actualComplex->getImaginary() - $expectedComplex->getImaginary()) > $delta) { + $adjustedDelta = $this->adjustDelta($expectedComplex->getImaginary(), $actualComplex->getImaginary(), $delta); + if (abs($actualComplex->getImaginary() - $expectedComplex->getImaginary()) > $adjustedDelta) { $this->errorMessage = 'Mismatched Imaginary part: ' . $actualComplex->getImaginary() . ' != ' . $expectedComplex->getImaginary(); return false; From f16c7230e9624e69f51d51ded5a6e6ef9cd62d3f Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 16:05:14 +0100 Subject: [PATCH 19/22] Remove redundant $log argument --- tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php | 2 +- tests/PhpSpreadsheetTests/Custom/ComplexAssert.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 3f61029a68..763689125e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -445,7 +445,7 @@ public function testIMPOWER($expectedResult, ...$args) { $result = Engineering::IMPOWER(...$args); self::assertTrue( - $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION, true), + $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), $this->complexAssert->getErrorMessage() ); } diff --git a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php index 32d0594ce6..762b28865e 100644 --- a/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php +++ b/tests/PhpSpreadsheetTests/Custom/ComplexAssert.php @@ -33,7 +33,7 @@ private function adjustDelta($expected, $actual, $delta) return $adjustedDelta > 1.0 ? 1.0 : $adjustedDelta; } - public function assertComplexEquals($expected, $actual, $delta = 0, $log = false) + public function assertComplexEquals($expected, $actual, $delta = 0) { if ($expected === INF || $expected[0] === '#') { return $this->testExpectedExceptions($expected, $actual); From c43fb0a96635ca7c1be7d5e7146329d36e762110 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 24 Jul 2018 21:30:04 +0100 Subject: [PATCH 20/22] Upgrade complex library version to 1.4.1 --- composer.json | 2 +- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index b92cfb61d5..96cc522519 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "ext-zip": "*", "ext-zlib": "*", "psr/simple-cache": "^1.0", - "markbaker/complex": "^1.4.0" + "markbaker/complex": "^1.4.1" }, "require-dev": { "tecnickcom/tcpdf": "^6.2", diff --git a/composer.lock b/composer.lock index db9dfb58c2..ac3d4675c9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4317eac63959b226b73aa73441b25038", + "content-hash": "1aba55e3ac36d8d5015f9b3193f93c23", "packages": [ { "name": "markbaker/complex", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "77d01e85d064ab9ec1c7bc20fe9383de2f27367b" + "reference": "615f5443473cf37729666e2354fd8dfa2cb48e91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/77d01e85d064ab9ec1c7bc20fe9383de2f27367b", - "reference": "77d01e85d064ab9ec1c7bc20fe9383de2f27367b", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/615f5443473cf37729666e2354fd8dfa2cb48e91", + "reference": "615f5443473cf37729666e2354fd8dfa2cb48e91", "shasum": "" }, "require": { @@ -99,7 +99,7 @@ "complex", "mathematics" ], - "time": "2018-07-23T12:00:43+00:00" + "time": "2018-07-24T19:47:28+00:00" }, { "name": "psr/simple-cache", From 9c4bcca24d969990aa7824958776edcaa1356eaa Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Wed, 25 Jul 2018 12:57:09 +0100 Subject: [PATCH 21/22] Unit test for the now deprecated parseComplex() function --- src/PhpSpreadsheet/Calculation/Engineering.php | 2 +- .../Calculation/EngineeringTest.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index 7405e714ed..3f1b48bd74 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -725,7 +725,7 @@ class Engineering * * @param string $complexNumber The complex number * - * @return string[] Indexed on "real", "imaginary" and "suffix" + * @return mixed[] Indexed on "real", "imaginary" and "suffix" */ public static function parseComplex($complexNumber) { diff --git a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php index 763689125e..09da20c976 100644 --- a/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php @@ -93,6 +93,24 @@ public function providerBESSELY() return require 'data/Calculation/Engineering/BESSELY.php'; } + /** + * @dataProvider providerCOMPLEX + * + * @param mixed $expectedResult + */ + public function testParseComplex() + { + list($real, $imaginary, $suffix) = [1.23e-4, 5.67e+8, 'j']; + + $result = Engineering::parseComplex('1.23e-4+5.67e+8j'); + $this->assertArrayHasKey('real', $result); + $this->assertEquals($real, $result['real']); + $this->assertArrayHasKey('imaginary', $result); + $this->assertEquals($imaginary, $result['imaginary']); + $this->assertArrayHasKey('suffix', $result); + $this->assertEquals($suffix, $result['suffix']); + } + /** * @dataProvider providerCOMPLEX * From bb0d22fdeb9fd38edea19b02d1019c8a8a9103eb Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Wed, 25 Jul 2018 13:46:25 +0100 Subject: [PATCH 22/22] Documentation updates --- docs/references/function-list-by-category.md | 8 ++++++++ docs/references/function-list-by-name.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/references/function-list-by-category.md b/docs/references/function-list-by-category.md index 07f64f760c..185bf4c06f 100644 --- a/docs/references/function-list-by-category.md +++ b/docs/references/function-list-by-category.md @@ -86,6 +86,10 @@ IMAGINARY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMAGINA IMARGUMENT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT IMCONJUGATE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE IMCOS | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS +IMCOSH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH +IMCOT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT +IMCSC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC +IMCSCH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH IMDIV | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV IMEXP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP IMLN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN @@ -94,10 +98,14 @@ IMLOG2 | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG2 IMPOWER | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER IMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT IMREAL | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL +IMSEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC +IMSECH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH IMSIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN +IMSINH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH IMSQRT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT IMSUB | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB IMSUM | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM +IMTAN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN OCT2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOBIN OCT2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTODEC OCT2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOHEX diff --git a/docs/references/function-list-by-name.md b/docs/references/function-list-by-name.md index 3602f962aa..a8caca6c79 100644 --- a/docs/references/function-list-by-name.md +++ b/docs/references/function-list-by-name.md @@ -206,6 +206,10 @@ IMAGINARY | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet IMARGUMENT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT IMCONJUGATE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE IMCOS | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS +IMCOSH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH +IMCOT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT +IMCSC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC +IMCSCH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH IMDIV | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV IMEXP | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP IMLN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN @@ -214,10 +218,14 @@ IMLOG2 | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet IMPOWER | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER IMPRODUCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT IMREAL | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL +IMSEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC +IMSECH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH IMSIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN +IMSINH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH IMSQRT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT IMSUB | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB IMSUM | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM +IMTAN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN INDEX | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT INFO | CATEGORY_INFORMATION | **Not yet Implemented**