From 1ae8ef96512187406f78a5d221969ce2feb29036 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 Apr 2022 04:56:17 -0700 Subject: [PATCH 1/6] Bump dompdf/dompdf from 1.2.0 to 1.2.1 (#2721) Bumps [dompdf/dompdf](https://github.com/dompdf/dompdf) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/dompdf/dompdf/releases) - [Commits](https://github.com/dompdf/dompdf/compare/v1.2.0...v1.2.1) --- updated-dependencies: - dependency-name: dompdf/dompdf dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/composer.lock b/composer.lock index 7b76a2c4..38259b82 100644 --- a/composer.lock +++ b/composer.lock @@ -1100,16 +1100,16 @@ }, { "name": "dompdf/dompdf", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd" + "reference": "c6dfd9bb8b0040609f04754f729d4cb3016e0575" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/60b704331479a69e9bcdb3496da2315b5c4f94fd", - "reference": "60b704331479a69e9bcdb3496da2315b5c4f94fd", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/c6dfd9bb8b0040609f04754f729d4cb3016e0575", + "reference": "c6dfd9bb8b0040609f04754f729d4cb3016e0575", "shasum": "" }, "require": { @@ -1161,9 +1161,9 @@ "homepage": "https://github.com/dompdf/dompdf", "support": { "issues": "https://github.com/dompdf/dompdf/issues", - "source": "https://github.com/dompdf/dompdf/tree/v1.2.0" + "source": "https://github.com/dompdf/dompdf/tree/v1.2.1" }, - "time": "2022-02-07T13:02:10+00:00" + "time": "2022-03-24T12:57:42+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1692,23 +1692,25 @@ }, { "name": "phenx/php-svg-lib", - "version": "v0.3.3", + "version": "0.4.1", "source": { "type": "git", - "url": "https://github.com/PhenX/php-svg-lib.git", - "reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32" + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/5fa61b65e612ce1ae15f69b3d223cb14ecc60e32", - "reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/4498b5df7b08e8469f0f8279651ea5de9626ed02", + "reference": "4498b5df7b08e8469f0f8279651ea5de9626ed02", "shasum": "" }, "require": { - "sabberworm/php-css-parser": "^8.3" + "ext-mbstring": "*", + "php": "^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0", + "sabberworm/php-css-parser": "^8.4" }, "require-dev": { - "phpunit/phpunit": "^5.5|^6.5" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" }, "type": "library", "autoload": { @@ -1729,10 +1731,10 @@ "description": "A library to read, parse and export to PDF SVG files.", "homepage": "https://github.com/PhenX/php-svg-lib", "support": { - "issues": "https://github.com/PhenX/php-svg-lib/issues", - "source": "https://github.com/PhenX/php-svg-lib/tree/master" + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/0.4.1" }, - "time": "2019-09-11T20:02:13+00:00" + "time": "2022-03-07T12:52:04+00:00" }, { "name": "php-cs-fixer/diff", From 28bb2cd7c7343a7028babd2a3035a6a6dd5e9351 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 3 Apr 2022 05:13:55 -0700 Subject: [PATCH 2/6] Bump phpunit/phpunit from 9.5.16 to 9.5.20 (#2726) Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.16 to 9.5.20. - [Release notes](https://github.com/sebastianbergmann/phpunit/releases) - [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md) - [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.16...9.5.20) --- updated-dependencies: - dependency-name: phpunit/phpunit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 115 ++++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 55 deletions(-) diff --git a/composer.lock b/composer.lock index 38259b82..585faf30 100644 --- a/composer.lock +++ b/composer.lock @@ -951,29 +951,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -1000,7 +1001,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" }, "funding": [ { @@ -1016,7 +1017,7 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-03-03T08:28:38+00:00" }, { "name": "doctrine/lexer", @@ -1376,25 +1377,29 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { @@ -1419,7 +1424,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" }, "funding": [ { @@ -1427,7 +1432,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-03-03T13:19:32+00:00" }, { "name": "nikic/php-parser", @@ -1962,16 +1967,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + "reference": "77a32518733312af16a44300404e945338981de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", "shasum": "" }, "require": { @@ -2006,9 +2011,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" }, - "time": "2022-01-04T19:58:01+00:00" + "time": "2022-03-15T21:29:03+00:00" }, { "name": "phpspec/prophecy", @@ -2198,16 +2203,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.14", + "version": "9.2.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4" + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f4d60b6afe5546421462b76cd4e633ebc364ab4", - "reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", "shasum": "" }, "require": { @@ -2263,7 +2268,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" }, "funding": [ { @@ -2271,7 +2276,7 @@ "type": "github" } ], - "time": "2022-02-28T12:38:02+00:00" + "time": "2022-03-07T09:28:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2516,16 +2521,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.16", + "version": "9.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc" + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5ff8c545a50226c569310a35f4fa89d79f1ddfdc", - "reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", + "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", "shasum": "" }, "require": { @@ -2555,7 +2560,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", + "sebastian/type": "^3.0", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -2603,7 +2608,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.16" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" }, "funding": [ { @@ -2615,7 +2620,7 @@ "type": "github" } ], - "time": "2022-02-23T17:10:58+00:00" + "time": "2022-04-01T12:37:26+00:00" }, { "name": "psr/cache", @@ -3233,16 +3238,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", "shasum": "" }, "require": { @@ -3284,7 +3289,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" }, "funding": [ { @@ -3292,7 +3297,7 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2022-04-03T09:37:03+00:00" }, { "name": "sebastian/exporter", @@ -3724,28 +3729,28 @@ }, { "name": "sebastian/type", - "version": "2.3.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3768,7 +3773,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" }, "funding": [ { @@ -3776,7 +3781,7 @@ "type": "github" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2022-03-15T09:54:48+00:00" }, { "name": "sebastian/version", @@ -4487,7 +4492,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -4549,7 +4554,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { From 64e61d8dec7443b0584371e2927e77d058de84c4 Mon Sep 17 00:00:00 2001 From: oleibman <10341515+oleibman@users.noreply.github.com> Date: Sun, 10 Apr 2022 08:14:05 -0700 Subject: [PATCH 3/6] Prep Work for Phpstan Upgrade (#2728) Dependabot submitted PRs #2719 and #2720 to upgrade Phpstan. As with most Phpstan upgrades, there are new error messages; this PR is an attempt to fix all 58 of the new problems in order to allow the upgrade to proceed. Most of these fixes involve the addition of doc-block type annotations, often involving the assignment of the 'objectionable' portion of the statement to a new variable. Some use explicit casting when I am sure that's safe. Some (Reader/Ods) involve defeating result caching by Phpstan. --- phpstan-baseline.neon | 20 -------- .../Calculation/Engineering/BesselK.php | 21 ++++++-- .../Calculation/Engineering/BesselY.php | 19 ++++++- .../Calculation/Financial/Amortization.php | 16 +++--- .../Calculation/Financial/Coupons.php | 1 + .../Calculation/Statistical/Confidence.php | 4 +- .../Statistical/Distributions/Binomial.php | 16 ++++-- .../Statistical/Distributions/ChiSquared.php | 2 + .../Statistical/Distributions/LogNormal.php | 4 +- .../Statistical/Distributions/Poisson.php | 8 ++- .../Distributions/StandardNormal.php | 5 +- .../Calculation/Statistical/Size.php | 4 +- .../Cell/AdvancedValueBinder.php | 5 ++ src/PhpSpreadsheet/Reader/Ods.php | 49 +++++++++++++------ src/PhpSpreadsheet/Reader/Xlsx.php | 2 +- src/PhpSpreadsheet/Shared/Trend/Trend.php | 4 +- src/PhpSpreadsheet/Style/Color.php | 5 +- .../Style/NumberFormat/FractionFormatter.php | 5 +- src/PhpSpreadsheet/Writer/Xls/Worksheet.php | 26 ++++++---- 19 files changed, 143 insertions(+), 73 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9ecc0f01..9dc97da8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -340,11 +340,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\BesselK\\:\\:besselK2\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering/BesselK.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBase\\:\\:validatePlaces\\(\\) has parameter \\$places with no type specified\\.$#" count: 1 @@ -2070,11 +2065,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Ods.php - - - message: "#^If condition is always true\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Ods\\:\\:listWorksheetNames\\(\\) should return array\\ but returns array\\\\.$#" count: 1 @@ -2095,11 +2085,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Ods.php - - - message: "#^While loop condition is always true\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Ods.php - - message: "#^Cannot call method getElementsByTagNameNS\\(\\) on DOMElement\\|null\\.$#" count: 3 @@ -3880,11 +3865,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - - message: "#^Parameter \\#1 \\$order of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\PolynomialBestFit constructor expects int, string given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\XMLWriter\\:\\:getData\\(\\) should return string but returns string\\|false\\.$#" count: 1 diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php index 76b406e4..2d21e752 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php @@ -68,13 +68,28 @@ class BesselK return self::besselK2($x, $ord); } + /** + * Mollify Phpstan. + * + * @codeCoverageIgnore + */ + private static function callBesselI(float $x, int $ord): float + { + $rslt = BesselI::BESSELI($x, $ord); + if (!is_float($rslt)) { + throw new Exception('Unexpected array or string'); + } + + return $rslt; + } + private static function besselK0(float $x): float { if ($x <= 2) { $fNum2 = $x * 0.5; $y = ($fNum2 * $fNum2); - return -log($fNum2) * BesselI::BESSELI($x, 0) + + return -log($fNum2) * self::callBesselI($x, 0) + (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y * (0.10750e-3 + $y * 0.74e-5)))))); } @@ -92,7 +107,7 @@ class BesselK $fNum2 = $x * 0.5; $y = ($fNum2 * $fNum2); - return log($fNum2) * BesselI::BESSELI($x, 1) + + return log($fNum2) * self::callBesselI($x, 1) + (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y * (-0.110404e-2 + $y * (-0.4686e-4))))))) / $x; } @@ -104,7 +119,7 @@ class BesselK (0.325614e-2 + $y * (-0.68245e-3))))))); } - private static function besselK2(float $x, int $ord) + private static function besselK2(float $x, int $ord): float { $fTox = 2 / $x; $fBkm = self::besselK0($x); diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php index 794e946d..31d9694a 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php @@ -66,6 +66,21 @@ class BesselY return self::besselY2($x, $ord); } + /** + * Mollify Phpstan. + * + * @codeCoverageIgnore + */ + private static function callBesselJ(float $x, int $ord): float + { + $rslt = BesselJ::BESSELJ($x, $ord); + if (!is_float($rslt)) { + throw new Exception('Unexpected array or string'); + } + + return $rslt; + } + private static function besselY0(float $x): float { if ($x < 8.0) { @@ -75,7 +90,7 @@ class BesselY $ans2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y)))); - return $ans1 / $ans2 + 0.636619772 * BesselJ::BESSELJ($x, 0) * log($x); + return $ans1 / $ans2 + 0.636619772 * self::callBesselJ($x, 0) * log($x); } $z = 8.0 / $x; @@ -97,7 +112,7 @@ class BesselY $ans2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y * (0.1020426050e6 + $y * (0.3549632885e3 + $y))))); - return ($ans1 / $ans2) + 0.636619772 * (BesselJ::BESSELJ($x, 1) * log($x) - 1 / $x); + return ($ans1 / $ans2) + 0.636619772 * (self::callBesselJ($x, 1) * log($x) - 1 / $x); } $z = 8.0 / $x; diff --git a/src/PhpSpreadsheet/Calculation/Financial/Amortization.php b/src/PhpSpreadsheet/Calculation/Financial/Amortization.php index b16cc23f..691ba40c 100644 --- a/src/PhpSpreadsheet/Calculation/Financial/Amortization.php +++ b/src/PhpSpreadsheet/Calculation/Financial/Amortization.php @@ -70,10 +70,12 @@ class Amortization return $e->getMessage(); } - $yearFrac = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis); - if (is_string($yearFrac)) { - return $yearFrac; + $yearFracx = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis); + if (is_string($yearFracx)) { + return $yearFracx; } + /** @var float */ + $yearFrac = $yearFracx; $amortiseCoeff = self::getAmortizationCoefficient($rate); @@ -161,10 +163,12 @@ class Amortization $fCostDelta = $cost - $salvage; // Note, quirky variation for leap years on the YEARFRAC for this function $purchasedYear = DateTimeExcel\DateParts::year($purchased); - $yearFrac = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis); - if (is_string($yearFrac)) { - return $yearFrac; + $yearFracx = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis); + if (is_string($yearFracx)) { + return $yearFracx; } + /** @var float */ + $yearFrac = $yearFracx; if ( ($basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL) && diff --git a/src/PhpSpreadsheet/Calculation/Financial/Coupons.php b/src/PhpSpreadsheet/Calculation/Financial/Coupons.php index 237d6ee8..6138075c 100644 --- a/src/PhpSpreadsheet/Calculation/Financial/Coupons.php +++ b/src/PhpSpreadsheet/Calculation/Financial/Coupons.php @@ -199,6 +199,7 @@ class Coupons return $e->getMessage(); } + /** @var int */ $daysPerYear = Helpers::daysPerYear(DateTimeExcel\DateParts::year($settlement), $basis); $next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_NEXT); diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php b/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php index f2e65041..ec2ce34e 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php @@ -44,7 +44,9 @@ class Confidence if (($alpha <= 0) || ($alpha >= 1) || ($stdDev <= 0) || ($size < 1)) { return ExcelError::NAN(); } + /** @var float */ + $temp = Distributions\StandardNormal::inverse(1 - $alpha / 2); - return Functions::scalar(Distributions\StandardNormal::inverse(1 - $alpha / 2) * $stdDev / sqrt($size)); + return Functions::scalar($temp * $stdDev / sqrt($size)); } } diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php index c255a65c..02b53e88 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php @@ -56,8 +56,10 @@ class Binomial if ($cumulative) { return self::calculateCumulativeBinomial($value, $trials, $probability); } + /** @var float */ + $comb = Combinations::withoutRepetition($trials, $value); - return Combinations::withoutRepetition($trials, $value) * $probability ** $value + return $comb * $probability ** $value * (1 - $probability) ** ($trials - $value); } @@ -107,7 +109,9 @@ class Binomial $summer = 0; for ($i = $successes; $i <= $limit; ++$i) { - $summer += Combinations::withoutRepetition($trials, $i) * $probability ** $i + /** @var float */ + $comb = Combinations::withoutRepetition($trials, $i); + $summer += $comb * $probability ** $i * (1 - $probability) ** ($trials - $i); } @@ -159,8 +163,10 @@ class Binomial return ExcelError::NAN(); } } + /** @var float */ + $comb = Combinations::withoutRepetition($failures + $successes - 1, $successes - 1); - return (Combinations::withoutRepetition($failures + $successes - 1, $successes - 1)) + return $comb * ($probability ** $successes) * ((1 - $probability) ** $failures); } @@ -220,7 +226,9 @@ class Binomial { $summer = 0; for ($i = 0; $i <= $value; ++$i) { - $summer += Combinations::withoutRepetition($trials, $i) * $probability ** $i + /** @var float */ + $comb = Combinations::withoutRepetition($trials, $i); + $summer += $comb * $probability ** $i * (1 - $probability) ** ($trials - $i); } diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php index 11f083c9..8574d58d 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php @@ -281,6 +281,7 @@ class ChiSquared // Relative error controlled by the eps parameter private static function gser($n, $x) { + /** @var float */ $gln = Gamma::ln($n / 2); $a = 0.5 * $n; $ap = $a; @@ -304,6 +305,7 @@ class ChiSquared // Relative error controlled by the eps parameter private static function gcf($n, $x) { + /** @var float */ $gln = Gamma::ln($n / 2); $a = 0.5 * $n; $b = $x + 1 - $a; diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php index 4484f789..d572d234 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php @@ -131,7 +131,9 @@ class LogNormal if ($stdDev <= 0) { return ExcelError::NAN(); } + /** @var float */ + $inverse = StandardNormal::inverse($probability); - return exp($mean + $stdDev * StandardNormal::inverse($probability)); + return exp($mean + $stdDev * $inverse); } } diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php index 0ac38746..041c34a0 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php @@ -51,12 +51,16 @@ class Poisson $summer = 0; $floor = floor($value); for ($i = 0; $i <= $floor; ++$i) { - $summer += $mean ** $i / MathTrig\Factorial::fact($i); + /** @var float */ + $fact = MathTrig\Factorial::fact($i); + $summer += $mean ** $i / $fact; } return exp(0 - $mean) * $summer; } + /** @var float */ + $fact = MathTrig\Factorial::fact($value); - return (exp(0 - $mean) * $mean ** $value) / MathTrig\Factorial::fact($value); + return (exp(0 - $mean) * $mean ** $value) / $fact; } } diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php index 8239dac8..a655fa74 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php @@ -103,8 +103,10 @@ class StandardNormal if (!is_numeric($value)) { return ExcelError::VALUE(); } + /** @var float */ + $dist = self::distribution($value, true); - return self::distribution($value, true) - 0.5; + return $dist - 0.5; } /** @@ -139,6 +141,7 @@ class StandardNormal } if ($sigma === null) { + /** @var float */ $sigma = StandardDeviations::STDEV($dataSet); } $n = count($dataSet); diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Size.php b/src/PhpSpreadsheet/Calculation/Statistical/Size.php index dbffed5d..2eef5fc7 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Size.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Size.php @@ -31,7 +31,7 @@ class Size $mArgs = self::filter($aArgs); $count = Counts::COUNT($mArgs); --$entry; - if (($entry < 0) || ($entry >= $count) || ($count == 0)) { + if ($count === 0 || $entry < 0 || $entry >= $count) { return ExcelError::NAN(); } rsort($mArgs); @@ -67,7 +67,7 @@ class Size $mArgs = self::filter($aArgs); $count = Counts::COUNT($mArgs); --$entry; - if (($entry < 0) || ($entry >= $count) || ($count == 0)) { + if ($count === 0 || $entry < 0 || $entry >= $count) { return ExcelError::NAN(); } sort($mArgs); diff --git a/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php b/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php index 025a687b..49631f76 100644 --- a/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php +++ b/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php @@ -179,6 +179,8 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder { // Convert value to number [$hours, $minutes] = explode(':', $value); + $hours = (int) $hours; + $minutes = (int) $minutes; $days = ($hours / 24) + ($minutes / 1440); $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); @@ -193,6 +195,9 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder { // Convert value to number [$hours, $minutes, $seconds] = explode(':', $value); + $hours = (int) $hours; + $minutes = (int) $minutes; + $seconds = (int) $seconds; $days = ($hours / 24) + ($minutes / 1440) + ($seconds / 86400); $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); diff --git a/src/PhpSpreadsheet/Reader/Ods.php b/src/PhpSpreadsheet/Reader/Ods.php index 791c0780..f65cf36f 100644 --- a/src/PhpSpreadsheet/Reader/Ods.php +++ b/src/PhpSpreadsheet/Reader/Ods.php @@ -105,7 +105,7 @@ class Ods extends BaseReader $xml->read(); while ($xml->read()) { // Quickly jump through to the office:body node - while ($xml->name !== 'office:body') { + while (self::getXmlName($xml) !== 'office:body') { if ($xml->isEmptyElement) { $xml->read(); } else { @@ -114,12 +114,13 @@ class Ods extends BaseReader } // Now read each node until we find our first table:table node while ($xml->read()) { - if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { + $xmlName = self::getXmlName($xml); + if ($xmlName == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { // Loop through each table:table node reading the table:name attribute for each worksheet name do { $worksheetNames[] = $xml->getAttribute('table:name'); $xml->next(); - } while ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT); + } while (self::getXmlName($xml) == 'table:table' && $xml->nodeType == XMLReader::ELEMENT); } } } @@ -152,7 +153,7 @@ class Ods extends BaseReader $xml->read(); while ($xml->read()) { // Quickly jump through to the office:body node - while ($xml->name !== 'office:body') { + while (self::getXmlName($xml) !== 'office:body') { if ($xml->isEmptyElement) { $xml->read(); } else { @@ -161,7 +162,7 @@ class Ods extends BaseReader } // Now read each node until we find our first table:table node while ($xml->read()) { - if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { + if (self::getXmlName($xml) == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) { $worksheetNames[] = $xml->getAttribute('table:name'); $tmpInfo = [ @@ -176,7 +177,7 @@ class Ods extends BaseReader $currCells = 0; do { $xml->read(); - if ($xml->name == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) { + if (self::getXmlName($xml) == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) { $rowspan = $xml->getAttribute('table:number-rows-repeated'); $rowspan = empty($rowspan) ? 1 : $rowspan; $tmpInfo['totalRows'] += $rowspan; @@ -186,22 +187,22 @@ class Ods extends BaseReader $xml->read(); do { $doread = true; - if ($xml->name == 'table:table-cell' && $xml->nodeType == XMLReader::ELEMENT) { + if (self::getXmlName($xml) == 'table:table-cell' && $xml->nodeType == XMLReader::ELEMENT) { if (!$xml->isEmptyElement) { ++$currCells; $xml->next(); $doread = false; } - } elseif ($xml->name == 'table:covered-table-cell' && $xml->nodeType == XMLReader::ELEMENT) { + } elseif (self::getXmlName($xml) == 'table:covered-table-cell' && $xml->nodeType == XMLReader::ELEMENT) { $mergeSize = $xml->getAttribute('table:number-columns-repeated'); $currCells += (int) $mergeSize; } if ($doread) { $xml->read(); } - } while ($xml->name != 'table:table-row'); + } while (self::getXmlName($xml) != 'table:table-row'); } - } while ($xml->name != 'table:table'); + } while (self::getXmlName($xml) != 'table:table'); $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; @@ -214,6 +215,16 @@ class Ods extends BaseReader return $worksheetInfo; } + /** + * Counteract Phpstan caching. + * + * @phpstan-impure + */ + private static function getXmlName(XMLReader $xml): string + { + return $xml->name; + } + /** * Loads PhpSpreadsheet from file. */ @@ -681,12 +692,7 @@ class Ods extends BaseReader // Multiple spaces? /** @var DOMAttr $cAttr */ $cAttr = $child->attributes->getNamedItem('c'); - if ($cAttr) { - $multiplier = (int) $cAttr->nodeValue; - } else { - $multiplier = 1; - } - + $multiplier = self::getMultiplier($cAttr); $str .= str_repeat(' ', $multiplier); } @@ -698,6 +704,17 @@ class Ods extends BaseReader return $str; } + private static function getMultiplier(?DOMAttr $cAttr): int + { + if ($cAttr) { + $multiplier = (int) $cAttr->nodeValue; + } else { + $multiplier = 1; + } + + return $multiplier; + } + /** * @param string $is * diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 992002bb..18ed7987 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -894,7 +894,7 @@ class Xlsx extends BaseReader } foreach ($xmlSheet->extLst->ext->children('x14', true)->dataValidations->dataValidation as $item) { - $node = $xmlSheet->dataValidations->addChild('dataValidation'); + $node = self::testSimpleXml($xmlSheet->dataValidations)->addChild('dataValidation'); foreach ($item->attributes() ?? [] as $attr) { $node->addAttribute($attr->getName(), $attr); } diff --git a/src/PhpSpreadsheet/Shared/Trend/Trend.php b/src/PhpSpreadsheet/Shared/Trend/Trend.php index 1162284b..929f59b9 100644 --- a/src/PhpSpreadsheet/Shared/Trend/Trend.php +++ b/src/PhpSpreadsheet/Shared/Trend/Trend.php @@ -83,7 +83,7 @@ class Trend case self::TREND_POLYNOMIAL_5: case self::TREND_POLYNOMIAL_6: if (!isset(self::$trendCache[$key])) { - $order = substr($trendType, -1); + $order = (int) substr($trendType, -1); self::$trendCache[$key] = new PolynomialBestFit($order, $yValues, $xValues); } @@ -101,7 +101,7 @@ class Trend } if ($trendType != self::TREND_BEST_FIT_NO_POLY) { foreach (self::$trendTypePolynomialOrders as $trendMethod) { - $order = substr($trendMethod, -1); + $order = (int) substr($trendMethod, -1); $bestFit[$trendMethod] = new PolynomialBestFit($order, $yValues, $xValues); if ($bestFit[$trendMethod]->getError()) { unset($bestFit[$trendMethod]); diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index 802869a1..9ab0c98f 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -293,7 +293,10 @@ class Color extends Supervisor */ private static function getColourComponent($rgbValue, $offset, $hex = true) { - $colour = substr($rgbValue, $offset, 2); + $colour = substr($rgbValue, $offset, 2) ?: ''; + if (preg_match('/^[0-9a-f]{2}$/i', $colour) !== 1) { + $colour = '00'; + } return ($hex) ? $colour : (int) hexdec($colour); } diff --git a/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php b/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php index 46f27cc3..d1fc89fd 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php +++ b/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php @@ -26,9 +26,12 @@ class FractionFormatter extends BaseFormatter $decimalLength = strlen($decimalPart); $decimalDivisor = 10 ** $decimalLength; + /** @var float */ $GCD = MathTrig\Gcd::evaluate($decimalPart, $decimalDivisor); + /** @var float */ + $decimalPartx = $decimalPart; - $adjustedDecimalPart = $decimalPart / $GCD; + $adjustedDecimalPart = $decimalPartx / $GCD; $adjustedDecimalDivisor = $decimalDivisor / $GCD; if ((strpos($format, '0') !== false)) { diff --git a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index 16059e28..796c2142 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -54,6 +54,12 @@ use PhpOffice\PhpSpreadsheet\Writer\Exception as WriterException; // */ class Worksheet extends BIFFwriter { + /** @var int */ + private static $always0 = 0; + + /** @var int */ + private static $always1 = 1; + /** * Formula parser. * @@ -2923,11 +2929,11 @@ class Worksheet extends BIFFwriter $flags |= (1 == $bAlignWrapTx ? 0x00000004 : 0); $flags |= (1 == $bTxRotation ? 0x00000008 : 0); // Justify last line flag - $flags |= (1 == 1 ? 0x00000010 : 0); + $flags |= (1 == self::$always1 ? 0x00000010 : 0); $flags |= (1 == $bIndent ? 0x00000020 : 0); $flags |= (1 == $bShrinkToFit ? 0x00000040 : 0); // Default - $flags |= (1 == 1 ? 0x00000080 : 0); + $flags |= (1 == self::$always1 ? 0x00000080 : 0); // Protection $flags |= (1 == $bProtLocked ? 0x00000100 : 0); $flags |= (1 == $bProtHidden ? 0x00000200 : 0); @@ -2936,13 +2942,13 @@ class Worksheet extends BIFFwriter $flags |= (1 == $bBorderRight ? 0x00000800 : 0); $flags |= (1 == $bBorderTop ? 0x00001000 : 0); $flags |= (1 == $bBorderBottom ? 0x00002000 : 0); - $flags |= (1 == 1 ? 0x00004000 : 0); // Top left to Bottom right border - $flags |= (1 == 1 ? 0x00008000 : 0); // Bottom left to Top right border + $flags |= (1 == self::$always1 ? 0x00004000 : 0); // Top left to Bottom right border + $flags |= (1 == self::$always1 ? 0x00008000 : 0); // Bottom left to Top right border // Pattern $flags |= (1 == $bFillStyle ? 0x00010000 : 0); $flags |= (1 == $bFillColor ? 0x00020000 : 0); $flags |= (1 == $bFillColorBg ? 0x00040000 : 0); - $flags |= (1 == 1 ? 0x00380000 : 0); + $flags |= (1 == self::$always1 ? 0x00380000 : 0); // Font $flags |= (1 == $bFormatFont ? 0x04000000 : 0); // Alignment: @@ -2954,7 +2960,7 @@ class Worksheet extends BIFFwriter // Protection $flags |= (1 == $bFormatProt ? 0x40000000 : 0); // Text direction - $flags |= (1 == 0 ? 0x80000000 : 0); + $flags |= (1 == self::$always0 ? 0x80000000 : 0); $dataBlockFont = null; $dataBlockAlign = null; @@ -3040,10 +3046,10 @@ class Worksheet extends BIFFwriter $optionsFlags = 0; $optionsFlagsBold = ($conditional->getStyle()->getFont()->getBold() === null ? 1 : 0); $optionsFlags |= (1 == $optionsFlagsBold ? 0x00000002 : 0); - $optionsFlags |= (1 == 1 ? 0x00000008 : 0); - $optionsFlags |= (1 == 1 ? 0x00000010 : 0); - $optionsFlags |= (1 == 0 ? 0x00000020 : 0); - $optionsFlags |= (1 == 1 ? 0x00000080 : 0); + $optionsFlags |= (1 == self::$always1 ? 0x00000008 : 0); + $optionsFlags |= (1 == self::$always1 ? 0x00000010 : 0); + $optionsFlags |= (1 == self::$always0 ? 0x00000020 : 0); + $optionsFlags |= (1 == self::$always1 ? 0x00000080 : 0); $dataBlockFont .= pack('V', $optionsFlags); // Escapement type $dataBlockFont .= pack('V', $fontEscapement); From b03788c902728ae1ade2c41ea4219f1bfb0e4522 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 08:25:24 -0700 Subject: [PATCH 4/6] Bump phpstan/phpstan from 1.4.6 to 1.5.3 (#2719) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.4.6 to 1.5.3. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.4.6...1.5.3) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com> --- composer.lock | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 585faf30..5acf1ffb 100644 --- a/composer.lock +++ b/composer.lock @@ -2084,20 +2084,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.4.6", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe" + "reference": "39953ac1452a8843702ee41a35b4861d3e8207a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8a7761f1c520e0dad6e04d862fdc697445457cfe", - "reference": "8a7761f1c520e0dad6e04d862fdc697445457cfe", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/39953ac1452a8843702ee41a35b4861d3e8207a7", + "reference": "39953ac1452a8843702ee41a35b4861d3e8207a7", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -2107,11 +2107,6 @@ "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -2124,7 +2119,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.4.6" + "source": "https://github.com/phpstan/phpstan/tree/1.5.3" }, "funding": [ { @@ -2144,7 +2139,7 @@ "type": "tidelift" } ], - "time": "2022-02-06T12:56:13+00:00" + "time": "2022-03-30T21:55:08+00:00" }, { "name": "phpstan/phpstan-phpunit", From 2370a88c9605505c83d0c8b9f5c2df70c0a3962b Mon Sep 17 00:00:00 2001 From: oleibman <10341515+oleibman@users.noreply.github.com> Date: Sun, 10 Apr 2022 17:31:53 -0700 Subject: [PATCH 5/6] Trivial Change to Unblock Phpstan Update (#2737) I cannot duplicate the problem blocking #2720, but this trivial change should work anyhow. --- src/PhpSpreadsheet/Reader/Ods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Reader/Ods.php b/src/PhpSpreadsheet/Reader/Ods.php index f65cf36f..fcafc047 100644 --- a/src/PhpSpreadsheet/Reader/Ods.php +++ b/src/PhpSpreadsheet/Reader/Ods.php @@ -655,7 +655,7 @@ class Ods extends BaseReader $setRow = $configItem->nodeValue; } } - $this->setSelected($spreadsheet, $wsname, $setCol, $setRow); + $this->setSelected($spreadsheet, $wsname, "$setCol", "$setRow"); } break; From c6858885c0579e627e465039009efc068769a402 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 18:03:04 -0700 Subject: [PATCH 6/6] Bump phpstan/phpstan-phpunit from 1.0.0 to 1.1.0 (#2720) Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/phpstan/phpstan-phpunit/releases) - [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.0.0...1.1.0) --- updated-dependencies: - dependency-name: phpstan/phpstan-phpunit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: oleibman <10341515+oleibman@users.noreply.github.com> --- composer.lock | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index 5acf1ffb..37bab549 100644 --- a/composer.lock +++ b/composer.lock @@ -2084,16 +2084,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.5.3", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "39953ac1452a8843702ee41a35b4861d3e8207a7" + "reference": "bbf68cae24f6dc023c607ea0f87da55dd9d55c2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/39953ac1452a8843702ee41a35b4861d3e8207a7", - "reference": "39953ac1452a8843702ee41a35b4861d3e8207a7", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bbf68cae24f6dc023c607ea0f87da55dd9d55c2b", + "reference": "bbf68cae24f6dc023c607ea0f87da55dd9d55c2b", "shasum": "" }, "require": { @@ -2119,7 +2119,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.5.3" + "source": "https://github.com/phpstan/phpstan/tree/1.5.4" }, "funding": [ { @@ -2139,25 +2139,25 @@ "type": "tidelift" } ], - "time": "2022-03-30T21:55:08+00:00" + "time": "2022-04-03T12:39:00+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3" + "reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", - "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/09133ce914f1388a8bb8c7f8573aaa3723cff52a", + "reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0" + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.5.0" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -2170,9 +2170,6 @@ }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, "phpstan": { "includes": [ "extension.neon", @@ -2192,9 +2189,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.0.0" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.0" }, - "time": "2021-10-14T08:03:54+00:00" + "time": "2022-03-28T09:20:49+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5471,5 +5468,5 @@ "ext-zlib": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" }