diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 4ebd53fca..dc15c4871 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir); return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 9edf7e966..b5c204828 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -9,7 +9,7 @@ return array( 'think\\view\\driver\\' => array($vendorDir . '/topthink/think-view/src'), 'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'), 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), - 'think\\' => array($vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/framework/src/think'), + 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'), 'app\\' => array($baseDir . '/app'), 'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 9170ac6ba..53870b17f 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -81,10 +81,10 @@ class ComposerStaticInit1ed187777399b73a018d9a6af63a57d1 ), 'think\\' => array ( - 0 => __DIR__ . '/..' . '/topthink/think-helper/src', - 1 => __DIR__ . '/..' . '/topthink/think-template/src', + 0 => __DIR__ . '/..' . '/topthink/framework/src/think', + 1 => __DIR__ . '/..' . '/topthink/think-helper/src', 2 => __DIR__ . '/..' . '/topthink/think-orm/src', - 3 => __DIR__ . '/..' . '/topthink/framework/src/think', + 3 => __DIR__ . '/..' . '/topthink/think-template/src', ), 'app\\' => array ( @@ -182,6 +182,7 @@ class ComposerStaticInit1ed187777399b73a018d9a6af63a57d1 public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6a2cbb377..7a87c02b4 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -558,17 +558,17 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.21.0", - "version_normalized": "1.21.0.0", + "version": "1.22.0", + "version_normalized": "1.22.0.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "1a359d2ccbb89c05f5dffb32711a95f4afc67964" + "reference": "3a9e29b4f386a08a151a33578e80ef1747037a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/1a359d2ccbb89c05f5dffb32711a95f4afc67964", - "reference": "1a359d2ccbb89c05f5dffb32711a95f4afc67964", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3a9e29b4f386a08a151a33578e80ef1747037a48", + "reference": "3a9e29b4f386a08a151a33578e80ef1747037a48", "shasum": "", "mirrors": [ { @@ -605,7 +605,7 @@ "dompdf/dompdf": "^1.0", "friendsofphp/php-cs-fixer": "^3.2", "jpgraph/jpgraph": "^4.0", - "mpdf/mpdf": "^8.0", + "mpdf/mpdf": "8.0.17", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.1", "phpstan/phpstan-phpunit": "^1.0", @@ -619,7 +619,7 @@ "mpdf/mpdf": "Option for rendering PDF with PDF Writer", "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)" }, - "time": "2022-01-06T11:10:08+00:00", + "time": "2022-02-18T12:57:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -665,7 +665,7 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.21.0" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.22.0" }, "install-path": "../phpoffice/phpspreadsheet" }, @@ -1074,8 +1074,8 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -1115,12 +1115,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1146,7 +1146,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -1166,8 +1166,8 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -1201,12 +1201,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1231,7 +1231,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" }, "funding": [ { @@ -1251,17 +1251,17 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.24.0", - "version_normalized": "1.24.0.0", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "", "mirrors": [ { @@ -1273,7 +1273,7 @@ "require": { "php": ">=7.1" }, - "time": "2021-09-13T13:58:33+00:00", + "time": "2022-03-04T08:16:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -1286,12 +1286,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1323,7 +1323,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -1343,17 +1343,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.36", - "version_normalized": "4.4.36.0", + "version": "v4.4.39", + "version_normalized": "4.4.39.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "02685c62fcbc4262235cc72a54fbd45ab719ce3c" + "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/02685c62fcbc4262235cc72a54fbd45ab719ce3c", - "reference": "02685c62fcbc4262235cc72a54fbd45ab719ce3c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/35237c5e5dcb6593a46a860ba5b29c1d4683d80e", + "reference": "35237c5e5dcb6593a46a860ba5b29c1d4683d80e", "shasum": "", "mirrors": [ { @@ -1383,7 +1383,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-12-29T09:28:53+00:00", + "time": "2022-02-25T10:38:15+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -1421,7 +1421,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.36" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.39" }, "funding": [ { @@ -1623,17 +1623,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.51", - "version_normalized": "2.0.51.0", + "version": "v2.0.52", + "version_normalized": "2.0.52.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "149d266acdc4b2f07c6a94f1733b6b97d340e0e2" + "reference": "407a60658f37fc57422ab95a9922c6f69af90f46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/149d266acdc4b2f07c6a94f1733b6b97d340e0e2", - "reference": "149d266acdc4b2f07c6a94f1733b6b97d340e0e2", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/407a60658f37fc57422ab95a9922c6f69af90f46", + "reference": "407a60658f37fc57422ab95a9922c6f69af90f46", "shasum": "", "mirrors": [ { @@ -1653,16 +1653,16 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2022-01-21T06:25:25+00:00", + "time": "2022-01-25T06:00:05+00:00", "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "think\\": "src" - }, "files": [ "stubs/load_stubs.php" - ] + ], + "psr-4": { + "think\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1681,7 +1681,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.51" + "source": "https://github.com/top-think/think-orm/tree/v2.0.52" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 76ed4be63..ac3ff25c9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '921d28f9ce7fcc47b9b8312f92080643eddfe75a', + 'reference' => 'c75c0b6802d97c28dd0256593f3df9c71a6b5a5f', 'name' => 'shopxo/shopxo', 'dev' => true, ), @@ -83,12 +83,12 @@ 'dev_requirement' => false, ), 'phpoffice/phpspreadsheet' => array( - 'pretty_version' => '1.21.0', - 'version' => '1.21.0.0', + 'pretty_version' => '1.22.0', + 'version' => '1.22.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet', 'aliases' => array(), - 'reference' => '1a359d2ccbb89c05f5dffb32711a95f4afc67964', + 'reference' => '3a9e29b4f386a08a151a33578e80ef1747037a48', 'dev_requirement' => false, ), 'psr/cache' => array( @@ -160,12 +160,12 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '921d28f9ce7fcc47b9b8312f92080643eddfe75a', + 'reference' => 'c75c0b6802d97c28dd0256593f3df9c71a6b5a5f', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), @@ -173,8 +173,8 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), @@ -182,21 +182,21 @@ 'dev_requirement' => true, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.24.0', - 'version' => '1.24.0.0', + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9', + 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', 'dev_requirement' => true, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v4.4.36', - 'version' => '4.4.36.0', + 'pretty_version' => 'v4.4.39', + 'version' => '4.4.39.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => '02685c62fcbc4262235cc72a54fbd45ab719ce3c', + 'reference' => '35237c5e5dcb6593a46a860ba5b29c1d4683d80e', 'dev_requirement' => true, ), 'topthink/framework' => array( @@ -227,12 +227,12 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.51', - 'version' => '2.0.51.0', + 'pretty_version' => 'v2.0.52', + 'version' => '2.0.52.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => '149d266acdc4b2f07c6a94f1733b6b97d340e0e2', + 'reference' => '407a60658f37fc57422ab95a9922c6f69af90f46', 'dev_requirement' => false, ), 'topthink/think-template' => array( diff --git a/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php b/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php index c0e8f9d53..a393043d7 100644 --- a/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php +++ b/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php @@ -55,7 +55,7 @@ $config 'function_declaration' => true, 'function_to_constant' => true, 'function_typehint_space' => true, - 'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright', 'method', 'throws']], + 'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright', 'throws']], 'global_namespace_import' => true, 'header_comment' => false, // We don't use common header in all our files 'heredoc_indentation' => false, // Requires PHP >= 7.3 diff --git a/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/vendor/phpoffice/phpspreadsheet/CHANGELOG.md index 3bfc215a0..82db8d92e 100644 --- a/vendor/phpoffice/phpspreadsheet/CHANGELOG.md +++ b/vendor/phpoffice/phpspreadsheet/CHANGELOG.md @@ -5,6 +5,96 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). +## 1.22.0 - 2022-02-18 + +### Added + +- Namespacing phase 2 - styles. +[PR #2471](https://github.com/PHPOffice/PhpSpreadsheet/pull/2471) + +- Improved support for passing of array arguments to Excel function implementations to return array results (where appropriate). [Issue #2551](https://github.com/PHPOffice/PhpSpreadsheet/issues/2551) + + This is the first stage in an ongoing process of adding array support to all appropriate function implementations, +- Support for the Excel365 Math/Trig SEQUENCE() function [PR #2536](https://github.com/PHPOffice/PhpSpreadsheet/pull/2536) +- Support for the Excel365 Math/Trig RANDARRAY() function [PR #2540](https://github.com/PHPOffice/PhpSpreadsheet/pull/2540) + + Note that the Spill Operator is not yet supported in the Calculation Engine; but this can still be useful for defining array constants. +- Improved support for Conditional Formatting Rules [PR #2491](https://github.com/PHPOffice/PhpSpreadsheet/pull/2491) + - Provide support for a wider range of Conditional Formatting Rules for Xlsx Reader/Writer: + - Cells Containing (cellIs) + - Specific Text (containing, notContaining, beginsWith, endsWith) + - Dates Occurring (all supported timePeriods) + - Blanks/NoBlanks + - Errors/NoErrors + - Duplicates/Unique + - Expression + - Provision of CF Wizards (for all the above listed rule types) to help create/modify CF Rules without having to manage all the combinations of types/operators, and the complexities of formula expressions, or the text/timePeriod attributes. + + See [documentation](https://phpspreadsheet.readthedocs.io/en/latest/topics/conditional-formatting/) for details + + - Full support of the above CF Rules for the Xlsx Reader and Writer; even when the file being loaded has CF rules listed in the `` element for the worksheet rather than the `` element. + - Provision of a CellMatcher to identify if rules are matched for a cell, and which matching style will be applied. + - Improved documentation and examples, covering all supported CF rule types. +- Add support for one digit decimals (FORMAT_NUMBER_0, FORMAT_PERCENTAGE_0). [PR #2525](https://github.com/PHPOffice/PhpSpreadsheet/pull/2525) +- Initial work enabling Excel function implementations for handling arrays as arguments when used in "array formulae" [#2562](https://github.com/PHPOffice/PhpSpreadsheet/issues/2562) +- Enable most of the Date/Time functions to accept array arguments [#2573](https://github.com/PHPOffice/PhpSpreadsheet/issues/2573) +- Array ready functions - Text, Math/Trig, Statistical, Engineering and Logical [#2580](https://github.com/PHPOffice/PhpSpreadsheet/issues/2580) + +### Changed + +- Additional Russian translations for Excel Functions (courtesy of aleks-samurai). +- Improved code coverage for NumberFormat. [PR #2556](https://github.com/PHPOffice/PhpSpreadsheet/pull/2556) +- Extract some methods from the Calculation Engine into dedicated classes [#2537](https://github.com/PHPOffice/PhpSpreadsheet/issues/2537) +- Eliminate calls to `flattenSingleValue()` that are no longer required when we're checking for array values as arguments [#2590](https://github.com/PHPOffice/PhpSpreadsheet/issues/2590) + +### Deprecated + +- Nothing + +### Removed + +- Nothing + +### Fixed + +- Fixed `ReferenceHelper@insertNewBefore` behavior when removing column before last column with null value +[PR #2541](https://github.com/PHPOffice/PhpSpreadsheet/pull/2541) +- Fix bug with `DOLLARDE()` and `DOLLARFR()` functions when the dollar value is negative [Issue #2578](https://github.com/PHPOffice/PhpSpreadsheet/issues/2578) [PR #2579](https://github.com/PHPOffice/PhpSpreadsheet/pull/2579) +- Fix partial function name matching when translating formulae from Russian to English [Issue #2533](https://github.com/PHPOffice/PhpSpreadsheet/issues/2533) [PR #2534](https://github.com/PHPOffice/PhpSpreadsheet/pull/2534) +- Various bugs related to Conditional Formatting Rules, and errors in the Xlsx Writer for Conditional Formatting [PR #2491](https://github.com/PHPOffice/PhpSpreadsheet/pull/2491) +- Xlsx Reader merge range fixes. +[Issue #2501](https://github.com/PHPOffice/PhpSpreadsheet/issues/2501) +[PR #2504](https://github.com/PHPOffice/PhpSpreadsheet/pull/2504) +- Handle explicit "date" type for Cell in Xlsx Reader. +[Issue #2373](https://github.com/PHPOffice/PhpSpreadsheet/issues/2373) +[PR #2485](https://github.com/PHPOffice/PhpSpreadsheet/pull/2485) +- Recalibrate Row/Column Dimensions after removeRow/Column. +[Issue #2442](https://github.com/PHPOffice/PhpSpreadsheet/issues/2442) +[PR #2486](https://github.com/PHPOffice/PhpSpreadsheet/pull/2486) +- Refinement for XIRR. +[Issue #2469](https://github.com/PHPOffice/PhpSpreadsheet/issues/2469) +[PR #2487](https://github.com/PHPOffice/PhpSpreadsheet/pull/2487) +- Xlsx Reader handle cell with non-null explicit type but null value. +[Issue #2488](https://github.com/PHPOffice/PhpSpreadsheet/issues/2488) +[PR #2489](https://github.com/PHPOffice/PhpSpreadsheet/pull/2489) +- Xlsx Reader fix height and width for oneCellAnchorDrawings. +[PR #2492](https://github.com/PHPOffice/PhpSpreadsheet/pull/2492) +- Fix rounding error in NumberFormat::NUMBER_PERCENTAGE, NumberFormat::NUMBER_PERCENTAGE_00. [PR #2555](https://github.com/PHPOffice/PhpSpreadsheet/pull/2555) +- Don't treat thumbnail file as xml. +[Issue #2516](https://github.com/PHPOffice/PhpSpreadsheet/issues/2516) +[PR #2517](https://github.com/PHPOffice/PhpSpreadsheet/pull/2517) +- Eliminating Xlsx Reader warning when no sz tag for RichText. +[Issue #2542](https://github.com/PHPOffice/PhpSpreadsheet/issues/2542) +[PR #2550](https://github.com/PHPOffice/PhpSpreadsheet/pull/2550) +- Fix Xlsx/Xls Writer handling of inline strings. +[Issue #353](https://github.com/PHPOffice/PhpSpreadsheet/issues/353) +[PR #2569](https://github.com/PHPOffice/PhpSpreadsheet/pull/2569) +- Richtext colors were not being read correctly after namespace change [#2458](https://github.com/PHPOffice/PhpSpreadsheet/issues/2458) +- Fix discrepancy between the way markdown tables are rendered in ReadTheDocs and in PHPStorm [#2520](https://github.com/PHPOffice/PhpSpreadsheet/issues/2520) +- Update Russian Functions Text File [#2557](https://github.com/PHPOffice/PhpSpreadsheet/issues/2557) +- Fix documentation, instantiation example [#2564](https://github.com/PHPOffice/PhpSpreadsheet/issues/2564) + + ## 1.21.0 - 2022-01-06 ### Added diff --git a/vendor/phpoffice/phpspreadsheet/composer.json b/vendor/phpoffice/phpspreadsheet/composer.json index d80fc62ff..c0664de39 100644 --- a/vendor/phpoffice/phpspreadsheet/composer.json +++ b/vendor/phpoffice/phpspreadsheet/composer.json @@ -12,7 +12,10 @@ "spreadsheet" ], "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", "type": "library", @@ -79,7 +82,7 @@ "dompdf/dompdf": "^1.0", "friendsofphp/php-cs-fixer": "^3.2", "jpgraph/jpgraph": "^4.0", - "mpdf/mpdf": "^8.0", + "mpdf/mpdf": "8.0.17", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.1", "phpstan/phpstan-phpunit": "^1.0", diff --git a/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon b/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon index db35c729d..acafd3b1c 100644 --- a/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon +++ b/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon @@ -5,51 +5,6 @@ parameters: count: 3 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'onlyIf' on mixed\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'onlyIfNot' on mixed\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'reference' on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'storeKey' on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'type' on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 'value' on mixed\\.$#" - count: 16 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Cannot access offset int on mixed\\.$#" - count: 16 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Cannot call method attach\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell\\|null\\.$#" count: 1 @@ -100,11 +55,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 6 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:_translateFormulaToEnglish\\(\\) has no return type specified\\.$#" count: 1 @@ -175,26 +125,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Parameter \\#1 \\$cellRange of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:extractAllCellReferencesInRange\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$column of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:getHighestDataRow\\(\\) expects string\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$definedName of static method PhpOffice\\\\PhpSpreadsheet\\\\DefinedName\\:\\:resolveName\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:_calculateFormulaValue\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Parameter \\#1 \\$haystack of function stripos expects string, float\\|int\\|string given\\.$#" count: 1 @@ -211,65 +141,20 @@ parameters: path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Parameter \\#1 \\$str(ing)? of function preg_quote expects string, int\\|string given\\.$#" + message: "#^Parameter \\#1 \\$str of function preg_quote expects string, int\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Parameter \\#1 \\$str(ing)? of function strtoupper expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, int\\|string given\\.$#" + message: "#^Parameter \\#1 \\$str of function trim expects string, int\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, null given\\.$#" + message: "#^Parameter \\#1 \\$str of function trim expects string, null given\\.$#" count: 2 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Parameter \\#1 \\$str1 of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:strcmpAllowNull\\(\\) expects string\\|null, mixed given\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$str1 of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:strcmpLowercaseFirst\\(\\) expects string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$string of function strlen expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$textValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:strCaseReverse\\(\\) expects string, string\\|null given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#1 \\$worksheetName of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getSheetByName\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#2 \\$str2 of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:strcmpAllowNull\\(\\) expects string\\|null, mixed given\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Parameter \\#2 \\$worksheet of static method PhpOffice\\\\PhpSpreadsheet\\\\DefinedName\\:\\:resolveName\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet, PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\|null given\\.$#" count: 1 @@ -280,46 +165,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#4 \\$operation of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:executeBinaryComparisonOperation\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#4 \\$storeKey of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:push\\(\\) expects string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#5 \\$onlyIf of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:push\\(\\) expects string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Parameter \\#6 \\$onlyIfNot of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:push\\(\\) expects string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Part \\$argumentCount \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Part \\$token \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Part \\$val \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$branchPruningEnabled has no type specified\\.$#" count: 1 @@ -405,16 +250,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Calculation/Calculation.php - - - message: "#^Variable \\$inversedStr1 on left side of \\?\\? always exists and is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - - - message: "#^Variable \\$inversedStr2 on left side of \\?\\? always exists and is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Calculation.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMAX\\(\\) should return float but returns float\\|string\\|null\\.$#" count: 1 @@ -460,11 +295,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Database.php - - - message: "#^Cannot access offset int\\|string\\|null on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\\\DatabaseAbstract\\:\\:buildCondition\\(\\) has parameter \\$criterion with no type specified\\.$#" count: 1 @@ -495,236 +325,21 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, 'strtoupper' given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#1 \\$criteriaNames of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\\\DatabaseAbstract\\:\\:buildQuery\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#1 \\$(input|array) of function array_keys expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function strtoupper expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\\\DatabaseAbstract\\:\\:executeQuery\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Parameter \\#4 \\$fields of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\\\DatabaseAbstract\\:\\:executeQuery\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php - - - - message: "#^Parameter \\#1 \\$day of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:dayStringToNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php - - - - message: "#^Parameter \\#1 \\$monthName of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:monthStringToNumber\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php - - message: "#^Variable \\$dateValue on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function strtoupper expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php - - - - message: "#^Parameter \\#1 \\$excelTimestamp of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:excelToDateTimeObject\\(\\) expects float\\|int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php - - - - message: "#^Parameter \\#1 \\$(x|num1) of function fmod expects float, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php - - message: "#^Variable \\$timeValue on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php - - - message: "#^Binary operation \"/\" between int\\|string and \\(float\\|int\\) results in an error\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php - - - - message: "#^Binary operation \"/\" between int\\|string and 360 results in an error\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php - - - - message: "#^Binary operation \"/\" between int\\|string and 365 results in an error\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engine\\\\Logger\\:\\:writeDebugLog\\(\\) has parameter \\$args with no type specified\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Engine/Logger.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:BITLSHIFT\\(\\) should return int\\|string but returns float\\|int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:BITRSHIFT\\(\\) should return int\\|string but returns float\\|int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$category of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertUOM\\:\\:getConversionCategoryUnitDetails\\(\\) expects string\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$category of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertUOM\\:\\:getConversionCategoryUnits\\(\\) expects string\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBinary\\:\\:toDecimal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBinary\\:\\:toHex\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBinary\\:\\:toOctal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toBinary\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toHex\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toOctal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertHex\\:\\:toBinary\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertHex\\:\\:toDecimal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertHex\\:\\:toOctal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertOctal\\:\\:toBinary\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertOctal\\:\\:toDecimal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertOctal\\:\\:toHex\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBinary\\:\\:toHex\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBinary\\:\\:toOctal\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toBinary\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toHex\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertDecimal\\:\\:toOctal\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertHex\\:\\:toBinary\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertHex\\:\\:toOctal\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertOctal\\:\\:toBinary\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - - - message: "#^Parameter \\#2 \\$places of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertOctal\\:\\:toHex\\(\\) expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\BesselJ\\:\\:besselj2a\\(\\) has no return type specified\\.$#" count: 1 @@ -746,25 +361,15 @@ parameters: path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php - - message: "#^Parameter \\#1 \\$num(ber)? of function floor expects float(\\|int)?, float\\|int\\<0, 281474976710655\\>\\|string given\\.$#" + message: "#^Parameter \\#1 \\$number of function floor expects float, float\\|int\\<0, 281474976710655\\>\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php - - message: "#^Parameter \\#1 \\$num(ber)? of function floor expects float(\\|int)?, float\\|int\\|string given\\.$#" + message: "#^Parameter \\#1 \\$number of function floor expects float, float\\|int\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/BitWise.php - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ComplexFunctions\\:\\:IMARGUMENT\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php - - - - message: "#^Parameter \\#1 \\$power of method Complex\\\\Complex\\:\\:pow\\(\\) expects float\\|int, float\\|int\\|string given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertBase\\:\\:validatePlaces\\(\\) has parameter \\$places with no type specified\\.$#" count: 1 @@ -775,31 +380,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php - - - message: "#^Cannot access offset 'AllowPrefix' on mixed\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - - - message: "#^Cannot access offset 'Group' on mixed\\.$#" - count: 9 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - - - message: "#^Cannot access offset 'Unit Name' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - - - message: "#^Cannot access offset 'multiplier' on mixed\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - - - message: "#^Cannot access offset mixed on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertUOM\\:\\:getUOMDetails\\(\\) has no return type specified\\.$#" count: 1 @@ -810,11 +390,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - - message: "#^Parameter \\#1 \\$uom of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\ConvertUOM\\:\\:getUOMDetails\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\\\Erf\\:\\:erfValue\\(\\) has no return type specified\\.$#" count: 1 @@ -845,16 +420,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Engineering/ErfC.php - - - message: "#^Parameter \\#1 \\$message of class PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Exception constructor expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Exception.php - - - - message: "#^Parameter \\#2 \\$code of class PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Exception constructor expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Exception.php - - message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int, array\\)\\: bool\\)\\|null, array\\{'PhpOffice\\\\\\\\PhpSpreadsheet\\\\\\\\Calculation\\\\\\\\Exception', 'errorHandlerCallback'\\} given\\.$#" count: 1 @@ -875,6 +440,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Financial.php + - + message: "#^Parameter \\#1 \\$year of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\DateTimeExcel\\\\Helpers\\:\\:isLeapYear\\(\\) expects int\\|string, array\\|int\\|string given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Amortization.php + - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\CashFlow\\\\Constant\\\\Periodic\\\\Interest\\:\\:rateNextGuess\\(\\) has no return type specified\\.$#" count: 1 @@ -931,7 +501,7 @@ parameters: path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php - - message: "#^Parameter \\#4 \\$x2 of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\CashFlow\\\\Variable\\\\NonPeriodic\\:\\:xirrPart3\\(\\) expects float, mixed given\\.$#" + message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\CashFlow\\\\Variable\\\\NonPeriodic\\:\\:xnpvOrdered\\(\\) should return float\\|string but returns array\\|string\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php @@ -940,6 +510,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php + - + message: "#^Parameter \\#1 \\$year of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Helpers\\:\\:daysPerYear\\(\\) expects int\\|string, array\\|int\\|string given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Coupons.php + - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Depreciation\\:\\:validateCost\\(\\) has parameter \\$cost with no type specified\\.$#" count: 1 @@ -970,26 +545,26 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Financial/Depreciation.php - - - message: "#^Cannot cast mixed to int\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Financial/Dollar.php - - - - message: "#^Parameter \\#1 \\$num(ber)? of function floor expects float(\\|int)?, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Financial/Dollar.php - - - - message: "#^Parameter \\#1 \\$(x|num1) of function fmod expects float, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/Financial/Dollar.php - - message: "#^Binary operation \"/\" between float\\|string and float\\|string results in an error\\.$#" count: 2 path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + - + message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Securities\\\\Price\\:\\:received\\(\\) should return float\\|string but returns array\\|string\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: "#^Parameter \\#1 \\$year of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Helpers\\:\\:daysPerYear\\(\\) expects int\\|string, array\\|int\\|string given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php + + - + message: "#^Parameter \\#1 \\$year of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Helpers\\:\\:daysPerYear\\(\\) expects int\\|string, array\\|int\\|string given\\.$#" + count: 2 + path: src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php + - message: "#^Cannot call method getTokenSubType\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\FormulaToken\\|null\\.$#" count: 4 @@ -1025,11 +600,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Functions.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Functions.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Functions\\:\\:ifCondition\\(\\) has no return type specified\\.$#" count: 1 @@ -1080,11 +650,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Functions.php - - - message: "#^Parameter \\#1 \\$number of function abs expects float\\|int\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Functions.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Internal\\\\MakeMatrix\\:\\:make\\(\\) has parameter \\$args with no type specified\\.$#" count: 1 @@ -1105,11 +670,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\:\\:HYPERLINK\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\:\\:OFFSET\\(\\) should return array\\|string but returns array\\|int\\|string\\.$#" count: 1 @@ -1120,46 +680,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - message: "#^Parameter \\#1 \\$row of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsA1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#1 \\$row of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsR1C1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#1 \\$sheetName of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:sheetName\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#2 \\$column of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsA1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#2 \\$column of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsR1C1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#3 \\$relativity of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsA1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Parameter \\#3 \\$relativity of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Address\\:\\:formatAsR1C1\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Address.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\ExcelMatch\\:\\:matchFirstValue\\(\\) has no return type specified\\.$#" count: 1 @@ -1240,56 +760,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Formula\\:\\:text\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Formula.php - - - - message: "#^Parameter \\#1 \\$lookupArray of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\HLookup\\:\\:convertLiteralArray\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php - - - - message: "#^Parameter \\#1 \\$textValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:strToLower\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php - - - - message: "#^Parameter \\#1 \\$tooltip of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Hyperlink\\:\\:setTooltip\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php - - - - message: "#^Parameter \\#1 \\$url of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Hyperlink\\:\\:setUrl\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Indirect\\:\\:INDIRECT\\(\\) should return array\\|string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Lookup\\:\\:verifyResultVector\\(\\) has no return type specified\\.$#" count: 1 @@ -1320,26 +790,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php - - - message: "#^Parameter \\#1 \\$message of class PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Exception constructor expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Matrix\\:\\:extractRowValue\\(\\) has no return type specified\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php - - - message: "#^Binary operation \"\\+\\=\" between string and mixed results in an error\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\Offset\\:\\:adjustEndCellColumnForWidth\\(\\) has no return type specified\\.$#" count: 1 @@ -1380,61 +835,21 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/Offset.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - message: "#^Parameter \\#1 \\$columnAddress of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:columnIndexFromString\\(\\) expects string, string\\|null given\\.$#" count: 3 path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - - - message: "#^Parameter \\#1 \\$(low|start) of function range expects float\\|int\\|string, string\\|null given\\.$#" + message: "#^Parameter \\#1 \\$low of function range expects float\\|int\\|string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - message: "#^Parameter \\#2 \\$(high|end) of function range expects float\\|int\\|string, string\\|null given\\.$#" + message: "#^Parameter \\#2 \\$high of function range expects float\\|int\\|string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - - - message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - - - message: "#^Cannot access offset int\\|string\\|null on mixed\\.$#" - count: 3 - path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - - - message: "#^Cannot access offset mixed on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\LookupRef\\\\VLookup\\:\\:vLookupSearch\\(\\) has no return type specified\\.$#" count: 1 @@ -1476,90 +891,35 @@ parameters: path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - message: "#^Parameter \\#1 \\$array(_arg)? of function uasort expects array, mixed given\\.$#" + message: "#^Parameter \\#2 \\$callback of function uasort expects callable\\(T, T\\)\\: int, array\\{'self', 'vlookupSort'\\} given\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - message: "#^Parameter \\#1 \\$(input|array) of function array_keys expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - - - message: "#^Parameter \\#2 \\$callback of function uasort expects callable\\(mixed, mixed\\)\\: int, array\\{'self', 'vlookupSort'\\} given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Cosine\\:\\:acos\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Cosine\\:\\:acosh\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Sine\\:\\:asin\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Sine\\:\\:asinh\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Tangent\\:\\:atan\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Parameter \\#1 \\$number of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Trig\\\\Tangent\\:\\:atanh\\(\\) expects float, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php - - - - message: "#^Binary operation \"/\" between float\\|int\\|string and float\\|int\\|string results in an error\\.$#" + message: "#^Binary operation \"/\" between array\\|float\\|int\\|string and array\\|float\\|int\\|string results in an error\\.$#" count: 2 path: src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php - - message: "#^Binary operation \"/\" between float\\|int\\|string and float\\|int results in an error\\.$#" + message: "#^Parameter \\#1 \\$factVal of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Factorial\\:\\:fact\\(\\) expects array\\|float, int\\\\|int\\<0, max\\> given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php + + - + message: "#^Binary operation \"/\" between array\\|float\\|int\\|string and float\\|int results in an error\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php - - message: "#^Cannot call method getWorksheet\\(\\) on mixed\\.$#" - count: 4 - path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Subtotal\\:\\:evaluate\\(\\) should return float\\|string but returns mixed\\.$#" + message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\IntClass\\:\\:evaluate\\(\\) should return array\\|string but returns int\\.$#" count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php + path: src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php - message: "#^PHPDoc tag @var for constant PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Subtotal\\:\\:CALL_FUNCTIONS with type array\\ is not subtype of value array\\{1\\: array\\{'PhpOffice…', 'average'\\}, 2\\: array\\{'PhpOffice…', 'COUNT'\\}, 3\\: array\\{'PhpOffice…', 'COUNTA'\\}, 4\\: array\\{'PhpOffice…', 'max'\\}, 5\\: array\\{'PhpOffice…', 'min'\\}, 6\\: array\\{'PhpOffice…', 'product'\\}, 7\\: array\\{'PhpOffice…', 'STDEV'\\}, 8\\: array\\{'PhpOffice…', 'STDEVP'\\}, \\.\\.\\.\\}\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php - - - message: "#^Parameter \\#1 \\$(input|array) of function array_filter expects array, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php - - - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:MAXIFS\\(\\) should return float but returns float\\|string\\|null\\.$#" count: 1 @@ -1570,21 +930,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Statistical.php - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:AVERAGEIF\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:COUNTIF\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical.php - - - - message: "#^Binary operation \"\\-\" between mixed and float\\|string results in an error\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Averages.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Averages\\:\\:filterArguments\\(\\) has no return type specified\\.$#" count: 1 @@ -1640,36 +985,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:AVERAGEIF\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:COUNTIF\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:databaseFromRangeAndValue\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - - message: "#^Parameter \\#2 \\$condition of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:AVERAGEIF\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - - message: "#^Parameter \\#2 \\$valueRange of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:databaseFromRangeAndValue\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - - - message: "#^Parameter \\#3 \\$averageRange of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Conditional\\:\\:AVERAGEIF\\(\\) expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Conditional.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Distributions\\\\Beta\\:\\:\\$logBetaCacheP has no type specified\\.$#" count: 1 @@ -1685,11 +1000,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php - - - message: "#^Static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Distributions\\\\Beta\\:\\:regularizedIncompleteBeta\\(\\) is unused\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php - - message: "#^Constant PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Distributions\\\\ChiSquared\\:\\:MAX_ITERATIONS is unused\\.$#" count: 1 @@ -1755,11 +1065,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php - - - message: "#^Parameter \\#1 \\$(var|value) of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php - - message: "#^Parameter \\#2 \\$columns of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\\\Distributions\\\\ChiSquared\\:\\:degrees\\(\\) expects int, float\\|int\\<0, max\\> given\\.$#" count: 1 @@ -1825,6 +1130,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php + - + message: "#^Parameter \\#1 \\$factVal of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\MathTrig\\\\Factorial\\:\\:fact\\(\\) expects array\\|float, int\\<0, max\\> given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php + - message: "#^Binary operation \"\\-\" between float\\|string and float\\|int\\|numeric\\-string results in an error\\.$#" count: 1 @@ -1856,7 +1166,7 @@ parameters: path: src/PhpSpreadsheet/Calculation/Statistical/Percentiles.php - - message: "#^Binary operation \"/\" between float\\|int\\|string and float\\|int\\|string results in an error\\.$#" + message: "#^Binary operation \"/\" between array\\|float\\|int\\|string and array\\|float\\|int\\|string results in an error\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/Statistical/Permutations.php @@ -1905,91 +1215,16 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/TextData.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\TextData\\:\\:SEARCHINSENSITIVE\\(\\) should return string but returns int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\TextData\\:\\:SEARCHSENSITIVE\\(\\) should return string but returns int\\|string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\TextData\\:\\:TRIMNONPRINTABLE\\(\\) should return string but returns string\\|null\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData.php - - - - message: "#^Parameter \\#1 \\$(glue|separator) of function implode expects (array\\|)?string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Concatenate.php - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" count: 4 path: src/PhpSpreadsheet/Calculation/TextData/Extract.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\TextData\\\\Format\\:\\:VALUE\\(\\) should return DateTimeInterface\\|float\\|int\\|string but returns mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#1 \\$dateValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\DateTimeExcel\\\\DateValue\\:\\:fromString\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#1 \\$timeValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\DateTimeExcel\\\\TimeValue\\:\\:fromString\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match_all expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Format.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Helpers.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Helpers.php - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 path: src/PhpSpreadsheet/Calculation/TextData/Text.php - - - message: "#^Cannot access offset 'value' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Calculation/Token/Stack.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Token\\\\Stack\\:\\:getStackItem\\(\\) has no return type specified\\.$#" count: 1 @@ -2025,46 +1260,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Calculation/Token/Stack.php - - - message: "#^Parameter \\#1 \\$dateValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:stringToExcel\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\AdvancedValueBinder\\:\\:setPercentage\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\AdvancedValueBinder\\:\\:setTimeHoursMinutes\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\AdvancedValueBinder\\:\\:setTimeHoursMinutesSeconds\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" - count: 7 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Cell/AdvancedValueBinder.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 2 - path: src/PhpSpreadsheet/Cell/Cell.php - - message: "#^Elseif branch is unreachable because previous condition is always true\\.$#" count: 1 @@ -2075,11 +1270,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Cell/Cell.php - - - message: "#^Parameter \\#1 \\$textValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\DataType\\:\\:checkString\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\RichText\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Cell.php - - message: "#^Parameter \\#2 \\$format of static method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\:\\:toFormattedString\\(\\) expects string, string\\|null given\\.$#" count: 1 @@ -2111,32 +1301,12 @@ parameters: path: src/PhpSpreadsheet/Cell/Coordinate.php - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#1 \\$cellAddress of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:absoluteCoordinate\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$input of function array_chunk expects array, array\\\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Cell/Coordinate.php - - message: "#^Parameter \\#1 \\$cellAddress of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:coordinateFromString\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#1 \\$(input|array) of function array_chunk expects array, array\\\\|false given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function strtoupper expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/Coordinate.php - - - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, array\\\\|string given\\.$#" + message: "#^Parameter \\#2 \\$str of function explode expects string, array\\\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Cell/Coordinate.php @@ -2150,106 +1320,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Cell/Coordinate.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/DataType.php - - message: "#^Parameter \\#1 \\$textValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:substring\\(\\) expects string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Cell/DataType.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function strtolower expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/DataValidator.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/DefaultValueBinder.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function ltrim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/DefaultValueBinder.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/DefaultValueBinder.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Cell/StringValueBinder.php - - - - message: "#^Cannot access offset 'alpha' on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot access offset 'size' on mixed\\.$#" - count: 4 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot access offset 'type' on mixed\\.$#" - count: 4 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot access offset 'value' on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot access offset string on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:getAxisNumberFormat\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:getAxisOptionsProperty\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:getFillProperty\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:getLineProperty\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:getSoftEdgesSize\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - message: "#^Parameter \\#1 \\$angle of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setShadowAngle\\(\\) expects int, int\\|null given\\.$#" count: 1 @@ -2260,16 +1335,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/Axis.php - - - message: "#^Parameter \\#1 \\$color of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setGlowColor\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Parameter \\#1 \\$color of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setShadowColor\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - message: "#^Parameter \\#1 \\$distance of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setShadowDistance\\(\\) expects float, float\\|null given\\.$#" count: 1 @@ -2280,16 +1345,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/Axis.php - - - message: "#^Parameter \\#3 \\$alphaType of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setShadowColor\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - - - message: "#^Parameter \\#3 \\$colorType of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Axis\\:\\:setGlowColor\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Axis.php - - message: "#^Call to an undefined method object\\:\\:render\\(\\)\\.$#" count: 1 @@ -2380,21 +1435,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/Chart.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:\\$name \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Chart.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:\\$plotArea \\(PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\PlotArea\\) does not accept PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\PlotArea\\|null\\.$#" count: 1 path: src/PhpSpreadsheet/Chart/Chart.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:\\$plotVisibleOnly \\(bool\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/Chart.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:\\$title \\(PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Title\\) does not accept PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Title\\|null\\.$#" count: 1 @@ -2425,56 +1470,16 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/Chart.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeries\\:\\:\\$plotGrouping \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeries.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeries\\:\\:\\$plotType \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeries.php - - message: "#^Strict comparison using \\=\\=\\= between PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues and null will always evaluate to false\\.$#" count: 2 path: src/PhpSpreadsheet/Chart/DataSeries.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:refresh\\(\\) has parameter \\$flatten with no type specified\\.$#" count: 1 path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - message: "#^Parameter \\#1 \\$(input|array) of function array_values expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Parameter \\#1 \\$(stack|array) of function array_shift expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Parameter \\#1 \\$(var|value) of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:\\$dataSource \\(string\\) does not accept string\\|null\\.$#" count: 1 @@ -2485,31 +1490,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:\\$dataValues \\(array\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:\\$fillColor \\(array\\\\|string\\) does not accept array\\\\|string\\|null\\.$#" count: 1 path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:\\$formatCode \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\:\\:\\$pointMarker \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Chart/DataSeriesValues.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Chart/GridLines.php - - message: "#^Parameter \\#1 \\$angle of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\GridLines\\:\\:setShadowAngle\\(\\) expects int, int\\|null given\\.$#" count: 1 @@ -2930,21 +1915,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Chart/Title.php - - - message: "#^Cannot call method attach\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Collection/Cells.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Collection\\\\Cells\\:\\:get\\(\\) should return PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell\\|null but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Collection/Cells.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Collection\\\\Cells\\:\\:\\$currentCell \\(PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell\\|null\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Collection/Cells.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Collection\\\\Memory\\:\\:\\$cache has no type specified\\.$#" count: 1 @@ -2965,21 +1935,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/DefinedName.php - - - message: "#^Cannot cast mixed to float\\.$#" - count: 1 - path: src/PhpSpreadsheet/Document/Properties.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 1 - path: src/PhpSpreadsheet/Document/Properties.php - - - - message: "#^Parameter \\#1 \\$timestamp of static method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:intOrFloatTimestamp\\(\\) expects float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Document/Properties.php - - message: "#^Cannot use array destructuring on array\\|null\\.$#" count: 1 @@ -3036,7 +1991,7 @@ parameters: path: src/PhpSpreadsheet/Helper/Html.php - - message: "#^Parameter \\#1 \\$(function|callback) of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\), mixed\\} given\\.$#" + message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\), mixed\\} given\\.$#" count: 1 path: src/PhpSpreadsheet/Helper/Html.php @@ -3115,11 +2070,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Helper/Html.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Helper/Sample.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Sample\\:\\:getSamples\\(\\) should return array\\\\> but returns array\\\\>\\.$#" count: 1 @@ -3145,11 +2095,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Helper/Sample.php - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Helper/Sample.php - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, string\\|false given\\.$#" count: 1 @@ -3190,21 +2135,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/BaseReader.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Gnumeric.php - - message: "#^Comparison operation \"\\<\" between int and SimpleXMLElement\\|null results in an error\\.$#" count: 2 path: src/PhpSpreadsheet/Reader/Gnumeric.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Gnumeric.php - - message: "#^Offset 'percentage' does not exist on SimpleXMLElement\\|null\\.$#" count: 1 @@ -3230,11 +2165,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Reader/Gnumeric/Styles.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Html.php - - message: "#^Variable \\$value on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 @@ -3300,16 +2230,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Reader/Ods.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/DefinedNames.php - - - - message: "#^Parameter \\#1 \\$worksheetName of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getSheetByName\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Ods/DefinedNames.php - - message: "#^Cannot call method getElementsByTagNameNS\\(\\) on DOMElement\\|null\\.$#" count: 3 @@ -3420,11 +2340,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Security/XmlScanner.php - - - message: "#^Parameter \\#4 \\$cellData of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Slk\\:\\:processCFinal\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Slk.php - - message: "#^Call to an undefined method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\\\SpContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\:\\:getDgContainer\\(\\)\\.$#" count: 1 @@ -3475,21 +2390,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 4 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^Cannot access offset 1 on array\\|false\\.$#" count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Cannot access offset 1 on mixed\\.$#" - count: 7 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^If condition is always true\\.$#" count: 1 @@ -3530,11 +2435,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^Parameter \\#1 \\$operator of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\DataValidation\\:\\:setOperator\\(\\) expects string, int\\|string given\\.$#" count: 1 @@ -3550,26 +2450,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^Parameter \\#1 \\$type of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\DataValidation\\:\\:setType\\(\\) expects string, int\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Parameter \\#1 \\$(var|value) of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls.php - - - - message: "#^Parameter \\#1 \\$worksheetName of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getSheetByName\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^Parameter \\#2 \\$row of method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\IReadFilter\\:\\:readCell\\(\\) expects int, string given\\.$#" count: 1 @@ -3590,11 +2475,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xls.php - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Reader/Xls.php - - message: "#^Parameter \\#4 \\$endRow of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Xls\\:\\:getDistanceY\\(\\) expects int, string given\\.$#" count: 1 @@ -3655,11 +2535,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xls/ErrorCode.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\Escher\\:\\:\\$object \\(PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\\\SpContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\|PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DggContainer\\\\BstoreContainer\\\\BSE\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xls/Escher.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xls\\\\MD5\\:\\:f\\(\\) has no return type specified\\.$#" count: 1 @@ -3691,7 +2566,7 @@ parameters: path: src/PhpSpreadsheet/Reader/Xls/MD5.php - - message: "#^Parameter \\#1 \\$(input|array) of function array_values expects array, array\\|false given\\.$#" + message: "#^Parameter \\#1 \\$input of function array_values expects array, array\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Reader/Xls/MD5.php @@ -3720,11 +2595,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xlsx.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 5 - path: src/PhpSpreadsheet/Reader/Xlsx.php - - message: "#^Cannot access property \\$r on SimpleXMLElement\\|null\\.$#" count: 2 @@ -3780,11 +2650,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Reader/Xlsx.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xlsx.php - - message: "#^Comparison operation \"\\>\" between SimpleXMLElement\\|null and 0 results in an error\\.$#" count: 1 @@ -3965,11 +2830,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Reader/Xlsx.php - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx.php - - message: "#^Parameter \\#1 \\$sizeInCm of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Font\\:\\:centimeterSizeToPixels\\(\\) expects int, string given\\.$#" count: 1 @@ -3980,11 +2840,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xlsx.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx.php - - message: "#^Parameter \\#1 \\$worksheetName of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getSheetByName\\(\\) expects string, array\\|string given\\.$#" count: 1 @@ -3995,11 +2850,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Reader/Xlsx.php - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Reader/Xlsx.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xlsx\\\\AutoFilter\\:\\:readAutoFilter\\(\\) has parameter \\$autoFilterRange with no type specified\\.$#" count: 1 @@ -4035,11 +2885,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - message: "#^Cannot call method getFont\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\Run\\|null\\.$#" count: 12 @@ -4215,41 +3060,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - message: "#^Parameter \\#1 \\$showBubbleSize of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowBubbleSize\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showCategoryName of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowCatName\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showDataLabelValues of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowVal\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showLeaderLines of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowLeaderLines\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showLegendKey of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowLegendKey\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showPercentage of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowPercent\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - - - message: "#^Parameter \\#1 \\$showSeriesName of method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Layout\\:\\:setShowSerName\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/Chart.php - - message: "#^Parameter \\#3 \\$overlay of class PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Legend constructor expects bool, bool\\|float\\|int\\|string\\|null given\\.$#" count: 1 @@ -4335,11 +3145,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xlsx\\\\ConditionalStyles\\:\\:readConditionalStyles\\(\\) has no return type specified\\.$#" - count: 1 - path: src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Reader\\\\Xlsx\\\\ConditionalStyles\\:\\:readConditionalStyles\\(\\) has parameter \\$xmlSheet with no type specified\\.$#" count: 1 @@ -4495,16 +3300,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/ReferenceHelper.php - - - message: "#^Parameter \\#1 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\ReferenceHelper\\:\\:updateFormulaReferences\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/ReferenceHelper.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/ReferenceHelper.php - - message: "#^Parameter \\#1 \\$index of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\RowDimension\\:\\:setRowIndex\\(\\) expects int, string given\\.$#" count: 1 @@ -4520,11 +3315,6 @@ parameters: count: 4 path: src/PhpSpreadsheet/ReferenceHelper.php - - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/ReferenceHelper.php - - message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, string\\|null given\\.$#" count: 1 @@ -4535,11 +3325,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/ReferenceHelper.php - - - message: "#^Parameter \\#1 \\$text of class PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\Run constructor expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/RichText/RichText.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\Run\\:\\:\\$font \\(PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\) does not accept PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#" count: 1 @@ -4570,11 +3355,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Settings.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:stringToExcel\\(\\) should return float\\|false but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Date.php - - message: "#^Parameter \\#1 \\$excelFormatCode of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:isDateTimeFormatCode\\(\\) expects string, string\\|null given\\.$#" count: 1 @@ -4601,37 +3381,37 @@ parameters: path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Drawing\\:\\:imagecreatefrombmp\\(\\) should return GdImage\\|resource but returns (GdImage|resource)\\|false\\.$#" + message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Drawing\\:\\:imagecreatefrombmp\\(\\) should return GdImage\\|resource but returns resource\\|false\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#1 \\$(fp|stream) of function feof expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$fp of function feof expects resource, resource\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#1 \\$(fp|stream) of function fread expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$fp of function fread expects resource, resource\\|false given\\.$#" count: 2 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagecolorallocate expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagecolorallocate expects resource, resource\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagesetpixel expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagesetpixel expects resource, resource\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#1 \\$(x_size|width) of function imagecreatetruecolor expects int, float\\|int given\\.$#" + message: "#^Parameter \\#1 \\$x_size of function imagecreatetruecolor expects int, float\\|int given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#" + message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php @@ -4641,7 +3421,7 @@ parameters: path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#2 \\$(y_size|height) of function imagecreatetruecolor expects int, float\\|int given\\.$#" + message: "#^Parameter \\#2 \\$y_size of function imagecreatetruecolor expects int, float\\|int given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php @@ -4661,7 +3441,7 @@ parameters: path: src/PhpSpreadsheet/Shared/Drawing.php - - message: "#^Parameter \\#4 \\$col(or)? of function imagesetpixel expects int, int\\|false given\\.$#" + message: "#^Parameter \\#4 \\$col of function imagesetpixel expects int, int\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Drawing.php @@ -4705,11 +3485,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/Escher/DgContainer.php - - - message: "#^Cannot call method setParent\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Escher\\\\DgContainer\\\\SpgrContainer\\:\\:getChildren\\(\\) has no return type specified\\.$#" count: 1 @@ -4765,11 +3540,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/Font.php - - - message: "#^Parameter \\#1 \\$number of function abs expects float\\|int\\|string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\JAMA\\\\EigenvalueDecomposition\\:\\:\\$cdivi has no type specified\\.$#" count: 1 @@ -4871,12 +3641,7 @@ parameters: path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php - - message: "#^Parameter \\#1 \\$str(ing)? of function trim expects string, float\\|int given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php - - - - message: "#^Parameter \\#3 \\$c of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\JAMA\\\\Matrix\\:\\:set\\(\\) expects float\\|int\\|null, mixed given\\.$#" + message: "#^Parameter \\#1 \\$str of function trim expects string, float\\|int given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -4895,21 +3660,6 @@ parameters: count: 19 path: src/PhpSpreadsheet/Shared/JAMA/Matrix.php - - - message: "#^Cannot call method getArray\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php - - - - message: "#^Cannot call method getColumnDimension\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php - - - - message: "#^Cannot call method getRowDimension\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php - - message: "#^If condition is always true\\.$#" count: 7 @@ -4920,11 +3670,6 @@ parameters: count: 4 path: src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php - - - message: "#^Parameter \\#1 \\$number of function abs expects float\\|int\\|string, mixed given\\.$#" - count: 4 - path: src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php - - message: "#^Cannot access offset 1 on array\\|false\\.$#" count: 1 @@ -4976,7 +3721,7 @@ parameters: path: src/PhpSpreadsheet/Shared/OLE.php - - message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#" + message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#" count: 3 path: src/PhpSpreadsheet/Shared/OLE.php @@ -5016,7 +3761,7 @@ parameters: path: src/PhpSpreadsheet/Shared/OLE.php - - message: "#^Parameter \\#1 \\$(var|value) of function count expects array\\|Countable, string given\\.$#" + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, string given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -5165,21 +3910,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/OLERead.php - - - message: "#^Cannot access offset 'fontidx' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/StringHelper.php - - - - message: "#^Cannot access offset 'strlen' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/StringHelper.php - - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/StringHelper.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:formatNumber\\(\\) should return string but returns array\\|string\\.$#" count: 1 @@ -5225,11 +3955,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/StringHelper.php - - - message: "#^Static property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:\\$isIconvEnabled \\(bool\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/StringHelper.php - - message: "#^Static property PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:\\$thousandsSeparator \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -5381,15 +4106,10 @@ parameters: path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$(args|arrays) of function array_merge expects array, float given\\.$#" + message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, float given\\.$#" count: 1 path: src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php - - - message: "#^Array \\(array\\\\) does not accept object\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Trend/Trend.php - - message: "#^Call to an undefined method object\\:\\:getGoodnessOfFit\\(\\)\\.$#" count: 1 @@ -5445,11 +4165,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Shared/XMLWriter.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Xls\\:\\:sizeCol\\(\\) should return int but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Shared/Xls.php - - message: "#^Call to function is_array\\(\\) with string will always evaluate to false\\.$#" count: 1 @@ -5460,21 +4175,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Spreadsheet.php - - - message: "#^Parameter \\#1 \\$path of function pathinfo expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Spreadsheet.php - - message: "#^Parameter \\#1 \\$worksheet of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getIndex\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet, PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Spreadsheet.php - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:\\$ribbonXMLData \\(array\\{target\\: string, data\\: string\\}\\|null\\) does not accept array\\{target\\: mixed, data\\: mixed\\}\\.$#" - count: 1 - path: src/PhpSpreadsheet/Spreadsheet.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:\\$workbookViewVisibilityValues has no type specified\\.$#" count: 1 @@ -5670,6 +4375,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php + - + message: "#^Parameter \\#1 \\$conditions of method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Conditional\\:\\:setConditions\\(\\) expects array\\\\|bool\\|float\\|int\\|string, array\\ given\\.$#" + count: 1 + path: src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php + - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\DateFormatter\\:\\:escapeQuotesCallback\\(\\) has parameter \\$matches with no type specified\\.$#" count: 1 @@ -5690,23 +4400,13 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - - message: "#^Parameter \\#2 \\$callback of function preg_replace_callback expects callable\\(\\)\\: mixed, array\\{'self', 'escapeQuotesCallback'\\} given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - - - message: "#^Parameter \\#2 \\$callback of function preg_replace_callback expects callable\\(\\)\\: mixed, array\\{'self', 'setLowercaseCallback'\\} given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - message: "#^Parameter \\#2 \\$replace of function str_replace expects array\\|string, int given\\.$#" count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, string\\|null given\\.$#" + message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php @@ -5715,11 +4415,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - - message: "#^Parameter \\#3 \\$subject of function preg_replace_callback expects array\\|string, string\\|null given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:splitFormat\\(\\) has no return type specified\\.$#" count: 1 @@ -5770,11 +4465,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\Formatter\\:\\:toFormattedString\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - message: "#^Parameter \\#2 \\$subject of function preg_split expects string, string\\|null given\\.$#" count: 1 @@ -5785,11 +4475,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/Formatter.php - - - message: "#^Cannot cast mixed to float\\.$#" - count: 1 - path: src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\\\PercentageFormatter\\:\\:format\\(\\) has parameter \\$value with no type specified\\.$#" count: 1 @@ -5800,106 +4485,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Cannot access offset 'date' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Cannot access offset 'dateTime' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Cannot access offset 'time' on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\:\\:filterTestInDateGroupSet\\(\\) should return bool but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\:\\:filterTestInSimpleDataSet\\(\\) should return bool but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:rangeBoundaries\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#1 \\$string of function strlen expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#1 \\$visible of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Dimension\\:\\:setVisible\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#2 \\$haystack of function in_array expects array, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Parameter \\#3 \\$length of function array_slice expects int\\|null, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\:\\:\\$range \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - - - message: "#^Array \\(array\\\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - - - message: "#^Cannot call method setParent\\(\\) on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - - - message: "#^Cannot clone non\\-object variable \\$v of type mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\\\Column\\:\\:getAttribute\\(\\) should return int\\|string\\|null but returns mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\\\Column\\:\\:getAttributes\\(\\) should return array\\ but returns array\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php - - message: "#^Cannot call method getCell\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\|null\\.$#" count: 1 @@ -5946,7 +4531,7 @@ parameters: path: src/PhpSpreadsheet/Worksheet/PageSetup.php - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, string\\|null given\\.$#" + message: "#^Parameter \\#2 \\$str of function explode expects string, string\\|null given\\.$#" count: 5 path: src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -5980,16 +4565,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Worksheet/SheetView.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - - - message: "#^Cannot access offset 1 on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - message: "#^Cannot call method getCalculatedValue\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell\\|null\\.$#" count: 1 @@ -6051,7 +4626,7 @@ parameters: path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - message: "#^Parameter \\#1 \\$(input|string|array) of function array_splice expects array, ArrayObject\\ given\\.$#" + message: "#^Parameter \\#1 \\$input of function array_splice expects array, ArrayObject\\ given\\.$#" count: 1 path: src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -6062,16 +4637,11 @@ parameters: - message: "#^Parameter \\#1 \\$row of method PhpOffice\\\\PhpSpreadsheet\\\\Collection\\\\Cells\\:\\:removeRow\\(\\) expects string, int given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function strtoupper expects string, mixed given\\.$#" count: 1 path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - message: "#^Parameter \\#1 \\$worksheetName of method PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\:\\:getSheetByName\\(\\) expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$row of method PhpOffice\\\\PhpSpreadsheet\\\\Collection\\\\Cells\\:\\:removeRow\\(\\) expects string, int\\<1, max\\> given\\.$#" count: 1 path: src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -6081,7 +4651,7 @@ parameters: path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - message: "#^Parameter \\#2 \\$(start|offset) of function substr expects int, int(\\<0, max\\>)?\\|false given\\.$#" + message: "#^Parameter \\#2 \\$start of function substr expects int, int\\<0, max\\>\\|false given\\.$#" count: 2 path: src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -6110,11 +4680,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Worksheet/Worksheet.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Csv.php - - message: "#^Call to function array_key_exists\\(\\) with int and array\\{none\\: 'none', dashDot\\: '1px dashed', dashDotDot\\: '1px dotted', dashed\\: '1px dashed', dotted\\: '1px dotted', double\\: '3px double', hair\\: '1px solid', medium\\: '2px solid', \\.\\.\\.\\} will always evaluate to false\\.$#" count: 1 @@ -6411,12 +4976,12 @@ parameters: path: src/PhpSpreadsheet/Writer/Html.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), GdImage\\|resource given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagepng expects resource, GdImage\\|resource given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Html.php - - message: "#^Parameter \\#1 \\$str(ing)? of function base64_encode expects string, string\\|false given\\.$#" + message: "#^Parameter \\#1 \\$str of function base64_encode expects string, string\\|false given\\.$#" count: 2 path: src/PhpSpreadsheet/Writer/Html.php @@ -6465,11 +5030,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Ods/Content.php - - - message: "#^Parameter \\#2 \\$content of method XMLWriter\\:\\:writeElement\\(\\) expects string\\|null, mixed given\\.$#" - count: 4 - path: src/PhpSpreadsheet/Writer/Ods/Content.php - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int given\\.$#" count: 4 @@ -6480,11 +5040,6 @@ parameters: count: 3 path: src/PhpSpreadsheet/Writer/Ods/Content.php - - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Ods/Content.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Ods\\\\Content\\:\\:\\$formulaConvertor has no type specified\\.$#" count: 1 @@ -6495,16 +5050,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Ods/Formula.php - - - message: "#^Parameter \\#1 \\$date of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:dateTimeFromTimestamp\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Ods/Meta.php - - - - message: "#^Parameter \\#1 \\$rawTextData of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\XMLWriter\\:\\:writeRawData\\(\\) expects array\\\\|string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Ods/Meta.php - - message: "#^Parameter \\#1 \\$content of method XMLWriter\\:\\:text\\(\\) expects string, int given\\.$#" count: 2 @@ -6566,12 +5111,12 @@ parameters: path: src/PhpSpreadsheet/Writer/Xls.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), GdImage\\|resource given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagepng expects resource, GdImage\\|resource given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagepng expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagepng expects resource, resource\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls.php @@ -6640,11 +5185,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xls/Font.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:advance\\(\\) has no return type specified\\.$#" count: 1 @@ -6665,76 +5205,6 @@ parameters: count: 7 path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - message: "#^Parameter \\#1 \\$cell of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:cellToPackedRowcol\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$cell of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertRef2d\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$cell of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertRef3d\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$errorCode of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertError\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$ext_ref of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:getRefIndex\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$haystack of function substr_count expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$name of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertDefinedName\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$range of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertRange2d\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$str(ing)? of function strrev expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$string of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertString\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#1 \\$token of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:convertRange3d\\(\\) expects string, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#2 \\$str(ing)? of function explode expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" - count: 20 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#" count: 1 @@ -6745,16 +5215,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - message: "#^Part \\$token \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:\\$parseTree \\(string\\) does not accept mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Parser.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Parser\\:\\:\\$spreadsheet has no type specified\\.$#" count: 1 @@ -6835,23 +5295,13 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - message: "#^Parameter \\#1 \\$bitmap of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:processBitmap\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#1 \\$coordinates of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:indexesFromString\\(\\) expects string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#1 \\$errorCode of static method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\ErrorCode\\:\\:error\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#1 \\$im(age)? of function imagecolorat expects (GdImage|resource), GdImage\\|resource given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagecolorat expects resource, GdImage\\|resource given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -6866,12 +5316,12 @@ parameters: path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#2 \\$col(or)? of function imagecolorsforindex expects int, int\\|false given\\.$#" + message: "#^Parameter \\#2 \\$col of function imagecolorsforindex expects int, int\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#2 \\$(data|string) of function unpack expects string, string\\|false given\\.$#" + message: "#^Parameter \\#2 \\$data of function unpack expects string, string\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -6881,7 +5331,7 @@ parameters: path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#2 \\$(pieces|array) of function implode expects array(\\|null)?, array\\\\|false given\\.$#" + message: "#^Parameter \\#2 \\$pieces of function implode expects array, array\\\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -6895,31 +5345,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - message: "#^Parameter \\#3 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeFormula\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#3 \\$num of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeNumber\\(\\) expects float, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - - message: "#^Parameter \\#3 \\$str of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeString\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, string\\|null given\\.$#" count: 2 path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - - message: "#^Parameter \\#3 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeBoolErr\\(\\) expects int, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xls/Worksheet.php - - message: "#^Parameter \\#4 \\$isError of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xls\\\\Worksheet\\:\\:writeBoolErr\\(\\) expects bool, int given\\.$#" count: 3 @@ -6986,7 +5416,7 @@ parameters: path: src/PhpSpreadsheet/Writer/Xlsx.php - - message: "#^Parameter \\#1 \\$(function|callback) of function call_user_func expects callable\\(\\)\\: mixed, string given\\.$#" + message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, string given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xlsx.php @@ -7010,11 +5440,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx.php - - - message: "#^Cannot access offset int on mixed\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php - - message: "#^Cannot call method getDataValues\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\|false\\.$#" count: 1 @@ -7031,7 +5456,7 @@ parameters: path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php - - message: "#^Parameter \\#1 \\$plotSeriesValues of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Chart\\:\\:writeBubbles\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues|null, PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\|false given\\.$#" + message: "#^Parameter \\#1 \\$plotSeriesValues of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Chart\\:\\:writeBubbles\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\|null, PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\DataSeriesValues\\|false given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php @@ -7040,11 +5465,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php - - - message: "#^Parameter \\#1 \\$rawTextData of method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\XMLWriter\\:\\:writeRawData\\(\\) expects array\\\\|string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xlsx/Chart.php - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, array\\|int\\|string given\\.$#" count: 8 @@ -7145,11 +5565,6 @@ parameters: count: 2 path: src/PhpSpreadsheet/Writer/Xlsx/Comments.php - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/DefinedNames.php - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" count: 1 @@ -7160,23 +5575,13 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/DocProps.php - - - message: "#^Parameter \\#2 \\$content of method XMLWriter\\:\\:writeElement\\(\\) expects string\\|null, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Xlsx/DocProps.php - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int given\\.$#" count: 2 path: src/PhpSpreadsheet/Writer/Xlsx/DocProps.php - - message: "#^Part \\$propertyValue \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/DocProps.php - - - - message: "#^Parameter \\#1 \\$index of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:getChartByIndex\\(\\) expects string, int given\\.$#" + message: "#^Parameter \\#1 \\$index of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:getChartByIndex\\(\\) expects string, int\\<0, max\\> given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Drawing.php @@ -7275,11 +5680,6 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/StringTable.php - - - message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\StringTable\\:\\:createStringTable\\(\\) should return array\\ but returns array\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/StringTable.php - - message: "#^Parameter \\#1 \\$text of method PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\RichText\\:\\:createTextRun\\(\\) expects string, string\\|null given\\.$#" count: 1 @@ -7375,16 +5775,6 @@ parameters: count: 7 path: src/PhpSpreadsheet/Writer/Xlsx/Workbook.php - - - message: "#^Cannot cast mixed to string\\.$#" - count: 4 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Cannot use array destructuring on mixed\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" count: 1 @@ -7416,43 +5806,18 @@ parameters: path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Offset int on array\\\\> in isset\\(\\) does not exist\\.$#" + message: "#^Offset int\\<1, max\\> on array\\\\> in isset\\(\\) does not exist\\.$#" count: 2 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - message: "#^Parameter \\#1 \\$content of method XMLWriter\\:\\:text\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#1 \\$string of function substr expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#2 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellFormula\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#2 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellNumeric\\(\\) expects float\\|int, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Parameter \\#2 \\$content of method XMLWriter\\:\\:writeElement\\(\\) expects string\\|null, int\\|string given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - message: "#^Parameter \\#2 \\$content of method XMLWriter\\:\\:writeElement\\(\\) expects string\\|null, mixed given\\.$#" - count: 2 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int given\\.$#" - count: 19 + count: 15 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - @@ -7462,7 +5827,7 @@ parameters: - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, int\\<1, max\\> given\\.$#" - count: 7 + count: 9 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - @@ -7470,36 +5835,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, mixed given\\.$#" - count: 3 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#" count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - message: "#^Parameter \\#3 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellBoolean\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#3 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellError\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#3 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellInlineStr\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\RichText\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - - - message: "#^Parameter \\#3 \\$cellValue of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeCellString\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\RichText\\|string, mixed given\\.$#" - count: 1 - path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php - - message: "#^Parameter \\#3 \\$stringTable of method PhpOffice\\\\PhpSpreadsheet\\\\Writer\\\\Xlsx\\\\Worksheet\\:\\:writeSheetData\\(\\) expects array\\, array\\\\|null given\\.$#" count: 1 @@ -7520,711 +5860,11 @@ parameters: count: 1 path: src/PhpSpreadsheet/Writer/Xlsx/Xlfn.php - - - message: "#^Parameter \\#1 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:_calculateFormulaValue\\(\\) expects string, mixed given\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/CalculationTest.php - - - - message: "#^Parameter \\#1 \\$source of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\:\\:fromArray\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/CalculationTest.php - - message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Calculation/Engine/RangeTest.php - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DAVERAGE\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DAVERAGE\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DAVERAGE\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNTA\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNTA\\(\\) expects int\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNTA\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNT\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNT\\(\\) expects int\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DCOUNT\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DGET\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DGET\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DGET\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMAX\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMAX\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMAX\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMIN\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMIN\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DMIN\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DPRODUCT\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DPRODUCT\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DPRODUCT\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEVP\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEVP\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEVP\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEV\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEV\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSTDEV\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSUM\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSUM\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DSUM\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVARP\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVARP\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVARP\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php - - - - message: "#^Parameter \\#1 \\$database of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVAR\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php - - - - message: "#^Parameter \\#2 \\$field of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVAR\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php - - - - message: "#^Parameter \\#3 \\$criteria of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Database\\:\\:DVAR\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php - - - - message: "#^Part \\$timeValue \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMABS\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMARGUMENT\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCONJUGATE\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCOS\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCOSH\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCOT\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCSC\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMCSCH\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMEXP\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMLN\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMLOG10\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMLOG2\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMREAL\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMSEC\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMSECH\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMSIN\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMSINH\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMSQRT\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMTAN\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php - - - - message: "#^Parameter \\#1 \\$complexNumber of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Engineering\\:\\:IMAGINARY\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php - - - - message: "#^Parameter \\#1 \\$nominalRate of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\:\\:EFFECT\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php - - - - message: "#^Parameter \\#2 \\$periodsPerYear of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\:\\:EFFECT\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php - - - - message: "#^Parameter \\#1 \\$year of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Helpers\\:\\:daysPerYear\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php - - - - message: "#^Parameter \\#2 \\$basis of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\\\Helpers\\:\\:daysPerYear\\(\\) expects int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php - - - - message: "#^Parameter \\#1 \\$effectiveRate of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\:\\:NOMINAL\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php - - - - message: "#^Parameter \\#2 \\$periodsPerYear of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Financial\\:\\:NOMINAL\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php - - - - message: "#^Parameter \\#3 \\$message of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertEquals\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XNpvTest.php - - - - message: "#^Parameter \\#3 \\$message of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertEquals\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XirrTest.php - - - - message: "#^Part \\$number \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php - - - - message: "#^Part \\$number \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php - - - - message: "#^Part \\$value \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php - - - - message: "#^Part \\$matrix \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php - - - - message: "#^Part \\$value \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php - - - - message: "#^Cannot cast mixed to int\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php - - - - message: "#^Part \\$formula \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php - - - - message: "#^Part \\$angle \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php - - - - message: "#^Part \\$value \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php - - - - message: "#^Part \\$type \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php - - - - message: "#^Parameter \\#1 \\$probability of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:CHIINV\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php - - - - message: "#^Parameter \\#2 \\$degrees of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:CHIINV\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:FISHERINV\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:FISHER\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:GAMMALN\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:GAMMAFunction\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:GAUSS\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GaussTest.php - - - - message: "#^Parameter \\#1 \\$yValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:GROWTH\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GrowthTest.php - - - - message: "#^Parameter \\#1 \\$yValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LINEST\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php - - - - message: "#^Parameter \\#2 \\$xValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LINEST\\(\\) expects array\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php - - - - message: "#^Parameter \\#3 \\$const of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LINEST\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php - - - - message: "#^Parameter \\#4 \\$stats of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LINEST\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php - - - - message: "#^Parameter \\#1 \\$yValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LOGEST\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php - - - - message: "#^Parameter \\#2 \\$xValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LOGEST\\(\\) expects array\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php - - - - message: "#^Parameter \\#3 \\$const of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LOGEST\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php - - - - message: "#^Parameter \\#4 \\$stats of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:LOGEST\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TDIST\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php - - - - message: "#^Parameter \\#2 \\$degrees of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TDIST\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php - - - - message: "#^Parameter \\#3 \\$tails of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TDIST\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php - - - - message: "#^Parameter \\#1 \\$probability of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TINV\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php - - - - message: "#^Parameter \\#2 \\$degrees of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TINV\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php - - - - message: "#^Parameter \\#1 \\$yValues of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:TREND\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrendTest.php - - - - message: "#^Parameter \\#1 \\$value of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:WEIBULL\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php - - - - message: "#^Parameter \\#2 \\$alpha of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:WEIBULL\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php - - - - message: "#^Parameter \\#3 \\$beta of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:WEIBULL\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php - - - - message: "#^Parameter \\#4 \\$cumulative of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:WEIBULL\\(\\) expects bool, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php - - - - message: "#^Parameter \\#1 \\$dataSet of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:ZTEST\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php - - - - message: "#^Parameter \\#2 \\$m0 of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:ZTEST\\(\\) expects float, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php - - - - message: "#^Parameter \\#3 \\$sigma of static method PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Statistical\\:\\:ZTEST\\(\\) expects float\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php - - - - message: "#^Parameter \\#1 \\$locale of static method PhpOffice\\\\PhpSpreadsheet\\\\Settings\\:\\:setLocale\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php - - - - message: "#^Parameter \\#1 \\$currencyCode of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:setCurrencyCode\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php - - - - message: "#^Parameter \\#1 \\$separator of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:setDecimalSeparator\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php - - - - message: "#^Parameter \\#1 \\$separator of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:setThousandsSeparator\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Cell/CoordinateTest.php - - - - message: "#^Parameter \\#1 \\$columnAddress of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:columnIndexFromString\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/CoordinateTest.php - - - - message: "#^Parameter \\#1 \\$coordinateCollection of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:mergeRangesInCollection\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/CoordinateTest.php - - - - message: "#^Parameter \\#1 \\$range of static method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Coordinate\\:\\:buildRange\\(\\) expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Cell/CoordinateTest.php - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with arguments PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\Cell, null and 'should get exact…' will always evaluate to false\\.$#" count: 1 @@ -8240,41 +5880,6 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Collection/CellsTest.php - - - message: "#^Parameter \\#1 \\$propertyName of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:getCustomPropertyType\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Parameter \\#1 \\$propertyName of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:getCustomPropertyValue\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Parameter \\#1 \\$propertyName of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:isCustomPropertySet\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Parameter \\#1 \\$propertyName of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:setCustomProperty\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Parameter \\#1 \\$timestamp of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:setCreated\\(\\) expects float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Parameter \\#1 \\$timestamp of method PhpOffice\\\\PhpSpreadsheet\\\\Document\\\\Properties\\:\\:setModified\\(\\) expects float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - - - message: "#^Part \\$result \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Document/PropertiesTest.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheetTests\\\\Functional\\\\ColumnWidthTest\\:\\:testReadColumnWidth\\(\\) has parameter \\$format with no type specified\\.$#" count: 1 @@ -8296,22 +5901,22 @@ parameters: path: tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagecolorallocate expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagecolorallocate expects resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagestring expects (GdImage|resource), (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagestring expects resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php - - message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\MemoryDrawing\\:\\:setImageResource\\(\\) expects GdImage\\|resource, (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\MemoryDrawing\\:\\:setImageResource\\(\\) expects GdImage\\|resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php - - message: "#^Parameter \\#6 \\$col(or)? of function imagestring expects int, int\\|false given\\.$#" + message: "#^Parameter \\#6 \\$col of function imagestring expects int, int\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php @@ -8320,16 +5925,6 @@ parameters: count: 5 path: tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php - - - message: "#^Parameter \\#2 \\$format of method PhpOffice\\\\PhpSpreadsheetTests\\\\Functional\\\\AbstractFunctional\\:\\:writeAndReload\\(\\) expects string, mixed given\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Functional/ReadBlankCellsTest.php - - - - message: "#^Parameter \\#2 \\$format of method PhpOffice\\\\PhpSpreadsheetTests\\\\Functional\\\\AbstractFunctional\\:\\:writeAndReload\\(\\) expects string, mixed given\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php - - message: "#^Cannot access offset 'size' on array\\{0\\: int, 1\\: int, 2\\: int, 3\\: int, 4\\: int, 5\\: int, 6\\: int, 7\\: int, \\.\\.\\.\\}\\|false\\.$#" count: 2 @@ -8341,25 +5936,15 @@ parameters: path: tests/PhpSpreadsheetTests/Functional/StreamTest.php - - message: "#^Parameter \\#1 \\$(fp|stream) of function fstat expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$fp of function fstat expects resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Functional/StreamTest.php - - - message: "#^Parameter \\#1 \\$html of method PhpOffice\\\\PhpSpreadsheet\\\\Helper\\\\Html\\:\\:toRichTextObject\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Helper/HtmlTest.php - - message: "#^Parameter \\#1 \\$expected of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) expects class\\-string\\, string given\\.$#" count: 3 path: tests/PhpSpreadsheetTests/IOFactoryTest.php - - - message: "#^Parameter \\#3 \\$phpSpreadsheetFunctions of class PhpOffice\\\\PhpSpreadsheetInfra\\\\LocaleGenerator constructor expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/LocaleGeneratorTest.php - - message: "#^Cannot call method getValue\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\NamedFormula\\|null\\.$#" count: 5 @@ -8370,11 +5955,6 @@ parameters: count: 5 path: tests/PhpSpreadsheetTests/NamedRangeTest.php - - - message: "#^Part \\$result \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Reader/Ods/OdsPropertiesTest.php - - message: "#^Property PhpOffice\\\\PhpSpreadsheetTests\\\\Reader\\\\Ods\\\\OdsTest\\:\\:\\$spreadsheetData \\(PhpOffice\\\\PhpSpreadsheet\\\\Spreadsheet\\) in isset\\(\\) is not nullable\\.$#" count: 1 @@ -8405,11 +5985,6 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php - - - message: "#^Parameter \\#1 \\$str(ing)? of function strrev expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheetTests\\\\Reader\\\\Xlsx\\\\AutoFilterTest\\:\\:getAutoFilterInstance\\(\\) has no return type specified\\.$#" count: 1 @@ -8475,21 +6050,11 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Reader/Xlsx/ConditionalFormattingDataBarXlsxTest.php - - - message: "#^Part \\$result \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Reader/Xlsx/PropertiesTest.php - - message: "#^Cannot call method getPlotArea\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\|null\\.$#" count: 2 path: tests/PhpSpreadsheetTests/Reader/Xlsx/SheetsXlsxChartTest.php - - - message: "#^Part \\$creationDate \\(mixed\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Reader/Xml/XmlLoadTest.php - - message: "#^Argument of an invalid type array\\\\|false supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -8500,91 +6065,11 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php - - - message: "#^Parameter \\#1 \\$codePage of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\CodePage\\:\\:numberToName\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/CodePageTest.php - - - - message: "#^Parameter \\#1 \\$dateValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:dateTimeToExcel\\(\\) expects DateTimeInterface, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/DateTest.php - - - - message: "#^Parameter \\#1 \\$excelTimestamp of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:excelToTimestamp\\(\\) expects float\\|int, mixed given\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/DateTest.php - - - - message: "#^Parameter \\#1 \\$unixTimestamp of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:timestampToExcel\\(\\) expects int, mixed given\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/DateTest.php - - - - message: "#^Parameter \\#2 \\$timeZone of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Date\\:\\:excelToTimestamp\\(\\) expects DateTimeZone\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/DateTest.php - - - - message: "#^Parameter \\#1 \\$fontSizeInPoints of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Font\\:\\:fontSizeToPixels\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/FontTest.php - - - - message: "#^Parameter \\#1 \\$sizeInCm of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Font\\:\\:centimeterSizeToPixels\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/FontTest.php - - - - message: "#^Parameter \\#1 \\$sizeInInch of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Font\\:\\:inchSizeToPixels\\(\\) expects int, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/FontTest.php - - message: "#^Parameter \\#1 \\$currencyCode of static method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:setCurrencyCode\\(\\) expects string, null given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Shared/StringHelperTest.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php - - - - message: "#^Cannot access offset 1 on mixed\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php - - - - message: "#^Parameter \\#1 \\$yValues of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\ExponentialBestFit constructor expects array\\, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php - - - - message: "#^Parameter \\#2 \\$xValues of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\ExponentialBestFit constructor expects array\\, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php - - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php - - - - message: "#^Cannot access offset 1 on mixed\\.$#" - count: 3 - path: tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php - - - - message: "#^Parameter \\#1 \\$yValues of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\LinearBestFit constructor expects array\\, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php - - - - message: "#^Parameter \\#2 \\$xValues of class PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\Trend\\\\LinearBestFit constructor expects array\\, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheetTests\\\\SpreadsheetTest\\:\\:testGetSheetByName\\(\\) has parameter \\$index with no type specified\\.$#" count: 1 @@ -8595,21 +6080,6 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/SpreadsheetTest.php - - - message: "#^Parameter \\#1 \\$rgbValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Color\\:\\:getBlue\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Style/ColorTest.php - - - - message: "#^Parameter \\#1 \\$rgbValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Color\\:\\:getGreen\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Style/ColorTest.php - - - - message: "#^Parameter \\#1 \\$rgbValue of static method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Color\\:\\:getRed\\(\\) expects string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Style/ColorTest.php - - message: "#^Parameter \\#1 \\$condition of method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Conditional\\:\\:addCondition\\(\\) expects string, float given\\.$#" count: 2 @@ -8626,27 +6096,22 @@ parameters: path: tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php - - message: "#^Parameter \\#2 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\AutoFilter\\\\Column\\\\Rule\\:\\:setRule\\(\\) expects array\\\\|int\\|string, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Worksheet/AutoFilter/DateGroupTest.php - - - - message: "#^Parameter \\#1 \\$im(age)? of function imagecolorallocate expects (resource|GdImage), (resource|GdImage)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagecolorallocate expects resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php - - message: "#^Parameter \\#1 \\$im(age)? of function imagestring expects (resource|GdImage), (resource|GdImage)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$im of function imagestring expects resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php - - message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\MemoryDrawing\\:\\:setImageResource\\(\\) expects GdImage\\|resource, (GdImage|resource)\\|false given\\.$#" + message: "#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\MemoryDrawing\\:\\:setImageResource\\(\\) expects GdImage\\|resource, resource\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php - - message: "#^Parameter \\#6 \\$col(or)? of function imagestring expects int, int\\|false given\\.$#" + message: "#^Parameter \\#6 \\$col of function imagestring expects int, int\\|false given\\.$#" count: 1 path: tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php @@ -8655,16 +6120,6 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Worksheet/RowCellIterator2Test.php - - - message: "#^Cannot access offset 0 on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php - - - - message: "#^Cannot access offset 1 on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php - - message: "#^Method PhpOffice\\\\PhpSpreadsheetTests\\\\Writer\\\\Html\\\\CallbackTest\\:\\:yellowBody\\(\\) should return string but returns string\\|null\\.$#" count: 1 @@ -8690,76 +6145,11 @@ parameters: count: 1 path: tests/PhpSpreadsheetTests/Writer/Html/GridlinesTest.php - - - message: "#^Cannot call method getPlainText\\(\\) on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Html/HtmlCommentsTest.php - - message: "#^Cannot call method setBold\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\Font\\|null\\.$#" count: 3 path: tests/PhpSpreadsheetTests/Writer/Html/HtmlCommentsTest.php - - - message: "#^Parameter \\#1 \\$text of method PhpOffice\\\\PhpSpreadsheet\\\\Comment\\:\\:setText\\(\\) expects PhpOffice\\\\PhpSpreadsheet\\\\RichText\\\\RichText, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Html/HtmlCommentsTest.php - - - - message: "#^Parameter \\#1 \\$formatCode of method PhpOffice\\\\PhpSpreadsheet\\\\Style\\\\NumberFormat\\:\\:setFormatCode\\(\\) expects string, mixed given\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Writer/Html/HtmlNumberFormatTest.php - - - - message: "#^Cannot access offset 10 on mixed\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Cannot access offset 12 on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Cannot access offset 25 on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Cannot access offset 8 on mixed\\.$#" - count: 5 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Cannot access offset 9 on mixed\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Cannot access offset int\\|string\\|false on mixed\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Parameter \\#1 \\$(input|array) of function array_keys expects array, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Parameter \\#1 \\$palette of method PhpOffice\\\\PhpSpreadsheetTests\\\\Writer\\\\Xls\\\\WorkbookTest\\:\\:paletteToColor\\(\\) expects array, mixed given\\.$#" - count: 6 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#" - count: 2 - path: tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#" - count: 1 - path: tests/PhpSpreadsheetTests/Writer/Xlsx/LocaleFloatsTest.php - - message: "#^Cannot call method getCell\\(\\) on PhpOffice\\\\PhpSpreadsheet\\\\Worksheet\\\\Worksheet\\|null\\.$#" count: 4 diff --git a/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php b/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php index 5501039b9..c5d28dd6b 100644 --- a/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php +++ b/vendor/phpoffice/phpspreadsheet/phpstan-conditional.php @@ -42,7 +42,7 @@ if (PHP_VERSION_ID < 80000) { ]; // Erroneous analysis by Phpstan before PHP8 - mb_strlen does not return false $config['parameters']['ignoreErrors'][] = [ - 'message' => '#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:countCharacters\\(\\) should return int but returns int\\|false\\.$#', + 'message' => '#^Method PhpOffice\\\\PhpSpreadsheet\\\\Shared\\\\StringHelper\\:\\:countCharacters\\(\\) should return int but returns int(<0, max>)?\\|false\\.$#', 'path' => __DIR__ . '/src/PhpSpreadsheet/Shared/StringHelper.php', 'count' => 1, ]; diff --git a/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist b/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist index e975f21cf..e97e1ce84 100644 --- a/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist +++ b/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist @@ -5,7 +5,7 @@ includes: - vendor/phpstan/phpstan-phpunit/rules.neon parameters: - level: max + level: 8 paths: - src/ - tests/ diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php new file mode 100644 index 000000000..fa90017d9 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php @@ -0,0 +1,56 @@ +initialise($arguments); + } + + protected static function evaluateSingleArgumentArray(callable $method, array $values): array + { + $result = []; + foreach ($values as $value) { + $result[] = $method($value); + } + + return $result; + } + + /** + * @param mixed ...$arguments + */ + protected static function evaluateArrayArguments(callable $method, ...$arguments): array + { + self::initialiseHelper($arguments); + $arguments = self::$arrayArgumentHelper->arguments(); + + return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments); + } + + /** + * @param mixed ...$arguments + */ + protected static function evaluateArrayArgumentsSubset(callable $method, int $limit, ...$arguments): array + { + self::initialiseHelper(array_slice($arguments, 0, $limit)); + $trailingArguments = array_slice($arguments, $limit); + $arguments = self::$arrayArgumentHelper->arguments(); + $arguments = array_merge($arguments, $trailingArguments); + + return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments); + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php new file mode 100644 index 000000000..5d4f261fc --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php @@ -0,0 +1,181 @@ + '' && $operand1[0] == Calculation::FORMULA_STRING_QUOTE) { + $operand1 = Calculation::unwrapResult($operand1); + } + if (is_string($operand2) && $operand2 > '' && $operand2[0] == Calculation::FORMULA_STRING_QUOTE) { + $operand2 = Calculation::unwrapResult($operand2); + } + + // Use case insensitive comparaison if not OpenOffice mode + if (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) { + if (is_string($operand1)) { + $operand1 = StringHelper::strToUpper($operand1); + } + if (is_string($operand2)) { + $operand2 = StringHelper::strToUpper($operand2); + } + } + + $useLowercaseFirstComparison = is_string($operand1) && + is_string($operand2) && + Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE; + + return self::evaluateComparison($operand1, $operand2, $operator, $useLowercaseFirstComparison); + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function evaluateComparison($operand1, $operand2, string $operator, bool $useLowercaseFirstComparison): bool + { + switch ($operator) { + // Equality + case '=': + return self::equal($operand1, $operand2); + // Greater than + case '>': + return self::greaterThan($operand1, $operand2, $useLowercaseFirstComparison); + // Less than + case '<': + return self::lessThan($operand1, $operand2, $useLowercaseFirstComparison); + // Greater than or equal + case '>=': + return self::greaterThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison); + // Less than or equal + case '<=': + return self::lessThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison); + // Inequality + case '<>': + return self::notEqual($operand1, $operand2); + default: + throw new Exception('Unsupported binary comparison operator'); + } + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function equal($operand1, $operand2): bool + { + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = (abs($operand1 - $operand2) < self::DELTA); + } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) { + $result = $operand1 == $operand2; + } else { + $result = self::strcmpAllowNull($operand1, $operand2) == 0; + } + + return $result; + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function greaterThanOrEqual($operand1, $operand2, bool $useLowercaseFirstComparison): bool + { + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = ((abs($operand1 - $operand2) < self::DELTA) || ($operand1 > $operand2)); + } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) { + $result = $operand1 >= $operand2; + } elseif ($useLowercaseFirstComparison) { + $result = self::strcmpLowercaseFirst($operand1, $operand2) >= 0; + } else { + $result = self::strcmpAllowNull($operand1, $operand2) >= 0; + } + + return $result; + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function lessThanOrEqual($operand1, $operand2, bool $useLowercaseFirstComparison): bool + { + if (is_numeric($operand1) && is_numeric($operand2)) { + $result = ((abs($operand1 - $operand2) < self::DELTA) || ($operand1 < $operand2)); + } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) { + $result = $operand1 <= $operand2; + } elseif ($useLowercaseFirstComparison) { + $result = self::strcmpLowercaseFirst($operand1, $operand2) <= 0; + } else { + $result = self::strcmpAllowNull($operand1, $operand2) <= 0; + } + + return $result; + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function greaterThan($operand1, $operand2, bool $useLowercaseFirstComparison): bool + { + return self::lessThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison) !== true; + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function lessThan($operand1, $operand2, bool $useLowercaseFirstComparison): bool + { + return self::greaterThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison) !== true; + } + + /** + * @param mixed $operand1 + * @param mixed $operand2 + */ + private static function notEqual($operand1, $operand2): bool + { + return self::equal($operand1, $operand2) !== true; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php index 25f769590..f28d258e1 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php @@ -173,13 +173,6 @@ class Calculation */ public $cyclicFormulaCount = 1; - /** - * Epsilon Precision used for comparisons in calculations. - * - * @var float - */ - private $delta = 0.1e-12; - /** * The current locale setting. * @@ -223,7 +216,7 @@ class Calculation * * @var array */ - private static $excelConstants = [ + public static $excelConstants = [ 'TRUE' => true, 'FALSE' => false, 'NULL' => null, @@ -1041,7 +1034,7 @@ class Calculation 'FILTER' => [ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => [Functions::class, 'DUMMY'], - 'argumentCount' => '3+', + 'argumentCount' => '2-3', ], 'FILTERXML' => [ 'category' => Category::CATEGORY_WEB, @@ -2078,7 +2071,7 @@ class Calculation ], 'RANDARRAY' => [ 'category' => Category::CATEGORY_MATH_AND_TRIG, - 'functionCall' => [Functions::class, 'DUMMY'], + 'functionCall' => [MathTrig\Random::class, 'randArray'], 'argumentCount' => '0-5', ], 'RANDBETWEEN' => [ @@ -2220,8 +2213,8 @@ class Calculation ], 'SEQUENCE' => [ 'category' => Category::CATEGORY_MATH_AND_TRIG, - 'functionCall' => [Functions::class, 'DUMMY'], - 'argumentCount' => '2', + 'functionCall' => [MathTrig\MatrixFunctions::class, 'sequence'], + 'argumentCount' => '1-4', ], 'SERIESSUM' => [ 'category' => Category::CATEGORY_MATH_AND_TRIG, @@ -2759,8 +2752,6 @@ class Calculation public function __construct(?Spreadsheet $spreadsheet = null) { - $this->delta = 1 * 10 ** (0 - ini_get('precision')); - $this->spreadsheet = $spreadsheet; $this->cyclicReferenceStack = new CyclicReferenceStack(); $this->debugLog = new Logger($this->cyclicReferenceStack); @@ -3170,10 +3161,10 @@ class Calculation if (self::$functionReplaceFromExcel === null) { self::$functionReplaceFromExcel = []; foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/Ui'; + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/ui'; } foreach (array_keys(self::$localeBoolean) as $excelBoolean) { - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui'; + self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui'; } } @@ -3187,7 +3178,13 @@ class Calculation } } - return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator); + return self::translateFormula( + self::$functionReplaceFromExcel, + self::$functionReplaceToLocale, + $formula, + ',', + self::$localeArgumentSeparator + ); } private static $functionReplaceFromLocale; @@ -3199,10 +3196,10 @@ class Calculation if (self::$functionReplaceFromLocale === null) { self::$functionReplaceFromLocale = []; foreach (self::$localeFunctions as $localeFunctionName) { - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/Ui'; + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/ui'; } foreach (self::$localeBoolean as $excelBoolean) { - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui'; + self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui'; } } @@ -3742,6 +3739,8 @@ class Calculation return self::FORMULA_STRING_QUOTE . $value . self::FORMULA_STRING_QUOTE; } elseif (is_bool($value)) { return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; + } elseif ($value === null) { + return self::$localeBoolean['NULL']; } } @@ -4369,6 +4368,12 @@ class Calculation if (($operandData['reference'] === null) && (is_array($operand))) { $rKeys = array_keys($operand); $rowKey = array_shift($rKeys); + if (is_array($operand[$rowKey]) === false) { + $operandData['value'] = $operand[$rowKey]; + + return $operand[$rowKey]; + } + $cKeys = array_keys(array_keys($operand[$rowKey])); $colKey = array_shift($cKeys); if (ctype_upper("$colKey")) { @@ -4509,7 +4514,7 @@ class Calculation case '<=': // Less than or Equal to case '=': // Equality case '<>': // Inequality - $result = $this->executeBinaryComparisonOperation($cellID, $operand1, $operand2, $token, $stack); + $result = $this->executeBinaryComparisonOperation($operand1, $operand2, (string) $token, $stack); if (isset($storeKey)) { $branchStore[$storeKey] = $result; } @@ -4952,21 +4957,20 @@ class Calculation } /** - * @param null|string $cellID * @param mixed $operand1 * @param mixed $operand2 * @param string $operation * * @return array */ - private function executeArrayComparison($cellID, $operand1, $operand2, $operation, Stack &$stack, bool $recursingArrays) + private function executeArrayComparison($operand1, $operand2, $operation, Stack &$stack, bool $recursingArrays) { $result = []; if (!is_array($operand2)) { // Operand 1 is an array, Operand 2 is a scalar foreach ($operand1 as $x => $operandData) { $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2)); - $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2, $operation, $stack); + $this->executeBinaryComparisonOperation($operandData, $operand2, $operation, $stack); $r = $stack->pop(); $result[$x] = $r['value']; } @@ -4974,7 +4978,7 @@ class Calculation // Operand 1 is a scalar, Operand 2 is an array foreach ($operand2 as $x => $operandData) { $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operand1), ' ', $operation, ' ', $this->showValue($operandData)); - $this->executeBinaryComparisonOperation($cellID, $operand1, $operandData, $operation, $stack); + $this->executeBinaryComparisonOperation($operand1, $operandData, $operation, $stack); $r = $stack->pop(); $result[$x] = $r['value']; } @@ -4985,7 +4989,7 @@ class Calculation } foreach ($operand1 as $x => $operandData) { $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2[$x])); - $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2[$x], $operation, $stack, true); + $this->executeBinaryComparisonOperation($operandData, $operand2[$x], $operation, $stack, true); $r = $stack->pop(); $result[$x] = $r['value']; } @@ -4999,7 +5003,6 @@ class Calculation } /** - * @param null|string $cellID * @param mixed $operand1 * @param mixed $operand2 * @param string $operation @@ -5007,97 +5010,14 @@ class Calculation * * @return mixed */ - private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, Stack &$stack, $recursingArrays = false) + private function executeBinaryComparisonOperation($operand1, $operand2, $operation, Stack &$stack, $recursingArrays = false) { // If we're dealing with matrix operations, we want a matrix result if ((is_array($operand1)) || (is_array($operand2))) { - return $this->executeArrayComparison($cellID, $operand1, $operand2, $operation, $stack, $recursingArrays); + return $this->executeArrayComparison($operand1, $operand2, $operation, $stack, $recursingArrays); } - // Simple validate the two operands if they are string values - if (is_string($operand1) && $operand1 > '' && $operand1[0] == self::FORMULA_STRING_QUOTE) { - $operand1 = self::unwrapResult($operand1); - } - if (is_string($operand2) && $operand2 > '' && $operand2[0] == self::FORMULA_STRING_QUOTE) { - $operand2 = self::unwrapResult($operand2); - } - - // Use case insensitive comparaison if not OpenOffice mode - if (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) { - if (is_string($operand1)) { - $operand1 = Shared\StringHelper::strToUpper($operand1); - } - if (is_string($operand2)) { - $operand2 = Shared\StringHelper::strToUpper($operand2); - } - } - - $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE; - - // execute the necessary operation - switch ($operation) { - // Greater than - case '>': - if ($useLowercaseFirstComparison) { - $result = $this->strcmpLowercaseFirst($operand1, $operand2) > 0; - } else { - $result = ($operand1 > $operand2); - } - - break; - // Less than - case '<': - if ($useLowercaseFirstComparison) { - $result = $this->strcmpLowercaseFirst($operand1, $operand2) < 0; - } else { - $result = ($operand1 < $operand2); - } - - break; - // Equality - case '=': - if (is_numeric($operand1) && is_numeric($operand2)) { - $result = (abs($operand1 - $operand2) < $this->delta); - } else { - $result = $this->strcmpAllowNull($operand1, $operand2) == 0; - } - - break; - // Greater than or equal - case '>=': - if (is_numeric($operand1) && is_numeric($operand2)) { - $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 > $operand2)); - } elseif ($useLowercaseFirstComparison) { - $result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0; - } else { - $result = $this->strcmpAllowNull($operand1, $operand2) >= 0; - } - - break; - // Less than or equal - case '<=': - if (is_numeric($operand1) && is_numeric($operand2)) { - $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 < $operand2)); - } elseif ($useLowercaseFirstComparison) { - $result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0; - } else { - $result = $this->strcmpAllowNull($operand1, $operand2) <= 0; - } - - break; - // Inequality - case '<>': - if (is_numeric($operand1) && is_numeric($operand2)) { - $result = (abs($operand1 - $operand2) > 1E-14); - } else { - $result = $this->strcmpAllowNull($operand1, $operand2) != 0; - } - - break; - - default: - throw new Exception('Unsupported binary comparison operation'); - } + $result = BinaryComparison::compare($operand1, $operand2, $operation); // Log the result details $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); @@ -5107,35 +5027,6 @@ class Calculation return $result; } - /** - * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters. - * - * @param null|string $str1 First string value for the comparison - * @param null|string $str2 Second string value for the comparison - * - * @return int - */ - private function strcmpLowercaseFirst($str1, $str2) - { - $inversedStr1 = Shared\StringHelper::strCaseReverse($str1); - $inversedStr2 = Shared\StringHelper::strCaseReverse($str2); - - return strcmp($inversedStr1 ?? '', $inversedStr2 ?? ''); - } - - /** - * PHP8.1 deprecates passing null to strcmp. - * - * @param null|string $str1 First string value for the comparison - * @param null|string $str2 Second string value for the comparison - * - * @return int - */ - private function strcmpAllowNull($str1, $str2) - { - return strcmp($str1 ?? '', $str2 ?? ''); - } - /** * @param mixed $operand1 * @param mixed $operand2 diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php index 44a38c19e..79fa8dc0b 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php @@ -278,9 +278,9 @@ class DateTime * or a standard date string * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object * or a standard date string - * @param string $unit + * @param array|string $unit * - * @return int|string Interval between the dates + * @return array|int|string Interval between the dates */ public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D') { @@ -300,12 +300,12 @@ class DateTime * @See DateTimeExcel\Days::between() * Use the between method in the DateTimeExcel\Days class instead * - * @param DateTimeInterface|float|int|string $endDate Excel date serial value (float), + * @param array|DateTimeInterface|float|int|string $endDate Excel date serial value (float), * PHP date timestamp (integer), PHP DateTime object, or a standard date string - * @param DateTimeInterface|float|int|string $startDate Excel date serial value (float), + * @param array|DateTimeInterface|float|int|string $startDate Excel date serial value (float), * PHP date timestamp (integer), PHP DateTime object, or a standard date string * - * @return int|string Number of days between start date and end date or an error + * @return array|int|string Number of days between start date and end date or an error */ public static function DAYS($endDate = 0, $startDate = 0) { @@ -331,7 +331,7 @@ class DateTime * PHP DateTime object, or a standard date string * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param bool $method US or European Method + * @param array|bool $method US or European Method * FALSE or omitted: U.S. (NASD) method. If the starting date is * the last day of a month, it becomes equal to the 30th of the * same month. If the ending date is the last day of a month and @@ -343,7 +343,7 @@ class DateTime * occur on the 31st of a month become equal to the 30th of the * same month. * - * @return int|string Number of days between start date and end date + * @return array|int|string Number of days between start date and end date */ public static function DAYS360($startDate = 0, $endDate = 0, $method = false) { @@ -373,14 +373,14 @@ class DateTime * PHP DateTime object, or a standard date string * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $method Method used for the calculation + * @param array|int $method Method used for the calculation * 0 or omitted US (NASD) 30/360 * 1 Actual/actual * 2 Actual/360 * 3 Actual/365 * 4 European 30/360 * - * @return float|string fraction of the year, or a string containing an error + * @return array|float|string fraction of the year, or a string containing an error */ public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) { @@ -409,7 +409,7 @@ class DateTime * PHP DateTime object, or a standard date string * @param mixed $dateArgs * - * @return int|string Interval between the dates + * @return array|int|string Interval between the dates */ public static function NETWORKDAYS($startDate, $endDate, ...$dateArgs) { @@ -464,7 +464,7 @@ class DateTime * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string * - * @return int|string Day of the month + * @return array|int|string Day of the month */ public static function DAYOFMONTH($dateValue = 1) { @@ -492,7 +492,7 @@ class DateTime * 2 Numbers 1 (Monday) through 7 (Sunday). * 3 Numbers 0 (Monday) through 6 (Sunday). * - * @return int|string Day of the week value + * @return array|int|string Day of the week value */ public static function WEEKDAY($dateValue = 1, $style = 1) { @@ -704,7 +704,7 @@ class DateTime * 17 Week begins on Sunday. * 21 ISO (Jan. 4 is week 1, begins on Monday). * - * @return int|string Week Number + * @return array|int|string Week Number */ public static function WEEKNUM($dateValue = 1, $method = self::STARTWEEK_SUNDAY) { @@ -727,7 +727,7 @@ class DateTime * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string * - * @return int|string Week Number + * @return array|int|string Week Number */ public static function ISOWEEKNUM($dateValue = 1) { @@ -751,7 +751,7 @@ class DateTime * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string * - * @return int|string Month of the year + * @return array|int|string Month of the year */ public static function MONTHOFYEAR($dateValue = 1) { @@ -775,7 +775,7 @@ class DateTime * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string * - * @return int|string Year + * @return array|int|string Year */ public static function YEAR($dateValue = 1) { @@ -799,7 +799,7 @@ class DateTime * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string * - * @return int|string Hour + * @return array|int|string Hour */ public static function HOUROFDAY($timeValue = 0) { @@ -823,7 +823,7 @@ class DateTime * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string * - * @return int|string Minute + * @return array|int|string Minute */ public static function MINUTE($timeValue = 0) { @@ -847,7 +847,7 @@ class DateTime * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string * - * @return int|string Second + * @return array|int|string Second */ public static function SECOND($timeValue = 0) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php index d18e2371c..b1c1ece84 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php @@ -2,6 +2,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; @@ -9,6 +10,8 @@ use PhpOffice\PhpSpreadsheet\Shared\StringHelper; class Date { + use ArrayEnabled; + /** * DATE. * @@ -24,7 +27,7 @@ class Date * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted, * as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language. * - * @param int $year The value of the year argument can include one to four digits. + * @param array|int $year The value of the year argument can include one to four digits. * Excel interprets the year argument according to the configured * date system: 1900 or 1904. * If year is between 0 (zero) and 1899 (inclusive), Excel adds that @@ -35,7 +38,7 @@ class Date * 2008. * If year is less than 0 or is 10000 or greater, Excel returns the * #NUM! error value. - * @param int $month A positive or negative integer representing the month of the year + * @param array|int $month A positive or negative integer representing the month of the year * from 1 to 12 (January to December). * If month is greater than 12, month adds that number of months to * the first month in the year specified. For example, DATE(2008,14,2) @@ -44,7 +47,7 @@ class Date * number of months, plus 1, from the first month in the year * specified. For example, DATE(2008,-3,2) returns the serial number * representing September 2, 2007. - * @param int $day A positive or negative integer representing the day of the month + * @param array|int $day A positive or negative integer representing the day of the month * from 1 to 31. * If day is greater than the number of days in the month specified, * day adds that number of days to the first day in the month. For @@ -57,9 +60,15 @@ class Date * * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function fromYMD($year, $month, $day) { + if (is_array($year) || is_array($month) || is_array($day)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $year, $month, $day); + } + $baseYear = SharedDateHelper::getExcelCalendar(); try { @@ -84,7 +93,6 @@ class Date */ private static function getYear($year, int $baseYear): int { - $year = Functions::flattenSingleValue($year); $year = ($year !== null) ? StringHelper::testStringAsNumeric((string) $year) : 0; if (!is_numeric($year)) { throw new Exception(Functions::VALUE()); @@ -112,8 +120,6 @@ class Date */ private static function getMonth($month): int { - $month = Functions::flattenSingleValue($month); - if (($month !== null) && (!is_numeric($month))) { $month = SharedDateHelper::monthStringToNumber($month); } @@ -133,8 +139,6 @@ class Date */ private static function getDay($day): int { - $day = Functions::flattenSingleValue($day); - if (($day !== null) && (!is_numeric($day))) { $day = SharedDateHelper::dayStringToNumber($day); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php index 37ea03151..b669eb0a1 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class DateParts { + use ArrayEnabled; + /** * DAYOFMONTH. * @@ -19,11 +22,18 @@ class DateParts * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * - * @return int|string Day of the month + * @return array|int|string Day of the month + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function day($dateValue) { + if (is_array($dateValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); + } + $weirdResult = self::weirdCondition($dateValue); if ($weirdResult >= 0) { return $weirdResult; @@ -52,11 +62,18 @@ class DateParts * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * - * @return int|string Month of the year + * @return array|int|string Month of the year + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function month($dateValue) { + if (is_array($dateValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); + } + try { $dateValue = Helpers::getDateValue($dateValue); } catch (Exception $e) { @@ -83,11 +100,18 @@ class DateParts * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * - * @return int|string Year + * @return array|int|string Year + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function year($dateValue) { + if (is_array($dateValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); + } + try { $dateValue = Helpers::getDateValue($dateValue); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php index 3b2155062..47a68cf9e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php @@ -3,11 +3,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use DateTimeImmutable; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class DateValue { + use ArrayEnabled; + /** * DATEVALUE. * @@ -21,7 +24,7 @@ class DateValue * Excel Function: * DATEVALUE(dateValue) * - * @param string $dateValue Text that represents a date in a Microsoft Excel date format. + * @param array|string $dateValue Text that represents a date in a Microsoft Excel date format. * For example, "1/30/2008" or "30-Jan-2008" are text strings within * quotation marks that represent dates. Using the default date * system in Excel for Windows, date_text must represent a date from @@ -29,15 +32,22 @@ class DateValue * system in Excel for the Macintosh, date_text must represent a date * from January 1, 1904, to December 31, 9999. DATEVALUE returns the * #VALUE! error value if date_text is out of this range. + * Or can be an array of date values * * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function fromString($dateValue) { + if (is_array($dateValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); + } + $dti = new DateTimeImmutable(); $baseYear = SharedDateHelper::getExcelCalendar(); - $dateValue = trim(Functions::flattenSingleValue($dateValue ?? ''), '"'); + $dateValue = trim($dateValue ?? '', '"'); // Strip any ordinals because they're allowed in Excel (English only) $dateValue = preg_replace('/(\d)(st|nd|rd|th)([ -\/])/Ui', '$1$3', $dateValue) ?? ''; // Convert separators (/ . or space) to hyphens (should also handle dot used for ordinals in some countries, e.g. Denmark, Germany) diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php index 5a97d8df8..5392b2c38 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php @@ -3,12 +3,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use DateTimeInterface; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class Days { + use ArrayEnabled; + /** * DAYS. * @@ -17,15 +20,23 @@ class Days * Excel Function: * DAYS(endDate, startDate) * - * @param DateTimeInterface|float|int|string $endDate Excel date serial value (float), - * PHP date timestamp (integer), PHP DateTime object, or a standard date string - * @param DateTimeInterface|float|int|string $startDate Excel date serial value (float), - * PHP date timestamp (integer), PHP DateTime object, or a standard date string + * @param array|DateTimeInterface|float|int|string $endDate Excel date serial value (float), + * PHP date timestamp (integer), PHP DateTime object, or a standard date string + * Or can be an array of date values + * @param array|DateTimeInterface|float|int|string $startDate Excel date serial value (float), + * PHP date timestamp (integer), PHP DateTime object, or a standard date string + * Or can be an array of date values * - * @return int|string Number of days between start date and end date or an error + * @return array|int|string Number of days between start date and end date or an error + * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result + * will also be an array with matching dimensions */ public static function between($endDate, $startDate) { + if (is_array($endDate) || is_array($startDate)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $endDate, $startDate); + } + try { $startDate = Helpers::getDateValue($startDate); $endDate = Helpers::getDateValue($endDate); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php index bbc5d16aa..2220aaeec 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class Days360 { + use ArrayEnabled; + /** * DAYS360. * @@ -18,11 +21,13 @@ class Days360 * Excel Function: * DAYS360(startDate,endDate[,method]) * - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * @param array|mixed $startDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), + * Or can be an array of date values + * @param array|mixed $endDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param mixed $method US or European Method as a bool + * Or can be an array of date values + * @param array|mixed $method US or European Method as a bool * FALSE or omitted: U.S. (NASD) method. If the starting date is * the last day of a month, it becomes equal to the 30th of the * same month. If the ending date is the last day of a month and @@ -33,11 +38,18 @@ class Days360 * TRUE: European method. Starting dates and ending dates that * occur on the 31st of a month become equal to the 30th of the * same month. + * Or can be an array of methods * - * @return int|string Number of days between start date and end date + * @return array|int|string Number of days between start date and end date + * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result + * will also be an array with matching dimensions */ public static function between($startDate = 0, $endDate = 0, $method = false) { + if (is_array($startDate) || is_array($endDate) || is_array($method)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $startDate, $endDate, $method); + } + try { $startDate = Helpers::getDateValue($startDate); $endDate = Helpers::getDateValue($endDate); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php index 6adeca179..4dd782639 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php @@ -4,30 +4,42 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use DateInterval; use DateTime; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class Difference { + use ArrayEnabled; + /** * DATEDIF. * * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object * or a standard date string + * Or can be an array of date values * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object * or a standard date string - * @param string $unit + * Or can be an array of date values + * @param array|string $unit + * Or can be an array of unit values * - * @return int|string Interval between the dates + * @return array|int|string Interval between the dates + * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result + * will also be an array with matching dimensions */ public static function interval($startDate, $endDate, $unit = 'D') { + if (is_array($startDate) || is_array($endDate) || is_array($unit)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $startDate, $endDate, $unit); + } + try { $startDate = Helpers::getDateValue($startDate); $endDate = Helpers::getDateValue($endDate); $difference = self::initialDiff($startDate, $endDate); - $unit = strtoupper(Functions::flattenSingleValue($unit)); + $unit = strtoupper($unit); } catch (Exception $e) { return $e->getMessage(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php index 560b7a807..c72d006b9 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Month { + use ArrayEnabled; + /** * EDATE. * @@ -19,15 +22,23 @@ class Month * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $adjustmentMonths The number of months before or after start_date. + * Or can be an array of date values + * @param array|int $adjustmentMonths The number of months before or after start_date. * A positive value for months yields a future date; * a negative value yields a past date. + * Or can be an array of adjustment values * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * @return array|mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function adjust($dateValue, $adjustmentMonths) { + if (is_array($dateValue) || is_array($adjustmentMonths)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths); + } + try { $dateValue = Helpers::getDateValue($dateValue, false); $adjustmentMonths = Helpers::validateNumericNull($adjustmentMonths); @@ -54,15 +65,23 @@ class Month * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $adjustmentMonths The number of months before or after start_date. + * Or can be an array of date values + * @param array|int $adjustmentMonths The number of months before or after start_date. * A positive value for months yields a future date; * a negative value yields a past date. + * Or can be an array of adjustment values * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * @return array|mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function lastDay($dateValue, $adjustmentMonths) { + if (is_array($dateValue) || is_array($adjustmentMonths)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths); + } + try { $dateValue = Helpers::getDateValue($dateValue, false); $adjustmentMonths = Helpers::validateNumericNull($adjustmentMonths); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php index d0f53cf39..3b8942baf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class NetworkDays { + use ArrayEnabled; + /** * NETWORKDAYS. * @@ -20,14 +23,28 @@ class NetworkDays * * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param mixed $dateArgs + * Or can be an array of date values + * @param mixed $dateArgs An array of dates (such as holidays) to exclude from the calculation * - * @return int|string Interval between the dates + * @return array|int|string Interval between the dates + * If an array of values is passed for the $startDate or $endDate arguments, then the returned result + * will also be an array with matching dimensions */ public static function count($startDate, $endDate, ...$dateArgs) { + if (is_array($startDate) || is_array($endDate)) { + return self::evaluateArrayArgumentsSubset( + [self::class, __FUNCTION__], + 2, + $startDate, + $endDate, + ...$dateArgs + ); + } + try { // Retrieve the mandatory start and end date that are referenced in the function definition $sDate = Helpers::getDateValue($startDate); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php index fb5e49652..f5e685f49 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php @@ -3,12 +3,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use DateTime; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class Time { + use ArrayEnabled; + /** * TIME. * @@ -20,23 +23,31 @@ class Time * Excel Function: * TIME(hour,minute,second) * - * @param mixed $hour A number from 0 (zero) to 32767 representing the hour. + * @param array|int $hour A number from 0 (zero) to 32767 representing the hour. * Any value greater than 23 will be divided by 24 and the remainder * will be treated as the hour value. For example, TIME(27,0,0) = * TIME(3,0,0) = .125 or 3:00 AM. - * @param mixed $minute A number from 0 to 32767 representing the minute. + * @param array|int $minute A number from 0 to 32767 representing the minute. * Any value greater than 59 will be converted to hours and minutes. * For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM. - * @param mixed $second A number from 0 to 32767 representing the second. + * @param array|int $second A number from 0 to 32767 representing the second. * Any value greater than 59 will be converted to hours, minutes, * and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 * or 12:33:20 AM + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * @return array|mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function fromHMS($hour, $minute, $second) { + if (is_array($hour) || is_array($minute) || is_array($second)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $hour, $minute, $second); + } + try { $hour = self::toIntWithNullBool($hour); $minute = self::toIntWithNullBool($minute); @@ -105,7 +116,6 @@ class Time */ private static function toIntWithNullBool($value): int { - $value = Functions::flattenSingleValue($value); $value = $value ?? 0; if (is_bool($value)) { $value = (int) $value; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php index 49cd983d8..d9b99f3c3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php @@ -2,12 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; -use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class TimeParts { + use ArrayEnabled; + /** * HOUROFDAY. * @@ -19,13 +21,19 @@ class TimeParts * * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string + * Or can be an array of date/time values * - * @return int|string Hour + * @return array|int|string Hour + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function hour($timeValue) { + if (is_array($timeValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue); + } + try { - $timeValue = Functions::flattenSingleValue($timeValue); Helpers::nullFalseTrueToNumber($timeValue); if (!is_numeric($timeValue)) { $timeValue = Helpers::getTimeValue($timeValue); @@ -53,13 +61,19 @@ class TimeParts * * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string + * Or can be an array of date/time values * - * @return int|string Minute + * @return array|int|string Minute + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function minute($timeValue) { + if (is_array($timeValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue); + } + try { - $timeValue = Functions::flattenSingleValue($timeValue); Helpers::nullFalseTrueToNumber($timeValue); if (!is_numeric($timeValue)) { $timeValue = Helpers::getTimeValue($timeValue); @@ -87,13 +101,19 @@ class TimeParts * * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard time string + * Or can be an array of date/time values * - * @return int|string Second + * @return array|int|string Second + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function second($timeValue) { + if (is_array($timeValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue); + } + try { - $timeValue = Functions::flattenSingleValue($timeValue); Helpers::nullFalseTrueToNumber($timeValue); if (!is_numeric($timeValue)) { $timeValue = Helpers::getTimeValue($timeValue); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php index c9645e665..f57c9f005 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php @@ -3,11 +3,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use Datetime; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class TimeValue { + use ArrayEnabled; + /** * TIMEVALUE. * @@ -21,17 +24,24 @@ class TimeValue * Excel Function: * TIMEVALUE(timeValue) * - * @param string $timeValue A text string that represents a time in any one of the Microsoft + * @param array|string $timeValue A text string that represents a time in any one of the Microsoft * Excel time formats; for example, "6:45 PM" and "18:45" text strings * within quotation marks that represent time. * Date information in time_text is ignored. + * Or can be an array of date/time values * * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function fromString($timeValue) { - $timeValue = trim(Functions::flattenSingleValue($timeValue ?? ''), '"'); + if (is_array($timeValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue); + } + + $timeValue = trim($timeValue ?? '', '"'); $timeValue = str_replace(['/', '.'], '-', $timeValue); $arraySplit = preg_split('/[\/:\-\s]/', $timeValue) ?: []; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php index 663622210..c6ca0f816 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php @@ -3,12 +3,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use DateTime; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class Week { + use ArrayEnabled; + /** * WEEKNUM. * @@ -24,7 +27,8 @@ class Week * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $method Week begins on Sunday or Monday + * Or can be an array of date values + * @param array|int $method Week begins on Sunday or Monday * 1 or omitted Week begins on Sunday. * 2 Week begins on Monday. * 11 Week begins on Monday. @@ -35,11 +39,18 @@ class Week * 16 Week begins on Saturday. * 17 Week begins on Sunday. * 21 ISO (Jan. 4 is week 1, begins on Monday). + * Or can be an array of methods * - * @return int|string Week Number + * @return array|int|string Week Number + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function number($dateValue, $method = Constants::STARTWEEK_SUNDAY) { + if (is_array($dateValue) || is_array($method)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $method); + } + $origDateValueNull = empty($dateValue); try { @@ -88,11 +99,18 @@ class Week * * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * - * @return int|string Week Number + * @return array|int|string Week Number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function isoWeekNumber($dateValue) { + if (is_array($dateValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue); + } + if (self::apparentBug($dateValue)) { return 52; } @@ -119,17 +137,25 @@ class Week * Excel Function: * WEEKDAY(dateValue[,style]) * - * @param null|float|int|string $dateValue Excel date serial value (float), PHP date timestamp (integer), + * @param null|array|float|int|string $dateValue Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of date values * @param mixed $style A number that determines the type of return value * 1 or omitted Numbers 1 (Sunday) through 7 (Saturday). * 2 Numbers 1 (Monday) through 7 (Sunday). * 3 Numbers 0 (Monday) through 6 (Sunday). + * Or can be an array of styles * - * @return int|string Day of the week value + * @return array|int|string Day of the week value + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function day($dateValue, $style = 1) { + if (is_array($dateValue) || is_array($style)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $style); + } + try { $dateValue = Helpers::getDateValue($dateValue); $style = self::validateStyle($style); @@ -165,8 +191,6 @@ class Week */ private static function validateStyle($style): int { - $style = Functions::flattenSingleValue($style); - if (!is_numeric($style)) { throw new Exception(Functions::VALUE()); } @@ -225,7 +249,7 @@ class Week if ($method === null) { $method = Constants::STARTWEEK_SUNDAY; } - $method = Functions::flattenSingleValue($method); + if (!is_numeric($method)) { throw new Exception(Functions::VALUE()); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php index 89e47b969..1f5735e8e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class WorkDay { + use ArrayEnabled; + /** * WORKDAY. * @@ -18,27 +21,37 @@ class WorkDay * Excel Function: * WORKDAY(startDate,endDays[,holidays[,holiday[,...]]]) * - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), + * @param array|mixed $startDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $endDays The number of nonweekend and nonholiday days before or after + * Or can be an array of date values + * @param array|int $endDays The number of nonweekend and nonholiday days before or after * startDate. A positive value for days yields a future date; a * negative value yields a past date. - * @param mixed $dateArgs + * Or can be an array of int values + * @param null|mixed $dateArgs An array of dates (such as holidays) to exclude from the calculation * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, + * @return array|mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, * depending on the value of the ReturnDateType flag + * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result + * will also be an array with matching dimensions */ public static function date($startDate, $endDays, ...$dateArgs) { + if (is_array($startDate) || is_array($endDays)) { + return self::evaluateArrayArgumentsSubset( + [self::class, __FUNCTION__], + 2, + $startDate, + $endDays, + ...$dateArgs + ); + } + // Retrieve the mandatory start date and days that are referenced in the function definition try { $startDate = Helpers::getDateValue($startDate); $endDays = Helpers::validateNumericNull($endDays); - $dateArgs = Functions::flattenArray($dateArgs); - $holidayArray = []; - foreach ($dateArgs as $holidayDate) { - $holidayArray[] = Helpers::getDateValue($holidayDate); - } + $holidayArray = array_map([Helpers::class, 'getDateValue'], Functions::flattenArray($dateArgs)); } catch (Exception $e) { return $e->getMessage(); } @@ -64,9 +77,8 @@ class WorkDay private static function incrementing(float $startDate, int $endDays, array $holidayArray) { // Adjust the start date if it falls over a weekend - $startDoW = self::getWeekDay($startDate, 3); - if (self::getWeekDay($startDate, 3) >= 5) { + if ($startDoW >= 5) { $startDate += 7 - $startDoW; --$endDays; } @@ -126,9 +138,8 @@ class WorkDay private static function decrementing(float $startDate, int $endDays, array $holidayArray) { // Adjust the start date if it falls over a weekend - $startDoW = self::getWeekDay($startDate, 3); - if (self::getWeekDay($startDate, 3) >= 5) { + if ($startDoW >= 5) { $startDate += -$startDoW + 4; ++$endDays; } @@ -172,6 +183,7 @@ class WorkDay } // Adjust the calculated end date if it falls over a weekend $endDoW = self::getWeekDay($endDate, 3); + /** int $endDoW */ if ($endDoW >= 5) { $endDate += -$endDoW + 4; } @@ -182,8 +194,8 @@ class WorkDay private static function getWeekDay(float $date, int $wd): int { - $result = Week::day($date, $wd); + $result = Functions::scalar(Week::day($date, $wd)); - return is_string($result) ? -1 : $result; + return is_int($result) ? $result : -1; } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php index da2ac12fc..8dad16d8c 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDateHelper; class YearFrac { + use ArrayEnabled; + /** * YEARFRAC. * @@ -23,19 +26,28 @@ class YearFrac * * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string + * Or can be an array of values * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer), * PHP DateTime object, or a standard date string - * @param int $method Method used for the calculation + * Or can be an array of methods + * @param array|int $method Method used for the calculation * 0 or omitted US (NASD) 30/360 * 1 Actual/actual * 2 Actual/360 * 3 Actual/365 * 4 European 30/360 + * Or can be an array of methods * - * @return float|string fraction of the year, or a string containing an error + * @return array|float|string fraction of the year, or a string containing an error + * If an array of values is passed for the $startDate or $endDays,arguments, then the returned result + * will also be an array with matching dimensions */ public static function fraction($startDate, $endDate, $method = 0) { + if (is_array($startDate) || is_array($endDate) || is_array($method)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $startDate, $endDate, $method); + } + try { $method = (int) Helpers::validateNumericNull($method); $sDate = Helpers::getDateValue($startDate); @@ -50,15 +62,15 @@ class YearFrac switch ($method) { case 0: - return Days360::between($startDate, $endDate) / 360; + return Functions::scalar(Days360::between($startDate, $endDate)) / 360; case 1: return self::method1($startDate, $endDate); case 2: - return Difference::interval($startDate, $endDate) / 360; + return Functions::scalar(Difference::interval($startDate, $endDate)) / 360; case 3: - return Difference::interval($startDate, $endDate) / 365; + return Functions::scalar(Difference::interval($startDate, $endDate)) / 365; case 4: - return Days360::between($startDate, $endDate, true) / 360; + return Functions::scalar(Days360::between($startDate, $endDate, true)) / 360; } return Functions::NAN(); @@ -87,7 +99,7 @@ class YearFrac private static function method1(float $startDate, float $endDate): float { - $days = Difference::interval($startDate, $endDate); + $days = Functions::scalar(Difference::interval($startDate, $endDate)); $startYear = (int) DateParts::year($startDate); $endYear = (int) DateParts::year($endDate); $years = $endYear - $startYear + 1; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php new file mode 100644 index 000000000..df413f209 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php @@ -0,0 +1,202 @@ +rows = $this->rows($arguments); + $this->columns = $this->columns($arguments); + + $this->argumentCount = count($arguments); + $this->arguments = $this->flattenSingleCellArrays($arguments, $this->rows, $this->columns); + + $this->rows = $this->rows($arguments); + $this->columns = $this->columns($arguments); + + if ($this->arrayArguments() > 2) { + throw new Exception('Formulae with more than two array arguments are not supported'); + } + } + + public function arguments(): array + { + return $this->arguments; + } + + public function hasArrayArgument(): bool + { + return $this->arrayArguments() > 0; + } + + public function getFirstArrayArgumentNumber(): int + { + $rowArrays = $this->filterArray($this->rows); + $columnArrays = $this->filterArray($this->columns); + + for ($index = 0; $index < $this->argumentCount; ++$index) { + if (isset($rowArrays[$index]) || isset($columnArrays[$index])) { + return ++$index; + } + } + + return 0; + } + + public function getSingleRowVector(): ?int + { + $rowVectors = $this->getRowVectors(); + + return count($rowVectors) === 1 ? array_pop($rowVectors) : null; + } + + private function getRowVectors(): array + { + $rowVectors = []; + for ($index = 0; $index < $this->argumentCount; ++$index) { + if ($this->rows[$index] === 1 && $this->columns[$index] > 1) { + $rowVectors[] = $index; + } + } + + return $rowVectors; + } + + public function getSingleColumnVector(): ?int + { + $columnVectors = $this->getColumnVectors(); + + return count($columnVectors) === 1 ? array_pop($columnVectors) : null; + } + + private function getColumnVectors(): array + { + $columnVectors = []; + for ($index = 0; $index < $this->argumentCount; ++$index) { + if ($this->rows[$index] > 1 && $this->columns[$index] === 1) { + $columnVectors[] = $index; + } + } + + return $columnVectors; + } + + public function getMatrixPair(): array + { + for ($i = 0; $i < ($this->argumentCount - 1); ++$i) { + for ($j = $i + 1; $j < $this->argumentCount; ++$j) { + if (isset($this->rows[$i], $this->rows[$j])) { + return [$i, $j]; + } + } + } + + return []; + } + + public function isVector(int $argument): bool + { + return $this->rows[$argument] === 1 || $this->columns[$argument] === 1; + } + + public function isRowVector(int $argument): bool + { + return $this->rows[$argument] === 1; + } + + public function isColumnVector(int $argument): bool + { + return $this->columns[$argument] === 1; + } + + public function rowCount(int $argument): int + { + return $this->rows[$argument]; + } + + public function columnCount(int $argument): int + { + return $this->columns[$argument]; + } + + private function rows(array $arguments): array + { + return array_map( + function ($argument) { + return is_countable($argument) ? count($argument) : 1; + }, + $arguments + ); + } + + private function columns(array $arguments): array + { + return array_map( + function ($argument) { + return is_array($argument) && is_array($argument[array_keys($argument)[0]]) + ? count($argument[array_keys($argument)[0]]) + : 1; + }, + $arguments + ); + } + + public function arrayArguments(): int + { + $count = 0; + foreach (array_keys($this->arguments) as $argument) { + if ($this->rows[$argument] > 1 || $this->columns[$argument] > 1) { + ++$count; + } + } + + return $count; + } + + private function flattenSingleCellArrays(array $arguments, array $rows, array $columns): array + { + foreach ($arguments as $index => $argument) { + if ($rows[$index] === 1 && $columns[$index] === 1) { + while (is_array($argument)) { + $argument = array_pop($argument); + } + $arguments[$index] = $argument; + } + } + + return $arguments; + } + + private function filterArray(array $array): array + { + return array_filter( + $array, + function ($value) { + return $value > 1; + } + ); + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php new file mode 100644 index 000000000..4e377fe52 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php @@ -0,0 +1,174 @@ +hasArrayArgument() === false) { + return [$method(...$arguments)]; + } + + if (self::$arrayArgumentHelper->arrayArguments() === 1) { + $nthArgument = self::$arrayArgumentHelper->getFirstArrayArgumentNumber(); + + return self::evaluateNthArgumentAsArray($method, $nthArgument, ...$arguments); + } + + $singleRowVectorIndex = self::$arrayArgumentHelper->getSingleRowVector(); + $singleColumnVectorIndex = self::$arrayArgumentHelper->getSingleColumnVector(); + if ($singleRowVectorIndex !== null && $singleColumnVectorIndex !== null) { + // Basic logic for a single row vector and a single column vector + return self::evaluateVectorPair($method, $singleRowVectorIndex, $singleColumnVectorIndex, ...$arguments); + } + + $matrixPair = self::$arrayArgumentHelper->getMatrixPair(); + if ($matrixPair !== []) { + if ( + (self::$arrayArgumentHelper->isVector($matrixPair[0]) === true && + self::$arrayArgumentHelper->isVector($matrixPair[1]) === false) || + (self::$arrayArgumentHelper->isVector($matrixPair[0]) === false && + self::$arrayArgumentHelper->isVector($matrixPair[1]) === true) + ) { + // Logic for a matrix and a vector (row or column) + return self::evaluateVectorMatrixPair($method, $matrixPair, ...$arguments); + } + // Logic for matrix/matrix, column vector/column vector or row vector/row vector + return self::evaluateMatrixPair($method, $matrixPair, ...$arguments); + } + + // Still need to work out the logic for more than two array arguments, + // For the moment, we're throwing an Exception when we initialise the ArrayArgumentHelper + return ['#VALUE!']; + } + + /** + * @param mixed ...$arguments + */ + private static function evaluateVectorMatrixPair(callable $method, array $matrixIndexes, ...$arguments): array + { + $matrix2 = array_pop($matrixIndexes); + /** @var array $matrixValues2 */ + $matrixValues2 = $arguments[$matrix2]; + $matrix1 = array_pop($matrixIndexes); + /** @var array $matrixValues1 */ + $matrixValues1 = $arguments[$matrix1]; + + $rows = min(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2])); + $columns = min(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2])); + + if ($rows === 1) { + $rows = max(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2])); + } + if ($columns === 1) { + $columns = max(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2])); + } + + $result = []; + for ($rowIndex = 0; $rowIndex < $rows; ++$rowIndex) { + for ($columnIndex = 0; $columnIndex < $columns; ++$columnIndex) { + $rowIndex1 = self::$arrayArgumentHelper->isRowVector($matrix1) ? 0 : $rowIndex; + $columnIndex1 = self::$arrayArgumentHelper->isColumnVector($matrix1) ? 0 : $columnIndex; + $value1 = $matrixValues1[$rowIndex1][$columnIndex1]; + $rowIndex2 = self::$arrayArgumentHelper->isRowVector($matrix2) ? 0 : $rowIndex; + $columnIndex2 = self::$arrayArgumentHelper->isColumnVector($matrix2) ? 0 : $columnIndex; + $value2 = $matrixValues2[$rowIndex2][$columnIndex2]; + $arguments[$matrix1] = $value1; + $arguments[$matrix2] = $value2; + + $result[$rowIndex][$columnIndex] = $method(...$arguments); + } + } + + return $result; + } + + /** + * @param mixed ...$arguments + */ + private static function evaluateMatrixPair(callable $method, array $matrixIndexes, ...$arguments): array + { + $matrix2 = array_pop($matrixIndexes); + /** @var array $matrixValues2 */ + $matrixValues2 = $arguments[$matrix2]; + $matrix1 = array_pop($matrixIndexes); + /** @var array $matrixValues1 */ + $matrixValues1 = $arguments[$matrix1]; + + $result = []; + foreach ($matrixValues1 as $rowIndex => $row) { + foreach ($row as $columnIndex => $value1) { + if (isset($matrixValues2[$rowIndex][$columnIndex]) === false) { + continue; + } + + $value2 = $matrixValues2[$rowIndex][$columnIndex]; + $arguments[$matrix1] = $value1; + $arguments[$matrix2] = $value2; + + $result[$rowIndex][$columnIndex] = $method(...$arguments); + } + } + + return $result; + } + + /** + * @param mixed ...$arguments + */ + private static function evaluateVectorPair(callable $method, int $rowIndex, int $columnIndex, ...$arguments): array + { + $rowVector = Functions::flattenArray($arguments[$rowIndex]); + $columnVector = Functions::flattenArray($arguments[$columnIndex]); + + $result = []; + foreach ($columnVector as $column) { + $rowResults = []; + foreach ($rowVector as $row) { + $arguments[$rowIndex] = $row; + $arguments[$columnIndex] = $column; + + $rowResults[] = $method(...$arguments); + } + $result[] = $rowResults; + } + + return $result; + } + + /** + * Note, offset is from 1 (for the first argument) rather than from 0. + * + * @param mixed ...$arguments + */ + private static function evaluateNthArgumentAsArray(callable $method, int $nthArgument, ...$arguments): array + { + $values = array_slice($arguments, $nthArgument - 1, 1); + /** @var array $values */ + $values = array_pop($values); + + $result = []; + foreach ($values as $value) { + $arguments[$nthArgument - 1] = $value; + $result[] = $method(...$arguments); + } + + return $result; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php index a70ddac5c..d70b32d6a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php @@ -61,7 +61,7 @@ class Engineering * If $ord is nonnumeric, BESSELI returns the #VALUE! error value. * If $ord < 0, BESSELI returns the #NUM! error value. * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error */ public static function BESSELI($x, $ord) { @@ -86,7 +86,7 @@ class Engineering * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value. * If $ord < 0, BESSELJ returns the #NUM! error value. * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error */ public static function BESSELJ($x, $ord) { @@ -112,7 +112,7 @@ class Engineering * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. * If $ord < 0, BESSELK returns the #NUM! error value. * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error */ public static function BESSELK($x, $ord) { @@ -137,7 +137,7 @@ class Engineering * If $ord is nonnumeric, BESSELY returns the #VALUE! error value. * If $ord < 0, BESSELY returns the #NUM! error value. * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error */ public static function BESSELY($x, $ord) { @@ -163,7 +163,7 @@ class Engineering * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2DEC returns the #NUM! error value. * - * @return string + * @return array|string */ public static function BINTODEC($x) { @@ -195,7 +195,7 @@ class Engineering * If places is nonnumeric, BIN2HEX returns the #VALUE! error value. * If places is negative, BIN2HEX returns the #NUM! error value. * - * @return string + * @return array|string */ public static function BINTOHEX($x, $places = null) { @@ -227,7 +227,7 @@ class Engineering * If places is nonnumeric, BIN2OCT returns the #VALUE! error value. * If places is negative, BIN2OCT returns the #NUM! error value. * - * @return string + * @return array|string */ public static function BINTOOCT($x, $places = null) { @@ -263,7 +263,7 @@ class Engineering * If places is nonnumeric, DEC2BIN returns the #VALUE! error value. * If places is zero or negative, DEC2BIN returns the #NUM! error value. * - * @return string + * @return array|string */ public static function DECTOBIN($x, $places = null) { @@ -299,7 +299,7 @@ class Engineering * If places is nonnumeric, DEC2HEX returns the #VALUE! error value. * If places is zero or negative, DEC2HEX returns the #NUM! error value. * - * @return string + * @return array|string */ public static function DECTOHEX($x, $places = null) { @@ -335,7 +335,7 @@ class Engineering * If places is nonnumeric, DEC2OCT returns the #VALUE! error value. * If places is zero or negative, DEC2OCT returns the #NUM! error value. * - * @return string + * @return array|string */ public static function DECTOOCT($x, $places = null) { @@ -371,7 +371,7 @@ class Engineering * If places is nonnumeric, HEX2BIN returns the #VALUE! error value. * If places is negative, HEX2BIN returns the #NUM! error value. * - * @return string + * @return array|string */ public static function HEXTOBIN($x, $places = null) { @@ -398,7 +398,7 @@ class Engineering * If number is not a valid hexadecimal number, HEX2DEC returns the * #NUM! error value. * - * @return string + * @return array|string */ public static function HEXTODEC($x) { @@ -438,7 +438,7 @@ class Engineering * value. * If places is negative, HEX2OCT returns the #NUM! error value. * - * @return string + * @return array|string */ public static function HEXTOOCT($x, $places = null) { @@ -480,7 +480,7 @@ class Engineering * If places is negative, OCT2BIN returns the #NUM! error * value. * - * @return string + * @return array|string */ public static function OCTTOBIN($x, $places = null) { @@ -507,7 +507,7 @@ class Engineering * If number is not a valid octal number, OCT2DEC returns the * #NUM! error value. * - * @return string + * @return array|string */ public static function OCTTODEC($x) { @@ -544,7 +544,7 @@ class Engineering * If places is nonnumeric, OCT2HEX returns the #VALUE! error value. * If places is negative, OCT2HEX returns the #NUM! error value. * - * @return string + * @return array|string */ public static function OCTTOHEX($x, $places = null) { @@ -563,12 +563,12 @@ class Engineering * * @see Use the COMPLEX() method in the Engineering\Complex class instead * - * @param float $realNumber the real coefficient of the complex number - * @param float $imaginary the imaginary coefficient of the complex number - * @param string $suffix The suffix for the imaginary component of the complex number. + * @param array|float $realNumber the real coefficient of the complex number + * @param array|float $imaginary the imaginary coefficient of the complex number + * @param array|string $suffix The suffix for the imaginary component of the complex number. * If omitted, the suffix is assumed to be "i". * - * @return string + * @return array|string */ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i') { @@ -590,7 +590,7 @@ class Engineering * @param string $complexNumber the complex number for which you want the imaginary * coefficient * - * @return float|string + * @return array|float|string */ public static function IMAGINARY($complexNumber) { @@ -611,7 +611,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the real coefficient * - * @return float|string + * @return array|float|string */ public static function IMREAL($complexNumber) { @@ -632,7 +632,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the absolute value * - * @return float|string + * @return array|float|string */ public static function IMABS($complexNumber) { @@ -652,9 +652,9 @@ class Engineering * * @see Use the IMARGUMENT() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the argument theta + * @param array|string $complexNumber the complex number for which you want the argument theta * - * @return float|string + * @return array|float|string */ public static function IMARGUMENT($complexNumber) { @@ -673,9 +673,9 @@ class Engineering * * @see Use the IMARGUMENT() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the conjugate + * @param array|string $complexNumber the complex number for which you want the conjugate * - * @return string + * @return array|string */ public static function IMCONJUGATE($complexNumber) { @@ -694,9 +694,9 @@ class Engineering * * @see Use the IMCOS() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the cosine + * @param array|string $complexNumber the complex number for which you want the cosine * - * @return float|string + * @return array|float|string */ public static function IMCOS($complexNumber) { @@ -715,9 +715,9 @@ class Engineering * * @see Use the IMCOSH() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the hyperbolic cosine + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosine * - * @return float|string + * @return array|float|string */ public static function IMCOSH($complexNumber) { @@ -736,9 +736,9 @@ class Engineering * * @see Use the IMCOT() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the cotangent + * @param array|string $complexNumber the complex number for which you want the cotangent * - * @return float|string + * @return array|float|string */ public static function IMCOT($complexNumber) { @@ -757,9 +757,9 @@ class Engineering * * @see Use the IMCSC() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the cosecant + * @param array|string $complexNumber the complex number for which you want the cosecant * - * @return float|string + * @return array|float|string */ public static function IMCSC($complexNumber) { @@ -778,9 +778,9 @@ class Engineering * * @see Use the IMCSCH() method in the Engineering\ComplexFunctions class instead * - * @param string $complexNumber the complex number for which you want the hyperbolic cosecant + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosecant * - * @return float|string + * @return array|float|string */ public static function IMCSCH($complexNumber) { @@ -801,7 +801,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the sine * - * @return float|string + * @return array|float|string */ public static function IMSIN($complexNumber) { @@ -822,7 +822,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the hyperbolic sine * - * @return float|string + * @return array|float|string */ public static function IMSINH($complexNumber) { @@ -843,7 +843,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the secant * - * @return float|string + * @return array|float|string */ public static function IMSEC($complexNumber) { @@ -864,7 +864,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the hyperbolic secant * - * @return float|string + * @return array|float|string */ public static function IMSECH($complexNumber) { @@ -885,7 +885,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the tangent * - * @return float|string + * @return array|float|string */ public static function IMTAN($complexNumber) { @@ -906,7 +906,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the square root * - * @return string + * @return array|string */ public static function IMSQRT($complexNumber) { @@ -927,7 +927,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the natural logarithm * - * @return string + * @return array|string */ public static function IMLN($complexNumber) { @@ -948,7 +948,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the common logarithm * - * @return string + * @return array|string */ public static function IMLOG10($complexNumber) { @@ -969,7 +969,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the base-2 logarithm * - * @return string + * @return array|string */ public static function IMLOG2($complexNumber) { @@ -990,7 +990,7 @@ class Engineering * * @param string $complexNumber the complex number for which you want the exponential * - * @return string + * @return array|string */ public static function IMEXP($complexNumber) { @@ -1012,7 +1012,7 @@ class Engineering * @param string $complexNumber the complex number you want to raise to a power * @param float $realNumber the power to which you want to raise the complex number * - * @return string + * @return array|string */ public static function IMPOWER($complexNumber, $realNumber) { @@ -1034,7 +1034,7 @@ class Engineering * @param string $complexDividend the complex numerator or dividend * @param string $complexDivisor the complex denominator or divisor * - * @return string + * @return array|string */ public static function IMDIV($complexDividend, $complexDivisor) { @@ -1056,7 +1056,7 @@ class Engineering * @param string $complexNumber1 the complex number from which to subtract complexNumber2 * @param string $complexNumber2 the complex number to subtract from complexNumber1 * - * @return string + * @return array|string */ public static function IMSUB($complexNumber1, $complexNumber2) { @@ -1123,7 +1123,7 @@ class Engineering * @param float $a the first number * @param float $b The second number. If omitted, b is assumed to be zero. * - * @return int|string (string in the event of an error) + * @return array|int|string (string in the event of an error) */ public static function DELTA($a, $b = 0) { @@ -1147,7 +1147,7 @@ class Engineering * @param float $number the value to test against step * @param float $step The threshold value. If you omit a value for step, GESTEP uses zero. * - * @return int|string (string in the event of an error) + * @return array|int|string (string in the event of an error) */ public static function GESTEP($number, $step = 0) { @@ -1169,7 +1169,7 @@ class Engineering * @param int $number1 * @param int $number2 * - * @return int|string + * @return array|int|string */ public static function BITAND($number1, $number2) { @@ -1191,7 +1191,7 @@ class Engineering * @param int $number1 * @param int $number2 * - * @return int|string + * @return array|int|string */ public static function BITOR($number1, $number2) { @@ -1213,7 +1213,7 @@ class Engineering * @param int $number1 * @param int $number2 * - * @return int|string + * @return array|int|string */ public static function BITXOR($number1, $number2) { @@ -1235,7 +1235,7 @@ class Engineering * @param int $number * @param int $shiftAmount * - * @return int|string + * @return array|float|int|string */ public static function BITLSHIFT($number, $shiftAmount) { @@ -1257,7 +1257,7 @@ class Engineering * @param int $number * @param int $shiftAmount * - * @return int|string + * @return array|float|int|string */ public static function BITRSHIFT($number, $shiftAmount) { @@ -1285,7 +1285,7 @@ class Engineering * @param float $upper upper bound for integrating ERF. * If omitted, ERF integrates between zero and lower_limit * - * @return float|string + * @return array|float|string */ public static function ERF($lower, $upper = null) { @@ -1306,7 +1306,7 @@ class Engineering * * @param float $limit bound for integrating ERF * - * @return float|string + * @return array|float|string */ public static function ERFPRECISE($limit) { @@ -1332,7 +1332,7 @@ class Engineering * * @param float $x The lower bound for integrating ERFC * - * @return float|string + * @return array|float|string */ public static function ERFC($x) { @@ -1437,7 +1437,7 @@ class Engineering * @param string $fromUOM the units for value * @param string $toUOM the units for the result * - * @return float|string + * @return array|float|string */ public static function CONVERTUOM($value, $fromUOM, $toUOM) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php index ea2577cdf..24145aa9d 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class BesselI { + use ArrayEnabled; + /** * BESSELI. * @@ -21,17 +24,22 @@ class BesselI * * @param mixed $x A float value at which to evaluate the function. * If x is nonnumeric, BESSELI returns the #VALUE! error value. + * Or can be an array of values * @param mixed $ord The integer order of the Bessel function. * If ord is not an integer, it is truncated. * If $ord is nonnumeric, BESSELI returns the #VALUE! error value. * If $ord < 0, BESSELI returns the #NUM! error value. + * Or can be an array of values * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BESSELI($x, $ord) { - $x = Functions::flattenSingleValue($x); - $ord = Functions::flattenSingleValue($ord); + if (is_array($x) || is_array($ord)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $ord); + } try { $x = EngineeringValidations::validateFloat($x); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php index 7ea45a74f..4b6a79e94 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class BesselJ { + use ArrayEnabled; + /** * BESSELJ. * @@ -20,17 +23,22 @@ class BesselJ * * @param mixed $x A float value at which to evaluate the function. * If x is nonnumeric, BESSELJ returns the #VALUE! error value. + * Or can be an array of values * @param mixed $ord The integer order of the Bessel function. * If ord is not an integer, it is truncated. * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value. * If $ord < 0, BESSELJ returns the #NUM! error value. + * Or can be an array of values * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BESSELJ($x, $ord) { - $x = Functions::flattenSingleValue($x); - $ord = Functions::flattenSingleValue($ord); + if (is_array($x) || is_array($ord)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $ord); + } try { $x = EngineeringValidations::validateFloat($x); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php index 8facdffc7..977eadf80 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class BesselK { + use ArrayEnabled; + /** * BESSELK. * @@ -18,17 +21,22 @@ class BesselK * * @param mixed $x A float value at which to evaluate the function. * If x is nonnumeric, BESSELK returns the #VALUE! error value. + * Or can be an array of values * @param mixed $ord The integer order of the Bessel function. * If ord is not an integer, it is truncated. * If $ord is nonnumeric, BESSELK returns the #VALUE! error value. * If $ord < 0, BESSELKI returns the #NUM! error value. + * Or can be an array of values * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BESSELK($x, $ord) { - $x = Functions::flattenSingleValue($x); - $ord = Functions::flattenSingleValue($ord); + if (is_array($x) || is_array($ord)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $ord); + } try { $x = EngineeringValidations::validateFloat($x); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php index 7f3874971..2b373bd2a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class BesselY { + use ArrayEnabled; + /** * BESSELY. * @@ -17,17 +20,22 @@ class BesselY * * @param mixed $x A float value at which to evaluate the function. * If x is nonnumeric, BESSELY returns the #VALUE! error value. + * Or can be an array of values * @param mixed $ord The integer order of the Bessel function. * If ord is not an integer, it is truncated. * If $ord is nonnumeric, BESSELY returns the #VALUE! error value. * If $ord < 0, BESSELY returns the #NUM! error value. + * Or can be an array of values * - * @return float|string Result, or a string containing an error + * @return array|float|string Result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BESSELY($x, $ord) { - $x = Functions::flattenSingleValue($x); - $ord = Functions::flattenSingleValue($ord); + if (is_array($x) || is_array($ord)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $ord); + } try { $x = EngineeringValidations::validateFloat($x); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php index 9958f054f..3041a41c4 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class BitWise { + use ArrayEnabled; + const SPLIT_DIVISOR = 2 ** 24; /** @@ -27,13 +30,21 @@ class BitWise * Excel Function: * BITAND(number1, number2) * - * @param int $number1 - * @param int $number2 + * @param array|int $number1 + * Or can be an array of values + * @param array|int $number2 + * Or can be an array of values * - * @return int|string + * @return array|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BITAND($number1, $number2) { + if (is_array($number1) || is_array($number2)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); + } + try { $number1 = self::validateBitwiseArgument($number1); $number2 = self::validateBitwiseArgument($number2); @@ -54,13 +65,21 @@ class BitWise * Excel Function: * BITOR(number1, number2) * - * @param int $number1 - * @param int $number2 + * @param array|int $number1 + * Or can be an array of values + * @param array|int $number2 + * Or can be an array of values * - * @return int|string + * @return array|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BITOR($number1, $number2) { + if (is_array($number1) || is_array($number2)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); + } + try { $number1 = self::validateBitwiseArgument($number1); $number2 = self::validateBitwiseArgument($number2); @@ -82,13 +101,21 @@ class BitWise * Excel Function: * BITXOR(number1, number2) * - * @param int $number1 - * @param int $number2 + * @param array|int $number1 + * Or can be an array of values + * @param array|int $number2 + * Or can be an array of values * - * @return int|string + * @return array|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BITXOR($number1, $number2) { + if (is_array($number1) || is_array($number2)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2); + } + try { $number1 = self::validateBitwiseArgument($number1); $number2 = self::validateBitwiseArgument($number2); @@ -110,13 +137,21 @@ class BitWise * Excel Function: * BITLSHIFT(number, shift_amount) * - * @param int $number - * @param int $shiftAmount + * @param array|int $number + * Or can be an array of values + * @param array|int $shiftAmount + * Or can be an array of values * - * @return float|int|string + * @return array|float|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BITLSHIFT($number, $shiftAmount) { + if (is_array($number) || is_array($shiftAmount)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount); + } + try { $number = self::validateBitwiseArgument($number); $shiftAmount = self::validateShiftAmount($shiftAmount); @@ -140,13 +175,21 @@ class BitWise * Excel Function: * BITRSHIFT(number, shift_amount) * - * @param int $number - * @param int $shiftAmount + * @param array|int $number + * Or can be an array of values + * @param array|int $shiftAmount + * Or can be an array of values * - * @return float|int|string + * @return array|float|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function BITRSHIFT($number, $shiftAmount) { + if (is_array($number) || is_array($shiftAmount)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount); + } + try { $number = self::validateBitwiseArgument($number); $shiftAmount = self::validateShiftAmount($shiftAmount); @@ -171,7 +214,7 @@ class BitWise */ private static function validateBitwiseArgument($value) { - self::nullFalseTrueToNumber($value); + $value = self::nullFalseTrueToNumber($value); if (is_numeric($value)) { if ($value == floor($value)) { @@ -197,7 +240,7 @@ class BitWise */ private static function validateShiftAmount($value) { - self::nullFalseTrueToNumber($value); + $value = self::nullFalseTrueToNumber($value); if (is_numeric($value)) { if (abs($value) > 53) { @@ -214,14 +257,17 @@ class BitWise * Many functions accept null/false/true argument treated as 0/0/1. * * @param mixed $number + * + * @return mixed */ - public static function nullFalseTrueToNumber(&$number): void + private static function nullFalseTrueToNumber(&$number) { - $number = Functions::flattenSingleValue($number); if ($number === null) { $number = 0; } elseif (is_bool($number)) { $number = (int) $number; } + + return $number; } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php index 0a6342069..4d4bc07e3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php @@ -2,11 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; -use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Compare { + use ArrayEnabled; + /** * DELTA. * @@ -18,15 +20,20 @@ class Compare * functions you calculate the count of equal pairs. This function is also known as the * Kronecker Delta function. * - * @param float $a the first number - * @param float $b The second number. If omitted, b is assumed to be zero. + * @param array|float $a the first number + * Or can be an array of values + * @param array|float $b The second number. If omitted, b is assumed to be zero. + * Or can be an array of values * - * @return int|string (string in the event of an error) + * @return array|int|string (string in the event of an error) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function DELTA($a, $b = 0) + public static function DELTA($a, $b = 0.0) { - $a = Functions::flattenSingleValue($a); - $b = Functions::flattenSingleValue($b); + if (is_array($a) || is_array($b)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $a, $b); + } try { $a = EngineeringValidations::validateFloat($a); @@ -35,7 +42,7 @@ class Compare return $e->getMessage(); } - return (int) ($a == $b); + return (int) (abs($a - $b) < 1.0e-15); } /** @@ -48,15 +55,20 @@ class Compare * Use this function to filter a set of values. For example, by summing several GESTEP * functions you calculate the count of values that exceed a threshold. * - * @param float $number the value to test against step - * @param float $step The threshold value. If you omit a value for step, GESTEP uses zero. + * @param array|float $number the value to test against step + * Or can be an array of values + * @param array|float $step The threshold value. If you omit a value for step, GESTEP uses zero. + * Or can be an array of values * - * @return int|string (string in the event of an error) + * @return array|int|string (string in the event of an error) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function GESTEP($number, $step = 0) + public static function GESTEP($number, $step = 0.0) { - $number = Functions::flattenSingleValue($number); - $step = Functions::flattenSingleValue($step); + if (is_array($number) || is_array($step)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $step); + } try { $number = EngineeringValidations::validateFloat($number); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php index 1c2f5f773..37bc08769 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php @@ -4,11 +4,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; use Complex\Complex as ComplexObject; use Complex\Exception as ComplexException; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Complex { + use ArrayEnabled; + /** * COMPLEX. * @@ -18,17 +21,26 @@ class Complex * COMPLEX(realNumber,imaginary[,suffix]) * * @param mixed $realNumber the real float coefficient of the complex number + * Or can be an array of values * @param mixed $imaginary the imaginary float coefficient of the complex number + * Or can be an array of values * @param mixed $suffix The character suffix for the imaginary component of the complex number. * If omitted, the suffix is assumed to be "i". + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i') { - $realNumber = ($realNumber === null) ? 0.0 : Functions::flattenSingleValue($realNumber); - $imaginary = ($imaginary === null) ? 0.0 : Functions::flattenSingleValue($imaginary); - $suffix = ($suffix === null) ? 'i' : Functions::flattenSingleValue($suffix); + if (is_array($realNumber) || is_array($imaginary) || is_array($suffix)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $realNumber, $imaginary, $suffix); + } + + $realNumber = $realNumber ?? 0.0; + $imaginary = $imaginary ?? 0.0; + $suffix = $suffix ?? 'i'; try { $realNumber = EngineeringValidations::validateFloat($realNumber); @@ -54,14 +66,19 @@ class Complex * Excel Function: * IMAGINARY(complexNumber) * - * @param string $complexNumber the complex number for which you want the imaginary + * @param array|string $complexNumber the complex number for which you want the imaginary * coefficient + * Or can be an array of values * - * @return float|string + * @return array|float|string (string if an error) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMAGINARY($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -80,13 +97,18 @@ class Complex * Excel Function: * IMREAL(complexNumber) * - * @param string $complexNumber the complex number for which you want the real coefficient + * @param array|string $complexNumber the complex number for which you want the real coefficient + * Or can be an array of values * - * @return float|string + * @return array|float|string (string if an error) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMREAL($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php index 3f37f373f..f05d4bd8c 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php @@ -4,10 +4,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; use Complex\Complex as ComplexObject; use Complex\Exception as ComplexException; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class ComplexFunctions { + use ArrayEnabled; + /** * IMABS. * @@ -16,13 +19,18 @@ class ComplexFunctions * Excel Function: * IMABS(complexNumber) * - * @param string $complexNumber the complex number for which you want the absolute value + * @param array|string $complexNumber the complex number for which you want the absolute value + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMABS($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -42,13 +50,18 @@ class ComplexFunctions * Excel Function: * IMARGUMENT(complexNumber) * - * @param string $complexNumber the complex number for which you want the argument theta + * @param array|string $complexNumber the complex number for which you want the argument theta + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMARGUMENT($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -71,13 +84,18 @@ class ComplexFunctions * Excel Function: * IMCONJUGATE(complexNumber) * - * @param string $complexNumber the complex number for which you want the conjugate + * @param array|string $complexNumber the complex number for which you want the conjugate + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCONJUGATE($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -96,13 +114,18 @@ class ComplexFunctions * Excel Function: * IMCOS(complexNumber) * - * @param string $complexNumber the complex number for which you want the cosine + * @param array|string $complexNumber the complex number for which you want the cosine + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCOS($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -121,13 +144,18 @@ class ComplexFunctions * Excel Function: * IMCOSH(complexNumber) * - * @param string $complexNumber the complex number for which you want the hyperbolic cosine + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosine + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCOSH($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -146,13 +174,18 @@ class ComplexFunctions * Excel Function: * IMCOT(complexNumber) * - * @param string $complexNumber the complex number for which you want the cotangent + * @param array|string $complexNumber the complex number for which you want the cotangent + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCOT($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -171,13 +204,18 @@ class ComplexFunctions * Excel Function: * IMCSC(complexNumber) * - * @param string $complexNumber the complex number for which you want the cosecant + * @param array|string $complexNumber the complex number for which you want the cosecant + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCSC($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -196,13 +234,18 @@ class ComplexFunctions * Excel Function: * IMCSCH(complexNumber) * - * @param string $complexNumber the complex number for which you want the hyperbolic cosecant + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosecant + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMCSCH($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -221,13 +264,18 @@ class ComplexFunctions * Excel Function: * IMSIN(complexNumber) * - * @param string $complexNumber the complex number for which you want the sine + * @param array|string $complexNumber the complex number for which you want the sine + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSIN($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -246,13 +294,18 @@ class ComplexFunctions * Excel Function: * IMSINH(complexNumber) * - * @param string $complexNumber the complex number for which you want the hyperbolic sine + * @param array|string $complexNumber the complex number for which you want the hyperbolic sine + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSINH($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -271,13 +324,18 @@ class ComplexFunctions * Excel Function: * IMSEC(complexNumber) * - * @param string $complexNumber the complex number for which you want the secant + * @param array|string $complexNumber the complex number for which you want the secant + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSEC($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -296,13 +354,18 @@ class ComplexFunctions * Excel Function: * IMSECH(complexNumber) * - * @param string $complexNumber the complex number for which you want the hyperbolic secant + * @param array|string $complexNumber the complex number for which you want the hyperbolic secant + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSECH($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -321,13 +384,18 @@ class ComplexFunctions * Excel Function: * IMTAN(complexNumber) * - * @param string $complexNumber the complex number for which you want the tangent + * @param array|string $complexNumber the complex number for which you want the tangent + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMTAN($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -346,13 +414,18 @@ class ComplexFunctions * Excel Function: * IMSQRT(complexNumber) * - * @param string $complexNumber the complex number for which you want the square root + * @param array|string $complexNumber the complex number for which you want the square root + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSQRT($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -376,13 +449,18 @@ class ComplexFunctions * Excel Function: * IMLN(complexNumber) * - * @param string $complexNumber the complex number for which you want the natural logarithm + * @param array|string $complexNumber the complex number for which you want the natural logarithm + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMLN($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -405,13 +483,18 @@ class ComplexFunctions * Excel Function: * IMLOG10(complexNumber) * - * @param string $complexNumber the complex number for which you want the common logarithm + * @param array|string $complexNumber the complex number for which you want the common logarithm + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMLOG10($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -434,13 +517,18 @@ class ComplexFunctions * Excel Function: * IMLOG2(complexNumber) * - * @param string $complexNumber the complex number for which you want the base-2 logarithm + * @param array|string $complexNumber the complex number for which you want the base-2 logarithm + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMLOG2($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -463,13 +551,18 @@ class ComplexFunctions * Excel Function: * IMEXP(complexNumber) * - * @param string $complexNumber the complex number for which you want the exponential + * @param array|string $complexNumber the complex number for which you want the exponential + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMEXP($complexNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); + if (is_array($complexNumber)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -488,15 +581,20 @@ class ComplexFunctions * Excel Function: * IMPOWER(complexNumber,realNumber) * - * @param string $complexNumber the complex number you want to raise to a power - * @param float $realNumber the power to which you want to raise the complex number + * @param array|string $complexNumber the complex number you want to raise to a power + * Or can be an array of values + * @param array|float|int|string $realNumber the power to which you want to raise the complex number + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMPOWER($complexNumber, $realNumber) { - $complexNumber = Functions::flattenSingleValue($complexNumber); - $realNumber = Functions::flattenSingleValue($realNumber); + if (is_array($complexNumber) || is_array($realNumber)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $complexNumber, $realNumber); + } try { $complex = new ComplexObject($complexNumber); @@ -508,6 +606,6 @@ class ComplexFunctions return Functions::VALUE(); } - return (string) $complex->pow($realNumber); + return (string) $complex->pow((float) $realNumber); } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php index 681aad8ca..a921be61e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php @@ -4,10 +4,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; use Complex\Complex as ComplexObject; use Complex\Exception as ComplexException; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class ComplexOperations { + use ArrayEnabled; + /** * IMDIV. * @@ -16,15 +19,20 @@ class ComplexOperations * Excel Function: * IMDIV(complexDividend,complexDivisor) * - * @param string $complexDividend the complex numerator or dividend - * @param string $complexDivisor the complex denominator or divisor + * @param array|string $complexDividend the complex numerator or dividend + * Or can be an array of values + * @param array|string $complexDivisor the complex denominator or divisor + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMDIV($complexDividend, $complexDivisor) { - $complexDividend = Functions::flattenSingleValue($complexDividend); - $complexDivisor = Functions::flattenSingleValue($complexDivisor); + if (is_array($complexDividend) || is_array($complexDivisor)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $complexDividend, $complexDivisor); + } try { return (string) (new ComplexObject($complexDividend))->divideby(new ComplexObject($complexDivisor)); @@ -41,15 +49,20 @@ class ComplexOperations * Excel Function: * IMSUB(complexNumber1,complexNumber2) * - * @param string $complexNumber1 the complex number from which to subtract complexNumber2 - * @param string $complexNumber2 the complex number to subtract from complexNumber1 + * @param array|string $complexNumber1 the complex number from which to subtract complexNumber2 + * Or can be an array of values + * @param array|string $complexNumber2 the complex number to subtract from complexNumber1 + * Or can be an array of values * - * @return string + * @return array|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function IMSUB($complexNumber1, $complexNumber2) { - $complexNumber1 = Functions::flattenSingleValue($complexNumber1); - $complexNumber2 = Functions::flattenSingleValue($complexNumber2); + if (is_array($complexNumber1) || is_array($complexNumber2)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $complexNumber1, $complexNumber2); + } try { return (string) (new ComplexObject($complexNumber1))->subtract(new ComplexObject($complexNumber2)); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php index a095690d1..4a7419750 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; -class ConvertBase +abstract class ConvertBase { + use ArrayEnabled; + protected static function validateValue($value): string { if (is_bool($value)) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php index a662b78de..5f1be4546 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php @@ -15,17 +15,26 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2DEC(x) * - * @param string $value The binary number (as a string) that you want to convert. The number + * @param array|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2DEC returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toDecimal($value): string + public static function toDecimal($value) { + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateBinary($value); } catch (Exception $e) { return $e->getMessage(); @@ -49,25 +58,35 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2HEX(x[,places]) * - * @param string $value The binary number (as a string) that you want to convert. The number + * @param array|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2HEX returns the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, BIN2HEX uses the + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, BIN2HEX uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, BIN2HEX returns the #VALUE! error value. * If places is negative, BIN2HEX returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toHex($value, $places = null): string + public static function toHex($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateBinary($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } @@ -92,25 +111,35 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2OCT(x[,places]) * - * @param string $value The binary number (as a string) that you want to convert. The number + * @param array|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2OCT returns the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, BIN2OCT uses the + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, BIN2OCT uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, BIN2OCT returns the #VALUE! error value. * If places is negative, BIN2OCT returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toOctal($value, $places = null): string + public static function toOctal($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateBinary($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php index a34332fb3..6a8767865 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php @@ -22,7 +22,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2BIN(x[,places]) * - * @param string $value The decimal integer you want to convert. If number is negative, + * @param array|string $value The decimal integer you want to convert. If number is negative, * valid place values are ignored and DEC2BIN returns a 10-character * (10-bit) binary number in which the most significant bit is the sign * bit. The remaining 9 bits are magnitude bits. Negative numbers are @@ -32,19 +32,29 @@ class ConvertDecimal extends ConvertBase * If number is nonnumeric, DEC2BIN returns the #VALUE! error value. * If DEC2BIN requires more than places characters, it returns the #NUM! * error value. - * @param int $places The number of characters to use. If places is omitted, DEC2BIN uses + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, DEC2BIN uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, DEC2BIN returns the #VALUE! error value. * If places is zero or negative, DEC2BIN returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toBinary($value, $places = null): string + public static function toBinary($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateDecimal($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } @@ -69,7 +79,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2HEX(x[,places]) * - * @param string $value The decimal integer you want to convert. If number is negative, + * @param array|string $value The decimal integer you want to convert. If number is negative, * places is ignored and DEC2HEX returns a 10-character (40-bit) * hexadecimal number in which the most significant bit is the sign * bit. The remaining 39 bits are magnitude bits. Negative numbers @@ -79,19 +89,29 @@ class ConvertDecimal extends ConvertBase * If number is nonnumeric, DEC2HEX returns the #VALUE! error value. * If DEC2HEX requires more than places characters, it returns the * #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, DEC2HEX uses + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, DEC2HEX uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, DEC2HEX returns the #VALUE! error value. * If places is zero or negative, DEC2HEX returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toHex($value, $places = null): string + public static function toHex($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateDecimal($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } @@ -135,7 +155,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2OCT(x[,places]) * - * @param string $value The decimal integer you want to convert. If number is negative, + * @param array|string $value The decimal integer you want to convert. If number is negative, * places is ignored and DEC2OCT returns a 10-character (30-bit) * octal number in which the most significant bit is the sign bit. * The remaining 29 bits are magnitude bits. Negative numbers are @@ -145,19 +165,29 @@ class ConvertDecimal extends ConvertBase * If number is nonnumeric, DEC2OCT returns the #VALUE! error value. * If DEC2OCT requires more than places characters, it returns the * #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, DEC2OCT uses + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, DEC2OCT uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, DEC2OCT returns the #VALUE! error value. * If places is zero or negative, DEC2OCT returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toOctal($value, $places = null): string + public static function toOctal($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateDecimal($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php index de1b0704f..12c99521b 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php @@ -15,7 +15,7 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2BIN(x[,places]) * - * @param string $value The hexadecimal number you want to convert. + * @param array|string $value The hexadecimal number you want to convert. * Number cannot contain more than 10 characters. * The most significant bit of number is the sign bit (40th bit from the right). * The remaining 9 bits are magnitude bits. @@ -25,19 +25,29 @@ class ConvertHex extends ConvertBase * and if number is positive, it cannot be greater than 1FF. * If number is not a valid hexadecimal number, HEX2BIN returns the #NUM! error value. * If HEX2BIN requires more than places characters, it returns the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, * HEX2BIN uses the minimum number of characters necessary. Places * is useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, HEX2BIN returns the #VALUE! error value. * If places is negative, HEX2BIN returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toBinary($value, $places = null): string + public static function toBinary($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateHex($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } @@ -55,18 +65,27 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2DEC(x) * - * @param string $value The hexadecimal number you want to convert. This number cannot + * @param array|string $value The hexadecimal number you want to convert. This number cannot * contain more than 10 characters (40 bits). The most significant * bit of number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement * notation. * If number is not a valid hexadecimal number, HEX2DEC returns the * #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toDecimal($value): string + public static function toDecimal($value) { + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateHex($value); } catch (Exception $e) { return $e->getMessage(); @@ -99,7 +118,7 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2OCT(x[,places]) * - * @param string $value The hexadecimal number you want to convert. Number cannot + * @param array|string $value The hexadecimal number you want to convert. Number cannot * contain more than 10 characters. The most significant bit of * number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement @@ -112,20 +131,30 @@ class ConvertHex extends ConvertBase * the #NUM! error value. * If HEX2OCT requires more than places characters, it returns * the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, HEX2OCT + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, HEX2OCT * uses the minimum number of characters necessary. Places is * useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, HEX2OCT returns the #VALUE! error * value. * If places is negative, HEX2OCT returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toOctal($value, $places = null): string + public static function toOctal($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateHex($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php index 1181e2ee1..3c3af5c14 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php @@ -15,7 +15,7 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2BIN(x[,places]) * - * @param string $value The octal number you want to convert. Number may not + * @param array|string $value The octal number you want to convert. Number may not * contain more than 10 characters. The most significant * bit of number is the sign bit. The remaining 29 bits * are magnitude bits. Negative numbers are represented @@ -28,7 +28,8 @@ class ConvertOctal extends ConvertBase * the #NUM! error value. * If OCT2BIN requires more than places characters, it * returns the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, * OCT2BIN uses the minimum number of characters necessary. * Places is useful for padding the return value with * leading 0s (zeros). @@ -37,13 +38,22 @@ class ConvertOctal extends ConvertBase * error value. * If places is negative, OCT2BIN returns the #NUM! error * value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toBinary($value, $places = null): string + public static function toBinary($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateOctal($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } @@ -59,18 +69,27 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2DEC(x) * - * @param string $value The octal number you want to convert. Number may not contain + * @param array|string $value The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using * two's-complement notation. * If number is not a valid octal number, OCT2DEC returns the * #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toDecimal($value): string + public static function toDecimal($value) { + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateOctal($value); } catch (Exception $e) { return $e->getMessage(); @@ -99,7 +118,7 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2HEX(x[,places]) * - * @param string $value The octal number you want to convert. Number may not contain + * @param array|string $value The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using @@ -110,25 +129,35 @@ class ConvertOctal extends ConvertBase * #NUM! error value. * If OCT2HEX requires more than places characters, it returns * the #NUM! error value. - * @param int $places The number of characters to use. If places is omitted, OCT2HEX + * Or can be an array of values + * @param array|int $places The number of characters to use. If places is omitted, OCT2HEX * uses the minimum number of characters necessary. Places is useful * for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. * If places is nonnumeric, OCT2HEX returns the #VALUE! error value. * If places is negative, OCT2HEX returns the #NUM! error value. + * Or can be an array of values + * + * @return array|string Result, or an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ - public static function toHex($value, $places = null): string + public static function toHex($value, $places = null) { + if (is_array($value) || is_array($places)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places); + } + try { - $value = self::validateValue(Functions::flattenSingleValue($value)); + $value = self::validateValue($value); $value = self::validateOctal($value); - $places = self::validatePlaces(Functions::flattenSingleValue($places)); + $places = self::validatePlaces($places); } catch (Exception $e) { return $e->getMessage(); } $hexVal = strtoupper(dechex((int) self::toDecimal($value))); - $hexVal = (PHP_INT_SIZE === 4 && strlen($value) === 10 && $value[0] >= '4') ? "FF$hexVal" : $hexVal; + $hexVal = (PHP_INT_SIZE === 4 && strlen($value) === 10 && $value[0] >= '4') ? "FF{$hexVal}" : $hexVal; return self::nbrConversionFormat($hexVal, $places); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php index d169ae54b..089ccbd7d 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class ConvertUOM { + use ArrayEnabled; + public const CATEGORY_WEIGHT_AND_MASS = 'Weight and Mass'; public const CATEGORY_DISTANCE = 'Distance'; public const CATEGORY_TIME = 'Time'; @@ -518,17 +521,22 @@ class ConvertUOM * Excel Function: * CONVERT(value,fromUOM,toUOM) * - * @param float|int $value the value in fromUOM to convert - * @param string $fromUOM the units for value - * @param string $toUOM the units for the result + * @param array|float|int|string $value the value in fromUOM to convert + * Or can be an array of values + * @param array|string $fromUOM the units for value + * Or can be an array of values + * @param array|string $toUOM the units for the result + * Or can be an array of values * - * @return float|string + * @return array|float|string Result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function CONVERT($value, $fromUOM, $toUOM) { - $value = Functions::flattenSingleValue($value); - $fromUOM = Functions::flattenSingleValue($fromUOM); - $toUOM = Functions::flattenSingleValue($toUOM); + if (is_array($value) || is_array($fromUOM) || is_array($toUOM)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $fromUOM, $toUOM); + } if (!is_numeric($value)) { return Functions::VALUE(); @@ -545,6 +553,7 @@ class ConvertUOM return Functions::NA(); } + // @var float $value $value *= $fromMultiplier; if (($fromUOM === $toUOM) && ($fromMultiplier === $toMultiplier)) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php index db87ec0d3..5aca8f2bb 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Erf { + use ArrayEnabled; + private static $twoSqrtPi = 1.128379167095512574; /** @@ -22,15 +25,20 @@ class Erf * ERF(lower[,upper]) * * @param mixed $lower Lower bound float for integrating ERF + * Or can be an array of values * @param mixed $upper Upper bound float for integrating ERF. * If omitted, ERF integrates between zero and lower_limit + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function ERF($lower, $upper = null) { - $lower = Functions::flattenSingleValue($lower); - $upper = Functions::flattenSingleValue($upper); + if (is_array($lower) || is_array($upper)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $lower, $upper); + } if (is_numeric($lower)) { if ($upper === null) { @@ -53,12 +61,17 @@ class Erf * ERF.PRECISE(limit) * * @param mixed $limit Float bound for integrating ERF, other bound is zero + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function ERFPRECISE($limit) { - $limit = Functions::flattenSingleValue($limit); + if (is_array($limit)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $limit); + } return self::ERF($limit); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php index c57a28f49..da1a932ed 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class ErfC { + use ArrayEnabled; + /** * ERFC. * @@ -20,12 +23,17 @@ class ErfC * ERFC(x) * * @param mixed $value The float lower bound for integrating ERFC + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function ERFC($value) { - $value = Functions::flattenSingleValue($value); + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } if (is_numeric($value)) { return self::erfcValue($value); @@ -45,7 +53,7 @@ class ErfC return 1 - Erf::erfValue($value); } if ($value < 0) { - return 2 - self::ERFC(-$value); + return 2 - self::erfcValue(-$value); } $a = $n = 1; $b = $c = $value; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php index 9d933b4a9..4215a5163 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial.php @@ -587,10 +587,10 @@ class Financial * @see Financial\Dollar::decimal() * Use the decimal() method in the Financial\Dollar class instead * - * @param float $fractional_dollar Fractional Dollar - * @param int $fraction Fraction + * @param array|float $fractional_dollar Fractional Dollar + * @param array|int $fraction Fraction * - * @return float|string + * @return array|float|string */ public static function DOLLARDE($fractional_dollar = null, $fraction = 0) { @@ -612,10 +612,10 @@ class Financial * @see Financial\Dollar::fractional() * Use the fractional() method in the Financial\Dollar class instead * - * @param float $decimal_dollar Decimal Dollar - * @param int $fraction Fraction + * @param array|float $decimal_dollar Decimal Dollar + * @param array|int $fraction Fraction * - * @return float|string + * @return array|float|string */ public static function DOLLARFR($decimal_dollar = null, $fraction = 0) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php index ba7fb5210..b16cc23f6 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php @@ -168,7 +168,7 @@ class Amortization if ( ($basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL) && - ($yearFrac < 1) && (DateTimeExcel\Helpers::isLeapYear($purchasedYear)) + ($yearFrac < 1) && (Functions::scalar(DateTimeExcel\Helpers::isLeapYear($purchasedYear))) ) { $yearFrac *= 365 / 366; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php index 8986146c1..d590e1a4e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php @@ -12,6 +12,8 @@ class NonPeriodic const FINANCIAL_PRECISION = 1.0e-08; + const DEFAULT_GUESS = 0.1; + /** * XIRR. * @@ -25,11 +27,11 @@ class NonPeriodic * @param mixed[] $dates A series of payment dates * The first payment date indicates the beginning of the schedule of payments * All other dates must be later than this date, but they may occur in any order - * @param float $guess An optional guess at the expected answer + * @param mixed $guess An optional guess at the expected answer * * @return float|string */ - public static function rate($values, $dates, $guess = 0.1) + public static function rate($values, $dates, $guess = self::DEFAULT_GUESS) { $rslt = self::xirrPart1($values, $dates); if ($rslt !== '') { @@ -37,9 +39,13 @@ class NonPeriodic } // create an initial range, with a root somewhere between 0 and guess - $guess = Functions::flattenSingleValue($guess); + $guess = Functions::flattenSingleValue($guess) ?? self::DEFAULT_GUESS; + if (!is_numeric($guess)) { + return Functions::VALUE(); + } + $guess = ($guess + 0.0) ?: self::DEFAULT_GUESS; $x1 = 0.0; - $x2 = $guess ?: 0.1; + $x2 = $guess + 0.0; $f1 = self::xnpvOrdered($x1, $values, $dates, false); $f2 = self::xnpvOrdered($x2, $values, $dates, false); $found = false; @@ -54,9 +60,11 @@ class NonPeriodic break; } elseif (abs($f1) < abs($f2)) { - $f1 = self::xnpvOrdered($x1 += 1.6 * ($x1 - $x2), $values, $dates, false); + $x1 += 1.6 * ($x1 - $x2); + $f1 = self::xnpvOrdered($x1, $values, $dates, false); } else { - $f2 = self::xnpvOrdered($x2 += 1.6 * ($x2 - $x1), $values, $dates, false); + $x2 += 1.6 * ($x2 - $x1); + $f2 = self::xnpvOrdered($x2, $values, $dates, false); } } if (!$found) { @@ -104,11 +112,13 @@ class NonPeriodic */ private static function xirrPart1(&$values, &$dates): string { - if (!is_array($values) && !is_array($dates)) { - return Functions::NA(); - } $values = Functions::flattenArray($values); $dates = Functions::flattenArray($dates); + $valuesIsArray = count($values) > 1; + $datesIsArray = count($dates) > 1; + if (!$valuesIsArray && !$datesIsArray) { + return Functions::NA(); + } if (count($values) != count($dates)) { return Functions::NAN(); } @@ -219,7 +229,11 @@ class NonPeriodic if (!is_numeric($dif)) { return $dif; } - $xnpv += $values[$i] / (1 + $rate) ** ($dif / 365); + if ($rate <= -1.0) { + $xnpv += -abs($values[$i]) / (-1 - $rate) ** ($dif / 365); + } else { + $xnpv += $values[$i] / (1 + $rate) ** ($dif / 365); + } } return is_finite($xnpv) ? $xnpv : Functions::VALUE(); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php index 3fd6c1d2d..ad487def8 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php @@ -64,7 +64,7 @@ class Coupons return $e->getMessage(); } - $daysPerYear = Helpers::daysPerYear(DateTimeExcel\DateParts::year($settlement), $basis); + $daysPerYear = Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis); if (is_string($daysPerYear)) { return Functions::VALUE(); } @@ -134,7 +134,7 @@ class Coupons case FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL: // Actual/actual if ($frequency == FinancialConstants::FREQUENCY_ANNUAL) { - $daysPerYear = Helpers::daysPerYear(DateTimeExcel\DateParts::year($settlement), $basis); + $daysPerYear = (int) Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis); return $daysPerYear / $frequency; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php index 7bebb3917..0dde0c169 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php @@ -2,23 +2,33 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Financial; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; +use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\TextData\Format; class Dollar { + use ArrayEnabled; + /** * DOLLAR. * * This function converts a number to text using currency format, with the decimals rounded to the specified place. * The format used is $#,##0.00_);($#,##0.00).. * - * @param mixed $number The value to format + * @param mixed $number The value to format, or can be an array of numbers + * Or can be an array of values * @param mixed $precision The number of digits to display to the right of the decimal point (as an integer). * If precision is negative, number is rounded to the left of the decimal point. * If you omit precision, it is assumed to be 2 + * Or can be an array of precision values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function format($number, $precision = 2): string + public static function format($number, $precision = 2) { return Format::DOLLAR($number, $precision); } @@ -34,25 +44,37 @@ class Dollar * DOLLARDE(fractional_dollar,fraction) * * @param mixed $fractionalDollar Fractional Dollar + * Or can be an array of values * @param mixed $fraction Fraction + * Or can be an array of values * - * @return float|string + * @return array|float|string */ public static function decimal($fractionalDollar = null, $fraction = 0) { - $fractionalDollar = Functions::flattenSingleValue($fractionalDollar); - $fraction = (int) Functions::flattenSingleValue($fraction); + if (is_array($fractionalDollar) || is_array($fraction)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $fractionalDollar, $fraction); + } - // Validate parameters - if ($fractionalDollar === null || $fraction < 0) { + try { + $fractionalDollar = FinancialValidations::validateFloat( + Functions::flattenSingleValue($fractionalDollar) ?? 0.0 + ); + $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction)); + } catch (Exception $e) { + return $e->getMessage(); + } + + // Additional parameter validations + if ($fraction < 0) { return Functions::NAN(); } if ($fraction == 0) { return Functions::DIV0(); } - $dollars = floor($fractionalDollar); - $cents = fmod($fractionalDollar, 1); + $dollars = ($fractionalDollar < 0) ? ceil($fractionalDollar) : floor($fractionalDollar); + $cents = fmod($fractionalDollar, 1.0); $cents /= $fraction; $cents *= 10 ** ceil(log10($fraction)); @@ -70,24 +92,36 @@ class Dollar * DOLLARFR(decimal_dollar,fraction) * * @param mixed $decimalDollar Decimal Dollar + * Or can be an array of values * @param mixed $fraction Fraction + * Or can be an array of values * - * @return float|string + * @return array|float|string */ public static function fractional($decimalDollar = null, $fraction = 0) { - $decimalDollar = Functions::flattenSingleValue($decimalDollar); - $fraction = (int) Functions::flattenSingleValue($fraction); + if (is_array($decimalDollar) || is_array($fraction)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $decimalDollar, $fraction); + } - // Validate parameters - if ($decimalDollar === null || $fraction < 0) { + try { + $decimalDollar = FinancialValidations::validateFloat( + Functions::flattenSingleValue($decimalDollar) ?? 0.0 + ); + $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction)); + } catch (Exception $e) { + return $e->getMessage(); + } + + // Additional parameter validations + if ($fraction < 0) { return Functions::NAN(); } if ($fraction == 0) { return Functions::DIV0(); } - $dollars = floor($decimalDollar); + $dollars = ($decimalDollar < 0.0) ? ceil($decimalDollar) : floor($decimalDollar); $cents = fmod($decimalDollar, 1); $cents *= $fraction; $cents *= 10 ** (-ceil(log10($fraction))); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php index e167429b7..95996b4e9 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php @@ -78,12 +78,12 @@ class AccruedInterest return $e->getMessage(); } - $daysBetweenIssueAndSettlement = YearFrac::fraction($issue, $settlement, $basis); + $daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis)); if (!is_numeric($daysBetweenIssueAndSettlement)) { // return date error return $daysBetweenIssueAndSettlement; } - $daysBetweenFirstInterestAndSettlement = YearFrac::fraction($firstInterest, $settlement, $basis); + $daysBetweenFirstInterestAndSettlement = Functions::scalar(YearFrac::fraction($firstInterest, $settlement, $basis)); if (!is_numeric($daysBetweenFirstInterestAndSettlement)) { // return date error return $daysBetweenFirstInterestAndSettlement; @@ -140,7 +140,7 @@ class AccruedInterest return $e->getMessage(); } - $daysBetweenIssueAndSettlement = YearFrac::fraction($issue, $settlement, $basis); + $daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis)); if (!is_numeric($daysBetweenIssueAndSettlement)) { // return date error return $daysBetweenIssueAndSettlement; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php index 7d8d5a321..cb8937072 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php @@ -134,7 +134,7 @@ class Price return $e->getMessage(); } - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; @@ -194,23 +194,23 @@ class Price return $e->getMessage(); } - $daysPerYear = Helpers::daysPerYear(DateTimeExcel\DateParts::year($settlement), $basis); + $daysPerYear = Functions::scalar(Helpers::daysPerYear(DateTimeExcel\DateParts::year($settlement), $basis)); if (!is_numeric($daysPerYear)) { return $daysPerYear; } - $daysBetweenIssueAndSettlement = DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis); + $daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis)); if (!is_numeric($daysBetweenIssueAndSettlement)) { // return date error return $daysBetweenIssueAndSettlement; } $daysBetweenIssueAndSettlement *= $daysPerYear; - $daysBetweenIssueAndMaturity = DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis); + $daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis)); if (!is_numeric($daysBetweenIssueAndMaturity)) { // return date error return $daysBetweenIssueAndMaturity; } $daysBetweenIssueAndMaturity *= $daysPerYear; - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php index c5c5211b7..84218a960 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php @@ -63,7 +63,7 @@ class Rates return Functions::NAN(); } - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; @@ -126,7 +126,7 @@ class Rates return Functions::NAN(); } - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php index aa6269354..bb2e8ae22 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php @@ -61,7 +61,7 @@ class Yields if (!is_numeric($daysPerYear)) { return $daysPerYear; } - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; @@ -126,19 +126,19 @@ class Yields if (!is_numeric($daysPerYear)) { return $daysPerYear; } - $daysBetweenIssueAndSettlement = DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis); + $daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis)); if (!is_numeric($daysBetweenIssueAndSettlement)) { // return date error return $daysBetweenIssueAndSettlement; } $daysBetweenIssueAndSettlement *= $daysPerYear; - $daysBetweenIssueAndMaturity = DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis); + $daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis)); if (!is_numeric($daysBetweenIssueAndMaturity)) { // return date error return $daysBetweenIssueAndMaturity; } $daysBetweenIssueAndMaturity *= $daysPerYear; - $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis); + $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis)); if (!is_numeric($daysBetweenSettlementAndMaturity)) { // return date error return $daysBetweenSettlementAndMaturity; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php index c60af0b0d..b2c84627f 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php @@ -43,7 +43,7 @@ class TreasuryBill $daysBetweenSettlementAndMaturity = $maturity - $settlement; $daysPerYear = Helpers::daysPerYear( - DateTimeExcel\DateParts::year($maturity), + Functions::scalar(DateTimeExcel\DateParts::year($maturity)), FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL ); @@ -88,7 +88,7 @@ class TreasuryBill $daysBetweenSettlementAndMaturity = $maturity - $settlement; $daysPerYear = Helpers::daysPerYear( - DateTimeExcel\DateParts::year($maturity), + Functions::scalar(DateTimeExcel\DateParts::year($maturity)), FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL ); @@ -134,7 +134,7 @@ class TreasuryBill $daysBetweenSettlementAndMaturity = $maturity - $settlement; $daysPerYear = Helpers::daysPerYear( - DateTimeExcel\DateParts::year($maturity), + Functions::scalar(DateTimeExcel\DateParts::year($maturity)), FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL ); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php index 75d4582b2..0ccf72e9d 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php @@ -608,6 +608,24 @@ class Functions return $arrayValues; } + /** + * @param mixed $value + * + * @return null|mixed + */ + public static function scalar($value) + { + if (!is_array($value)) { + return $value; + } + + do { + $value = array_pop($value); + } while (is_array($value)); + + return $value; + } + /** * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php index b267e1f0b..d5d993ae3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php @@ -163,7 +163,7 @@ class Logical * * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE * - * @return bool|string the boolean inverse of the argument + * @return array|bool|string the boolean inverse of the argument */ public static function NOT($logical = false) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php index e84d0f33e..12d5b8553 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Logical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Conditional { + use ArrayEnabled; + /** * STATEMENT_IF. * @@ -34,7 +37,9 @@ class Conditional * * @param mixed $condition Condition to evaluate * @param mixed $returnIfTrue Value to return when condition is true + * Note that this can be an array value * @param mixed $returnIfFalse Optional value to return when condition is false + * Note that this can be an array value * * @return mixed The value of returnIfTrue or returnIfFalse determined by condition */ @@ -45,8 +50,8 @@ class Conditional } $condition = ($condition === null) ? true : (bool) Functions::flattenSingleValue($condition); - $returnIfTrue = ($returnIfTrue === null) ? 0 : Functions::flattenSingleValue($returnIfTrue); - $returnIfFalse = ($returnIfFalse === null) ? false : Functions::flattenSingleValue($returnIfFalse); + $returnIfTrue = $returnIfTrue ?? 0; + $returnIfFalse = $returnIfFalse ?? false; return ($condition) ? $returnIfTrue : $returnIfFalse; } @@ -67,9 +72,11 @@ class Conditional * result1, result2, ... result_n * A list of results. The SWITCH function returns the corresponding result when a value * matches expression. + * Note that these can be array values to be returned * default * Optional. It is the default to return if expression does not match any of the values * (value1, value2, ... value_n). + * Note that this can be an array value to be returned * * @param mixed $arguments Statement arguments * @@ -113,14 +120,21 @@ class Conditional * =IFERROR(testValue,errorpart) * * @param mixed $testValue Value to check, is also the value returned when no error + * Or can be an array of values * @param mixed $errorpart Value to return when testValue is an error condition + * Note that this can be an array value to be returned * * @return mixed The value of errorpart or testValue determined by error condition + * If an array of values is passed as the $testValue argument, then the returned result will also be + * an array with the same dimensions */ public static function IFERROR($testValue = '', $errorpart = '') { - $testValue = ($testValue === null) ? '' : Functions::flattenSingleValue($testValue); - $errorpart = ($errorpart === null) ? '' : Functions::flattenSingleValue($errorpart); + if (is_array($testValue)) { + return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $testValue, $errorpart); + } + + $errorpart = $errorpart ?? ''; return self::statementIf(Functions::isError($testValue), $errorpart, $testValue); } @@ -132,14 +146,21 @@ class Conditional * =IFNA(testValue,napart) * * @param mixed $testValue Value to check, is also the value returned when not an NA + * Or can be an array of values * @param mixed $napart Value to return when testValue is an NA condition + * Note that this can be an array value to be returned * * @return mixed The value of errorpart or testValue determined by error condition + * If an array of values is passed as the $testValue argument, then the returned result will also be + * an array with the same dimensions */ public static function IFNA($testValue = '', $napart = '') { - $testValue = ($testValue === null) ? '' : Functions::flattenSingleValue($testValue); - $napart = ($napart === null) ? '' : Functions::flattenSingleValue($napart); + if (is_array($testValue)) { + return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $testValue, $napart); + } + + $napart = $napart ?? ''; return self::statementIf(Functions::isNa($testValue), $napart, $testValue); } @@ -156,6 +177,7 @@ class Conditional * Value returned if corresponding testValue (nth) was true * * @param mixed ...$arguments Statement arguments + * Note that this can be an array value to be returned * * @return mixed|string The value of returnIfTrue_n, if testValue_n was true. #N/A if none of testValues was true */ @@ -170,7 +192,7 @@ class Conditional $falseValueException = new Exception(); for ($i = 0; $i < $argumentCount; $i += 2) { $testValue = ($arguments[$i] === null) ? '' : Functions::flattenSingleValue($arguments[$i]); - $returnIfTrue = ($arguments[$i + 1] === null) ? '' : Functions::flattenSingleValue($arguments[$i + 1]); + $returnIfTrue = ($arguments[$i + 1] === null) ? '' : $arguments[$i + 1]; $result = self::statementIf($testValue, $returnIfTrue, $falseValueException); if ($result !== $falseValueException) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php index 6bfb6a545..7c8398596 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Logical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Operations { + use ArrayEnabled; + /** * LOGICAL_AND. * @@ -146,12 +149,17 @@ class Operations * holds the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value * * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE + * Or can be an array of values * - * @return bool|string the boolean inverse of the argument + * @return array|bool|string the boolean inverse of the argument + * If an array of values is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function NOT($logical = false) { - $logical = Functions::flattenSingleValue($logical); + if (is_array($logical)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $logical); + } if (is_string($logical)) { $logical = mb_strtoupper($logical, 'UTF-8'); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php index ec251f6d2..993154c33 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -20,9 +20,9 @@ class MathTrig * @See MathTrig\Arabic::evaluate() * Use the evaluate method in the MathTrig\Arabic class instead * - * @param string $roman + * @param array|string $roman * - * @return int|string the arabic numberal contrived from the roman numeral + * @return array|int|string the arabic numberal contrived from the roman numeral */ public static function ARABIC($roman) { @@ -50,10 +50,10 @@ class MathTrig * @See MathTrig\Trig\Tangent::atan2() * Use the atan2 method in the MathTrig\Trig\Tangent class instead * - * @param float $xCoordinate the x-coordinate of the point - * @param float $yCoordinate the y-coordinate of the point + * @param array|float $xCoordinate the x-coordinate of the point + * @param array|float $yCoordinate the y-coordinate of the point * - * @return float|string the inverse tangent of the specified x- and y-coordinates, or a string containing an error + * @return array|float|string the inverse tangent of the specified x- and y-coordinates, or a string containing an error */ public static function ATAN2($xCoordinate = null, $yCoordinate = null) { @@ -77,7 +77,7 @@ class MathTrig * @param float $radix * @param int $minLength * - * @return string the text representation with the given radix (base) + * @return array|string the text representation with the given radix (base) */ public static function BASE($number, $radix, $minLength = null) { @@ -100,7 +100,7 @@ class MathTrig * @param float $number the number you want to round * @param float $significance the multiple to which you want to round * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * * @see MathTrig\Ceiling::ceiling() * Use the ceiling() method in the MathTrig\Ceiling class instead @@ -124,10 +124,10 @@ class MathTrig * @see MathTrig\Combinations::withoutRepetition() * Use the withoutRepetition() method in the MathTrig\Combinations class instead * - * @param int $numObjs Number of different objects - * @param int $numInSet Number of objects in each combination + * @param array|int $numObjs Number of different objects + * @param array|int $numInSet Number of objects in each combination * - * @return float|int|string Number of combinations, or a string containing an error + * @return array|float|int|string Number of combinations, or a string containing an error */ public static function COMBIN($numObjs, $numInSet) { @@ -151,9 +151,9 @@ class MathTrig * @see MathTrig\Round::even() * Use the even() method in the MathTrig\Round class instead * - * @param float $number Number to round + * @param array|float $number Number to round * - * @return float|int|string Rounded Number, or a string containing an error + * @return array|float|int|string Rounded Number, or a string containing an error */ public static function EVEN($number) { @@ -184,9 +184,9 @@ class MathTrig * * @Deprecated 1.18.0 * - * @param float $factVal Factorial Value + * @param array|float $factVal Factorial Value * - * @return float|int|string Factorial, or a string containing an error + * @return array|float|int|string Factorial, or a string containing an error * *@see MathTrig\Factorial::fact() * Use the fact() method in the MathTrig\Factorial class instead @@ -206,9 +206,9 @@ class MathTrig * * @Deprecated 1.18.0 * - * @param float $factVal Factorial Value + * @param array|float $factVal Factorial Value * - * @return float|int|string Double Factorial, or a string containing an error + * @return array|float|int|string Double Factorial, or a string containing an error * *@see MathTrig\Factorial::factDouble() * Use the factDouble() method in the MathTrig\Factorial class instead @@ -231,7 +231,7 @@ class MathTrig * @param float $number Number to round * @param float $significance Significance * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * *@see MathTrig\Floor::floor() * Use the floor() method in the MathTrig\Floor class instead @@ -255,7 +255,7 @@ class MathTrig * @param float $significance Significance * @param int $mode direction to round negative numbers * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * *@see MathTrig\Floor::math() * Use the math() method in the MathTrig\Floor class instead @@ -278,7 +278,7 @@ class MathTrig * @param float $number Number to round * @param float $significance Significance * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * *@see MathTrig\Floor::precise() * Use the precise() method in the MathTrig\Floor class instead @@ -301,9 +301,9 @@ class MathTrig * @see MathTrig\IntClass::evaluate() * Use the evaluate() method in the MathTrig\IntClass class instead * - * @param float $number Number to cast to an integer + * @param array|float $number Number to cast to an integer * - * @return int|string Integer value, or a string containing an error + * @return array|int|string Integer value, or a string containing an error */ public static function INT($number) { @@ -375,7 +375,7 @@ class MathTrig * @param float $number The positive real number for which you want the logarithm * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10. * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function logBase($number, $base = 10) { @@ -455,7 +455,7 @@ class MathTrig * @param int $a Dividend * @param int $b Divisor * - * @return float|int|string Remainder, or a string containing an error + * @return array|float|int|string Remainder, or a string containing an error */ public static function MOD($a = 1, $b = 1) { @@ -470,9 +470,9 @@ class MathTrig * @Deprecated 1.17.0 * * @param float $number Number to round - * @param int $multiple Multiple to which you want to round $number + * @param array|int $multiple Multiple to which you want to round $number * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * *@see MathTrig\Round::multiple() * Use the multiple() method in the MathTrig\Mround class instead @@ -511,9 +511,9 @@ class MathTrig * @See MathTrig\Round::odd() * Use the odd method in the MathTrig\Round class instead * - * @param float $number Number to round + * @param array|float $number Number to round * - * @return float|int|string Rounded Number, or a string containing an error + * @return array|float|int|string Rounded Number, or a string containing an error */ public static function ODD($number) { @@ -533,7 +533,7 @@ class MathTrig * @param float $x * @param float $y * - * @return float|int|string The result, or a string containing an error + * @return array|float|int|string The result, or a string containing an error */ public static function POWER($x = 0, $y = 2) { @@ -579,7 +579,7 @@ class MathTrig * @param mixed $numerator * @param mixed $denominator * - * @return int|string + * @return array|int|string */ public static function QUOTIENT($numerator, $denominator) { @@ -597,7 +597,7 @@ class MathTrig * @param int $min Minimal value * @param int $max Maximal value * - * @return float|int|string Random number + * @return array|float|int|string Random number */ public static function RAND($min = 0, $max = 0) { @@ -617,7 +617,7 @@ class MathTrig * @param mixed $aValue Number to convert * @param mixed $style Number indicating one of five possible forms * - * @return string Roman numeral, or a string containing an error + * @return array|string Roman numeral, or a string containing an error */ public static function ROMAN($aValue, $style = 0) { @@ -634,10 +634,10 @@ class MathTrig * @See MathTrig\Round::up() * Use the up() method in the MathTrig\Round class instead * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number + * @param array|float $number Number to round + * @param array|int $digits Number of digits to which you want to round $number * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error */ public static function ROUNDUP($number, $digits) { @@ -654,10 +654,10 @@ class MathTrig * @See MathTrig\Round::down() * Use the down() method in the MathTrig\Round class instead * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number + * @param array|float $number Number to round + * @param array|int $digits Number of digits to which you want to round $number * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error */ public static function ROUNDDOWN($number, $digits) { @@ -679,7 +679,7 @@ class MathTrig * @param mixed $m Step * @param mixed[] $args An array of coefficients for the Data Series * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function SERIESSUM($x, $n, $m, ...$args) { @@ -697,9 +697,9 @@ class MathTrig * @See MathTrig\Sign::evaluate() * Use the evaluate method in the MathTrig\Sign class instead * - * @param float $number Number to round + * @param array|float $number Number to round * - * @return int|string sign value, or a string containing an error + * @return array|int|string sign value, or a string containing an error */ public static function SIGN($number) { @@ -729,9 +729,9 @@ class MathTrig * @See MathTrig\Sqrt::sqrt() * Use the pi method in the MathTrig\Sqrt class instead * - * @param float $number Number + * @param array|float $number Number * - * @return float|string Square Root of Number * Pi, or a string containing an error + * @return array|float|string Square Root of Number * Pi, or a string containing an error */ public static function SQRTPI($number) { @@ -941,7 +941,7 @@ class MathTrig * @param float $value * @param int $digits * - * @return float|string Truncated value, or a string containing an error + * @return array|float|string Truncated value, or a string containing an error */ public static function TRUNC($value = 0, $digits = 0) { @@ -958,9 +958,9 @@ class MathTrig * @See MathTrig\Trig\Secant::sec() * Use the sec method in the MathTrig\Trig\Secant class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The secant of the angle + * @return array|float|string The secant of the angle */ public static function SEC($angle) { @@ -977,9 +977,9 @@ class MathTrig * @See MathTrig\Trig\Secant::sech() * Use the sech method in the MathTrig\Trig\Secant class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The hyperbolic secant of the angle + * @return array|float|string The hyperbolic secant of the angle */ public static function SECH($angle) { @@ -996,9 +996,9 @@ class MathTrig * @See MathTrig\Trig\Cosecant::csc() * Use the csc method in the MathTrig\Trig\Cosecant class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The cosecant of the angle + * @return array|float|string The cosecant of the angle */ public static function CSC($angle) { @@ -1015,9 +1015,9 @@ class MathTrig * @See MathTrig\Trig\Cosecant::csch() * Use the csch method in the MathTrig\Trig\Cosecant class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The hyperbolic cosecant of the angle + * @return array|float|string The hyperbolic cosecant of the angle */ public static function CSCH($angle) { @@ -1034,9 +1034,9 @@ class MathTrig * @See MathTrig\Trig\Cotangent::cot() * Use the cot method in the MathTrig\Trig\Cotangent class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The cotangent of the angle + * @return array|float|string The cotangent of the angle */ public static function COT($angle) { @@ -1053,9 +1053,9 @@ class MathTrig * @See MathTrig\Trig\Cotangent::coth() * Use the coth method in the MathTrig\Trig\Cotangent class instead * - * @param float $angle Number + * @param array|float $angle Number * - * @return float|string The hyperbolic cotangent of the angle + * @return array|float|string The hyperbolic cotangent of the angle */ public static function COTH($angle) { @@ -1072,9 +1072,9 @@ class MathTrig * @See MathTrig\Trig\Cotangent::acot() * Use the acot method in the MathTrig\Trig\Cotangent class instead * - * @param float $number Number + * @param array|float $number Number * - * @return float|string The arccotangent of the number + * @return array|float|string The arccotangent of the number */ public static function ACOT($number) { @@ -1108,9 +1108,9 @@ class MathTrig * @See MathTrig\Trig\Cotangent::acoth() * Use the acoth method in the MathTrig\Trig\Cotangent class instead * - * @param float $number Number + * @param array|float $number Number * - * @return float|string The hyperbolic arccotangent of the number + * @return array|float|string The hyperbolic arccotangent of the number */ public static function ACOTH($number) { @@ -1127,10 +1127,10 @@ class MathTrig * @See MathTrig\Round::round() * Use the round() method in the MathTrig\Round class instead * - * @param mixed $number Should be numeric - * @param mixed $precision Should be int + * @param array|mixed $number Should be numeric + * @param array|mixed $precision Should be int * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinROUND($number, $precision) { @@ -1147,9 +1147,9 @@ class MathTrig * @See MathTrig\Absolute::evaluate() * Use the evaluate method in the MathTrig\Absolute class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|int|string Rounded number + * @return array|float|int|string Rounded number */ public static function builtinABS($number) { @@ -1166,9 +1166,9 @@ class MathTrig * * Returns the result of builtin function acos after validating args. * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinACOS($number) { @@ -1185,9 +1185,9 @@ class MathTrig * @See MathTrig\Trig\Cosine::acosh() * Use the acosh method in the MathTrig\Trig\Cosine class instead * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinACOSH($number) { @@ -1204,9 +1204,9 @@ class MathTrig * @See MathTrig\Trig\Sine::asin() * Use the asin method in the MathTrig\Trig\Sine class instead * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinASIN($number) { @@ -1223,9 +1223,9 @@ class MathTrig * @See MathTrig\Trig\Sine::asinh() * Use the asinh method in the MathTrig\Trig\Sine class instead * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinASINH($number) { @@ -1242,9 +1242,9 @@ class MathTrig * @See MathTrig\Trig\Tangent::atan() * Use the atan method in the MathTrig\Trig\Tangent class instead * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinATAN($number) { @@ -1261,9 +1261,9 @@ class MathTrig * @See MathTrig\Trig\Tangent::atanh() * Use the atanh method in the MathTrig\Trig\Tangent class instead * - * @param mixed $number Should be numeric + * @param array|float $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinATANH($number) { @@ -1280,9 +1280,9 @@ class MathTrig * @See MathTrig\Trig\Cosine::cos() * Use the cos method in the MathTrig\Trig\Cosine class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinCOS($number) { @@ -1299,9 +1299,9 @@ class MathTrig * @See MathTrig\Trig\Cosine::cosh() * Use the cosh method in the MathTrig\Trig\Cosine class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinCOSH($number) { @@ -1318,9 +1318,9 @@ class MathTrig * @See MathTrig\Angle::toDegrees() * Use the toDegrees method in the MathTrig\Angle class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinDEGREES($number) { @@ -1337,9 +1337,9 @@ class MathTrig * @See MathTrig\Exp::evaluate() * Use the evaluate method in the MathTrig\Exp class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinEXP($number) { @@ -1358,7 +1358,7 @@ class MathTrig * * @param mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinLN($number) { @@ -1377,7 +1377,7 @@ class MathTrig * * @param mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinLOG10($number) { @@ -1394,9 +1394,9 @@ class MathTrig * @See MathTrig\Angle::toRadians() * Use the toRadians method in the MathTrig\Angle class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinRADIANS($number) { @@ -1413,9 +1413,9 @@ class MathTrig * @See MathTrig\Trig\Sine::evaluate() * Use the sin method in the MathTrig\Trig\Sine class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string sine + * @return array|float|string sine */ public static function builtinSIN($number) { @@ -1432,9 +1432,9 @@ class MathTrig * @See MathTrig\Trig\Sine::sinh() * Use the sinh method in the MathTrig\Trig\Sine class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinSINH($number) { @@ -1451,9 +1451,9 @@ class MathTrig * @See MathTrig\Sqrt::sqrt() * Use the sqrt method in the MathTrig\Sqrt class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinSQRT($number) { @@ -1470,9 +1470,9 @@ class MathTrig * @See MathTrig\Trig\Tangent::tan() * Use the tan method in the MathTrig\Trig\Tangent class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinTAN($number) { @@ -1489,9 +1489,9 @@ class MathTrig * @See MathTrig\Trig\Tangent::tanh() * Use the tanh method in the MathTrig\Trig\Tangent class instead * - * @param mixed $number Should be numeric + * @param array|mixed $number Should be numeric * - * @return float|string Rounded number + * @return array|float|string Rounded number */ public static function builtinTANH($number) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php index 9f1bd8049..f21c6b73c 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php @@ -2,21 +2,30 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Absolute { + use ArrayEnabled; + /** * ABS. * * Returns the result of builtin function abs after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|int|string Rounded number + * @return array|float|int|string rounded number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php index 3062481f0..cbeec6f40 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php @@ -2,21 +2,30 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Angle { + use ArrayEnabled; + /** * DEGREES. * * Returns the result of builtin function rad2deg after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function toDegrees($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -31,12 +40,18 @@ class Angle * * Returns the result of builtin function deg2rad after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function toRadians($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php index b852eeacf..200d25784 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Arabic { + use ArrayEnabled; + private const ROMAN_LOOKUP = [ 'M' => 1000, 'D' => 500, @@ -70,14 +73,20 @@ class Arabic * Excel Function: * ARABIC(text) * - * @param string $roman + * @param mixed $roman Should be a string, or can be an array of strings * - * @return int|string the arabic numberal contrived from the roman numeral + * @return array|int|string the arabic numberal contrived from the roman numeral + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($roman) { + if (is_array($roman)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $roman); + } + // An empty string should return 0 - $roman = substr(trim(strtoupper((string) Functions::flattenSingleValue($roman))), 0, 255); + $roman = substr(trim(strtoupper((string) $roman)), 0, 255); if ($roman === '') { return 0; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php index 4be7b7c79..a31a56813 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Base { + use ArrayEnabled; + /** * BASE. * @@ -16,21 +19,37 @@ class Base * BASE(Number, Radix [Min_length]) * * @param mixed $number expect float + * Or can be an array of values * @param mixed $radix expect float + * Or can be an array of values * @param mixed $minLength expect int or null + * Or can be an array of values * - * @return string the text representation with the given radix (base) + * @return array|string the text representation with the given radix (base) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($number, $radix, $minLength = null) { + if (is_array($number) || is_array($radix) || is_array($minLength)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $radix, $minLength); + } + try { $number = (float) floor(Helpers::validateNumericNullBool($number)); $radix = (int) Helpers::validateNumericNullBool($radix); } catch (Exception $e) { return $e->getMessage(); } - $minLength = Functions::flattenSingleValue($minLength); + return self::calculate($number, $radix, $minLength); + } + + /** + * @param mixed $minLength + */ + private static function calculate(float $number, int $radix, $minLength): string + { if ($minLength === null || is_numeric($minLength)) { if ($number < 0 || $number >= 2 ** 53 || $radix < 2 || $radix > 36) { return Functions::NAN(); // Numeric range constraints diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php index 73f54a52f..fd17f653e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Ceiling { + use ArrayEnabled; + /** * CEILING. * @@ -18,13 +21,21 @@ class Ceiling * Excel Function: * CEILING(number[,significance]) * - * @param float $number the number you want the ceiling - * @param float $significance the multiple to which you want to round + * @param array|float $number the number you want the ceiling + * Or can be an array of values + * @param array|float $significance the multiple to which you want to round + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function ceiling($number, $significance = null) { + if (is_array($number) || is_array($significance)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance); + } + if ($significance === null) { self::floorCheck1Arg(); } @@ -48,13 +59,22 @@ class Ceiling * CEILING.MATH(number[,significance[,mode]]) * * @param mixed $number Number to round + * Or can be an array of values * @param mixed $significance Significance - * @param int $mode direction to round negative numbers + * Or can be an array of values + * @param array|int $mode direction to round negative numbers + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function math($number, $significance = null, $mode = 0) { + if (is_array($number) || is_array($significance) || is_array($mode)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode); + } + try { $number = Helpers::validateNumericNullBool($number); $significance = Helpers::validateNumericNullSubstitution($significance, ($number < 0) ? -1 : 1); @@ -82,12 +102,20 @@ class Ceiling * CEILING.PRECISE(number[,significance]) * * @param mixed $number the number you want to round - * @param float $significance the multiple to which you want to round + * Or can be an array of values + * @param array|float $significance the multiple to which you want to round + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function precise($number, $significance = 1) { + if (is_array($number) || is_array($significance)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance); + } + try { $number = Helpers::validateNumericNullBool($number); $significance = Helpers::validateNumericNullSubstitution($significance, null); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php index 97508bb1e..5a652da09 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Combinations { + use ArrayEnabled; + /** * COMBIN. * @@ -15,13 +18,19 @@ class Combinations * Excel Function: * COMBIN(numObjs,numInSet) * - * @param mixed $numObjs Number of different objects - * @param mixed $numInSet Number of objects in each combination + * @param mixed $numObjs Number of different objects, or can be an array of numbers + * @param mixed $numInSet Number of objects in each combination, or can be an array of numbers * - * @return float|int|string Number of combinations, or a string containing an error + * @return array|float|int|string Number of combinations, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function withoutRepetition($numObjs, $numInSet) { + if (is_array($numObjs) || is_array($numInSet)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet); + } + try { $numObjs = Helpers::validateNumericNullSubstitution($numObjs, null); $numInSet = Helpers::validateNumericNullSubstitution($numInSet, null); @@ -35,21 +44,27 @@ class Combinations } /** - * COMBIN. + * COMBINA. * * Returns the number of combinations for a given number of items. Use COMBIN to * determine the total possible number of groups for a given number of items. * * Excel Function: - * COMBIN(numObjs,numInSet) + * COMBINA(numObjs,numInSet) * - * @param mixed $numObjs Number of different objects - * @param mixed $numInSet Number of objects in each combination + * @param mixed $numObjs Number of different objects, or can be an array of numbers + * @param mixed $numInSet Number of objects in each combination, or can be an array of numbers * - * @return float|int|string Number of combinations, or a string containing an error + * @return array|float|int|string Number of combinations, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function withRepetition($numObjs, $numInSet) { + if (is_array($numObjs) || is_array($numInSet)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet); + } + try { $numObjs = Helpers::validateNumericNullSubstitution($numObjs, null); $numInSet = Helpers::validateNumericNullSubstitution($numInSet, null); @@ -69,6 +84,8 @@ class Combinations return $e->getMessage(); } - return round(Factorial::fact($numObjs + $numInSet - 1) / Factorial::fact($numObjs - 1)) / Factorial::fact($numInSet); + return round( + Factorial::fact($numObjs + $numInSet - 1) / Factorial::fact($numObjs - 1) + ) / Factorial::fact($numInSet); } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php index ce930a83a..f65c2c18b 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php @@ -2,21 +2,30 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Exp { + use ArrayEnabled; + /** * EXP. * * Returns the result of builtin function exp after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php index f443f8e59..b6883e290 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Statistical; class Factorial { + use ArrayEnabled; + /** * FACT. * @@ -17,12 +20,18 @@ class Factorial * Excel Function: * FACT(factVal) * - * @param float $factVal Factorial Value + * @param array|float $factVal Factorial Value, or can be an array of numbers * - * @return float|int|string Factorial, or a string containing an error + * @return array|float|int|string Factorial, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function fact($factVal) { + if (is_array($factVal)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $factVal); + } + try { $factVal = Helpers::validateNumericNullBool($factVal); Helpers::validateNotNegative($factVal); @@ -53,12 +62,18 @@ class Factorial * Excel Function: * FACTDOUBLE(factVal) * - * @param float $factVal Factorial Value + * @param array|float $factVal Factorial Value, or can be an array of numbers * - * @return float|int|string Double Factorial, or a string containing an error + * @return array|float|int|string Double Factorial, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function factDouble($factVal) { + if (is_array($factVal)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $factVal); + } + try { $factVal = Helpers::validateNumericNullSubstitution($factVal, 0); Helpers::validateNotNegative($factVal); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php index 04e122058..16cde987e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Floor { + use ArrayEnabled; + private static function floorCheck1Arg(): void { $compatibility = Functions::getCompatibilityMode(); @@ -24,12 +27,20 @@ class Floor * FLOOR(number[,significance]) * * @param mixed $number Expect float. Number to round + * Or can be an array of values * @param mixed $significance Expect float. Significance + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function floor($number, $significance = null) { + if (is_array($number) || is_array($significance)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance); + } + if ($significance === null) { self::floorCheck1Arg(); } @@ -53,13 +64,22 @@ class Floor * FLOOR.MATH(number[,significance[,mode]]) * * @param mixed $number Number to round + * Or can be an array of values * @param mixed $significance Significance + * Or can be an array of values * @param mixed $mode direction to round negative numbers + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function math($number, $significance = null, $mode = 0) { + if (is_array($number) || is_array($significance) || is_array($mode)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode); + } + try { $number = Helpers::validateNumericNullBool($number); $significance = Helpers::validateNumericNullSubstitution($significance, ($number < 0) ? -1 : 1); @@ -79,13 +99,21 @@ class Floor * Excel Function: * FLOOR.PRECISE(number[,significance]) * - * @param float $number Number to round - * @param float $significance Significance + * @param array|float $number Number to round + * Or can be an array of values + * @param array|float $significance Significance + * Or can be an array of values * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function precise($number, $significance = 1) { + if (is_array($number) || is_array($significance)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance); + } + try { $number = Helpers::validateNumericNullBool($number); $significance = Helpers::validateNumericNullSubstitution($significance, null); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php index 7aa3d06ae..f7f7764bc 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class IntClass { + use ArrayEnabled; + /** * INT. * @@ -14,12 +17,18 @@ class IntClass * Excel Function: * INT(number) * - * @param float $number Number to cast to an integer + * @param array|float $number Number to cast to an integer, or can be an array of numbers * - * @return int|string Integer value, or a string containing an error + * @return array|string Integer value, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php index d6878d88c..7b07f09d5 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Logarithms { + use ArrayEnabled; + /** * LOG_BASE. * @@ -15,12 +18,20 @@ class Logarithms * LOG(number[,base]) * * @param mixed $number The positive real number for which you want the logarithm + * Or can be an array of values * @param mixed $base The base of the logarithm. If base is omitted, it is assumed to be 10. + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function withBase($number, $base = 10) { + if (is_array($number) || is_array($base)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $base); + } + try { $number = Helpers::validateNumericNullBool($number); Helpers::validatePositive($number); @@ -39,11 +50,18 @@ class Logarithms * Returns the result of builtin function log after validating args. * * @param mixed $number Should be numeric + * Or can be an array of values * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function base10($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); Helpers::validatePositive($number); @@ -60,11 +78,18 @@ class Logarithms * Returns the result of builtin function log after validating args. * * @param mixed $number Should be numeric + * Or can be an array of values * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function natural($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); Helpers::validatePositive($number); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php index 92e1ff8e7..474f862d8 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php @@ -12,7 +12,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; class MatrixFunctions { /** - * Convert parameter to matrix. + * Convert parameter to Matrix. * * @param mixed $matrixValues A matrix of values */ @@ -42,6 +42,47 @@ class MatrixFunctions return new Matrix($matrixData); } + /** + * SEQUENCE. + * + * Generates a list of sequential numbers in an array. + * + * Excel Function: + * SEQUENCE(rows,[columns],[start],[step]) + * + * @param mixed $rows the number of rows to return, defaults to 1 + * @param mixed $columns the number of columns to return, defaults to 1 + * @param mixed $start the first number in the sequence, defaults to 1 + * @param mixed $step the amount to increment each subsequent value in the array, defaults to 1 + * + * @return array|string The resulting array, or a string containing an error + */ + public static function sequence($rows = 1, $columns = 1, $start = 1, $step = 1) + { + try { + $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1); + Helpers::validatePositive($rows); + $columns = (int) Helpers::validateNumericNullSubstitution($columns, 1); + Helpers::validatePositive($columns); + $start = Helpers::validateNumericNullSubstitution($start, 1); + $step = Helpers::validateNumericNullSubstitution($step, 1); + } catch (Exception $e) { + return $e->getMessage(); + } + + if ($step === 0) { + return array_chunk( + array_fill(0, $rows * $columns, $start), + max($columns, 1) + ); + } + + return array_chunk( + range($start, $start + (($rows * $columns - 1) * $step), $step), + max($columns, 1) + ); + } + /** * MDETERM. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php index 595c7fdcc..4e481512a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php @@ -2,21 +2,32 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Operations { + use ArrayEnabled; + /** * MOD. * * @param mixed $dividend Dividend + * Or can be an array of values * @param mixed $divisor Divisor + * Or can be an array of values * - * @return float|int|string Remainder, or a string containing an error + * @return array|float|int|string Remainder, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function mod($dividend, $divisor) { + if (is_array($dividend) || is_array($divisor)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $dividend, $divisor); + } + try { $dividend = Helpers::validateNumericNullBool($dividend); $divisor = Helpers::validateNumericNullBool($divisor); @@ -40,13 +51,21 @@ class Operations * * Computes x raised to the power y. * - * @param float|int $x - * @param float|int $y + * @param array|float|int $x + * Or can be an array of values + * @param array|float|int $y + * Or can be an array of values * - * @return float|int|string The result, or a string containing an error + * @return array|float|int|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function power($x, $y) { + if (is_array($x) || is_array($y)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y); + } + try { $x = Helpers::validateNumericNullBool($x); $y = Helpers::validateNumericNullBool($y); @@ -117,12 +136,20 @@ class Operations * QUOTIENT(value1,value2) * * @param mixed $numerator Expect float|int + * Or can be an array of values * @param mixed $denominator Expect float|int + * Or can be an array of values * - * @return int|string + * @return array|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function quotient($numerator, $denominator) { + if (is_array($numerator) || is_array($denominator)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $numerator, $denominator); + } + try { $numerator = Helpers::validateNumericNullSubstitution($numerator, 0); $denominator = Helpers::validateNumericNullSubstitution($denominator, 0); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php index 963a789ac..76e983e59 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php @@ -2,10 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; +use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Random { + use ArrayEnabled; + /** * RAND. * @@ -20,12 +24,20 @@ class Random * RANDBETWEEN. * * @param mixed $min Minimal value + * Or can be an array of values * @param mixed $max Maximal value + * Or can be an array of values * - * @return float|int|string Random number + * @return array|float|int|string Random number + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function randBetween($min, $max) { + if (is_array($min) || is_array($max)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $min, $max); + } + try { $min = (int) Helpers::validateNumericNullBool($min); $max = (int) Helpers::validateNumericNullBool($max); @@ -36,4 +48,52 @@ class Random return mt_rand($min, $max); } + + /** + * RANDARRAY. + * + * Generates a list of sequential numbers in an array. + * + * Excel Function: + * RANDARRAY([rows],[columns],[start],[step]) + * + * @param mixed $rows the number of rows to return, defaults to 1 + * @param mixed $columns the number of columns to return, defaults to 1 + * @param mixed $min the minimum number to be returned, defaults to 0 + * @param mixed $max the maximum number to be returned, defaults to 1 + * @param bool $wholeNumber the type of numbers to return: + * False - Decimal numbers to 15 decimal places. (default) + * True - Whole (integer) numbers + * + * @return array|string The resulting array, or a string containing an error + */ + public static function randArray($rows = 1, $columns = 1, $min = 0, $max = 1, $wholeNumber = false) + { + try { + $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1); + Helpers::validatePositive($rows); + $columns = (int) Helpers::validateNumericNullSubstitution($columns, 1); + Helpers::validatePositive($columns); + $min = Helpers::validateNumericNullSubstitution($min, 1); + $max = Helpers::validateNumericNullSubstitution($max, 1); + + if ($max <= $min) { + return Functions::VALUE(); + } + } catch (Exception $e) { + return $e->getMessage(); + } + + return array_chunk( + array_map( + function () use ($min, $max, $wholeNumber) { + return $wholeNumber + ? mt_rand((int) $min, (int) $max) + : (mt_rand() / mt_getrandmax()) * ($max - $min) + $min; + }, + array_fill(0, $rows * $columns, $min) + ), + max($columns, 1) + ); + } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php index 71a6df3ad..7d771b296 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Roman { + use ArrayEnabled; + private const VALUES = [ 45 => ['VL'], 46 => ['VLI'], @@ -814,12 +817,20 @@ class Roman * Converts a number to Roman numeral * * @param mixed $aValue Number to convert + * Or can be an array of numbers * @param mixed $style Number indicating one of five possible forms + * Or can be an array of styles * - * @return string Roman numeral, or a string containing an error + * @return array|string Roman numeral, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($aValue, $style = 0) { + if (is_array($aValue) || is_array($style)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $aValue, $style); + } + try { $aValue = Helpers::validateNumericNullBool($aValue); if (is_bool($style)) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php index 2ddde9000..c419ca4d7 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php @@ -2,23 +2,32 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Round { + use ArrayEnabled; + /** * ROUND. * * Returns the result of builtin function round after validating args. * - * @param mixed $number Should be numeric - * @param mixed $precision Should be int + * @param mixed $number Should be numeric, or can be an array of numbers + * @param mixed $precision Should be int, or can be an array of numbers * - * @return float|string Rounded number + * @return array|float|string Rounded number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function round($number, $precision) { + if (is_array($number) || is_array($precision)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $precision); + } + try { $number = Helpers::validateNumericNullBool($number); $precision = Helpers::validateNumericNullBool($precision); @@ -34,13 +43,19 @@ class Round * * Rounds a number up to a specified number of decimal places * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number + * @param array|float $number Number to round, or can be an array of numbers + * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function up($number, $digits) { + if (is_array($number) || is_array($digits)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $digits); + } + try { $number = Helpers::validateNumericNullBool($number); $digits = (int) Helpers::validateNumericNullSubstitution($digits, null); @@ -64,13 +79,19 @@ class Round * * Rounds a number down to a specified number of decimal places * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number + * @param array|float $number Number to round, or can be an array of numbers + * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function down($number, $digits) { + if (is_array($number) || is_array($digits)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $digits); + } + try { $number = Helpers::validateNumericNullBool($number); $digits = (int) Helpers::validateNumericNullSubstitution($digits, null); @@ -94,13 +115,19 @@ class Round * * Rounds a number to the nearest multiple of a specified value * - * @param mixed $number Expect float. Number to round. - * @param mixed $multiple Expect int. Multiple to which you want to round. + * @param mixed $number Expect float. Number to round, or can be an array of numbers + * @param mixed $multiple Expect int. Multiple to which you want to round, or can be an array of numbers. * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function multiple($number, $multiple) { + if (is_array($number) || is_array($multiple)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $multiple); + } + try { $number = Helpers::validateNumericNullSubstitution($number, 0); $multiple = Helpers::validateNumericNullSubstitution($multiple, null); @@ -132,12 +159,18 @@ class Round * Excel Function: * EVEN(number) * - * @param float $number Number to round + * @param array|float $number Number to round, or can be an array of numbers * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function even($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -152,12 +185,18 @@ class Round * * Returns number rounded up to the nearest odd integer. * - * @param float $number Number to round + * @param array|float $number Number to round, or can be an array of numbers * - * @return float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function odd($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php index 2ada9df4e..ecce359fc 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class SeriesSum { + use ArrayEnabled; + /** * SERIESSUM. * @@ -17,10 +20,14 @@ class SeriesSum * @param mixed $m Step * @param mixed[] $args An array of coefficients for the Data Series * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function evaluate($x, $n, $m, ...$args) { + if (is_array($x) || is_array($n) || is_array($m)) { + return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 3, $x, $n, $m, ...$args); + } + try { $x = Helpers::validateNumericNullSubstitution($x, 0); $n = Helpers::validateNumericNullSubstitution($n, 0); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php index a48cf0f9b..e40e1f6d3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Sign { + use ArrayEnabled; + /** * SIGN. * * Determines the sign of a number. Returns 1 if the number is positive, zero (0) * if the number is 0, and -1 if the number is negative. * - * @param float $number Number to round + * @param array|float $number Number to round, or can be an array of numbers * - * @return int|string sign value, or a string containing an error + * @return array|int|string sign value, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php index 8ead578e3..bb9f15fda 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php @@ -2,21 +2,30 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Sqrt { + use ArrayEnabled; + /** * SQRT. * * Returns the result of builtin function sqrt after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string square roor + * @return array|float|string square root + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function sqrt($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -31,12 +40,18 @@ class Sqrt * * Returns the square root of (number * pi). * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string Square Root of Number * Pi, or a string containing an error + * @return array|float|string Square Root of Number * Pi, or a string containing an error + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function pi($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullSubstitution($number, 0); Helpers::validateNotNegative($number); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php index 2edb86f7e..be065791f 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php @@ -39,7 +39,10 @@ class Subtotal if ($cellReference->getWorksheet()->cellExists($column . $row)) { //take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula(); - $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue()); + $cellFormula = !preg_match( + '/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', + $cellReference->getWorksheet()->getCell($column . $row)->getValue() ?? '' + ); $retVal = !$isFormula || $cellFormula; } @@ -52,17 +55,17 @@ class Subtotal /** @var callable[] */ private const CALL_FUNCTIONS = [ - 1 => [Statistical\Averages::class, 'average'], - [Statistical\Counts::class, 'COUNT'], // 2 - [Statistical\Counts::class, 'COUNTA'], // 3 - [Statistical\Maximum::class, 'max'], // 4 - [Statistical\Minimum::class, 'min'], // 5 - [Operations::class, 'product'], // 6 - [Statistical\StandardDeviations::class, 'STDEV'], // 7 - [Statistical\StandardDeviations::class, 'STDEVP'], // 8 - [Sum::class, 'sumIgnoringStrings'], // 9 - [Statistical\Variances::class, 'VAR'], // 10 - [Statistical\Variances::class, 'VARP'], // 11 + 1 => [Statistical\Averages::class, 'average'], // 1 and 101 + [Statistical\Counts::class, 'COUNT'], // 2 and 102 + [Statistical\Counts::class, 'COUNTA'], // 3 and 103 + [Statistical\Maximum::class, 'max'], // 4 and 104 + [Statistical\Minimum::class, 'min'], // 5 and 105 + [Operations::class, 'product'], // 6 and 106 + [Statistical\StandardDeviations::class, 'STDEV'], // 7 and 107 + [Statistical\StandardDeviations::class, 'STDEVP'], // 8 and 108 + [Sum::class, 'sumIgnoringStrings'], // 9 and 109 + [Statistical\Variances::class, 'VAR'], // 10 and 110 + [Statistical\Variances::class, 'VARP'], // 111 and 111 ]; /** diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php index 3038e6cc0..845b6c146 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Cosecant { + use ArrayEnabled; + /** * CSC. * * Returns the cosecant of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The cosecant of the angle + * @return array|float|string The cosecant of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function csc($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -32,12 +41,18 @@ class Cosecant * * Returns the hyperbolic cosecant of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The hyperbolic cosecant of the angle + * @return array|float|string The hyperbolic cosecant of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function csch($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php index 6c69e126d..c06f04dfc 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Cosine { + use ArrayEnabled; + /** * COS. * * Returns the result of builtin function cos after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string cosine + * @return array|float|string cosine + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function cos($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -32,12 +41,18 @@ class Cosine * * Returns the result of builtin function cosh after validating args. * - * @param mixed $number Should be numeric + * @param mixed $number Should be numeric, or can be an array of numbers * - * @return float|string hyperbolic cosine + * @return array|float|string hyperbolic cosine + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function cosh($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -52,12 +67,18 @@ class Cosine * * Returns the arccosine of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The arccosine of the number + * @return array|float|string The arccosine of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function acos($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -72,12 +93,18 @@ class Cosine * * Returns the arc inverse hyperbolic cosine of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The inverse hyperbolic cosine of the number, or an error string + * @return array|float|string The inverse hyperbolic cosine of the number, or an error string + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function acosh($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php index 1b796f50f..eeedef9bf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Cotangent { + use ArrayEnabled; + /** * COT. * * Returns the cotangent of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The cotangent of the angle + * @return array|float|string The cotangent of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function cot($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -32,12 +41,18 @@ class Cotangent * * Returns the hyperbolic cotangent of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The hyperbolic cotangent of the angle + * @return array|float|string The hyperbolic cotangent of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function coth($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -52,12 +67,18 @@ class Cotangent * * Returns the arccotangent of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The arccotangent of the number + * @return array|float|string The arccotangent of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function acot($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -72,12 +93,18 @@ class Cotangent * * Returns the hyperbolic arccotangent of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The hyperbolic arccotangent of the number + * @return array|float|string The hyperbolic arccotangent of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function acoth($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php index 70299cb7e..2d26e5ddf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Secant { + use ArrayEnabled; + /** * SEC. * * Returns the secant of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The secant of the angle + * @return array|float|string The secant of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function sec($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -32,12 +41,18 @@ class Secant * * Returns the hyperbolic secant of an angle. * - * @param float $angle Number + * @param array|float $angle Number, or can be an array of numbers * - * @return float|string The hyperbolic secant of the angle + * @return array|float|string The hyperbolic secant of the angle + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function sech($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php index 2c6a8a071..6af568ce2 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php @@ -2,22 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Sine { + use ArrayEnabled; + /** * SIN. * * Returns the result of builtin function sin after validating args. * - * @param mixed $angle Should be numeric + * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return float|string sine + * @return array|float|string sine + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function sin($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -32,12 +41,18 @@ class Sine * * Returns the result of builtin function sinh after validating args. * - * @param mixed $angle Should be numeric + * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return float|string hyperbolic sine + * @return array|float|string hyperbolic sine + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function sinh($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -52,12 +67,18 @@ class Sine * * Returns the arcsine of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The arcsine of the number + * @return array|float|string The arcsine of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function asin($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -72,12 +93,18 @@ class Sine * * Returns the inverse hyperbolic sine of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The inverse hyperbolic sine of the number + * @return array|float|string The inverse hyperbolic sine of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function asinh($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php index 6cd235fb7..26bd44f72 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php @@ -2,23 +2,32 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers; class Tangent { + use ArrayEnabled; + /** * TAN. * * Returns the result of builtin function tan after validating args. * - * @param mixed $angle Should be numeric + * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return float|string tangent + * @return array|float|string tangent + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function tan($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -33,12 +42,18 @@ class Tangent * * Returns the result of builtin function sinh after validating args. * - * @param mixed $angle Should be numeric + * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return float|string hyperbolic tangent + * @return array|float|string hyperbolic tangent + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function tanh($angle) { + if (is_array($angle)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle); + } + try { $angle = Helpers::validateNumericNullBool($angle); } catch (Exception $e) { @@ -53,12 +68,18 @@ class Tangent * * Returns the arctangent of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The arctangent of the number + * @return array|float|string The arctangent of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function atan($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -73,12 +94,18 @@ class Tangent * * Returns the inverse hyperbolic tangent of a number. * - * @param float $number Number + * @param array|float $number Number, or can be an array of numbers * - * @return float|string The inverse hyperbolic tangent of the number + * @return array|float|string The inverse hyperbolic tangent of the number + * If an array of numbers is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function atanh($number) { + if (is_array($number)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number); + } + try { $number = Helpers::validateNumericNullBool($number); } catch (Exception $e) { @@ -104,13 +131,20 @@ class Tangent * Excel Function: * ATAN2(xCoordinate,yCoordinate) * - * @param mixed $xCoordinate should be float, the x-coordinate of the point - * @param mixed $yCoordinate should be float, the y-coordinate of the point + * @param mixed $xCoordinate should be float, the x-coordinate of the point, or can be an array of numbers + * @param mixed $yCoordinate should be float, the y-coordinate of the point, or can be an array of numbers * - * @return float|string the inverse tangent of the specified x- and y-coordinates, or a string containing an error + * @return array|float|string + * The inverse tangent of the specified x- and y-coordinates, or a string containing an error + * If an array of numbers is passed as one of the arguments, then the returned result will also be an array + * with the same dimensions */ public static function atan2($xCoordinate, $yCoordinate) { + if (is_array($xCoordinate) || is_array($yCoordinate)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $xCoordinate, $yCoordinate); + } + try { $xCoordinate = Helpers::validateNumericNullBool($xCoordinate); $yCoordinate = Helpers::validateNumericNullBool($yCoordinate); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php index 4b3670f68..943e209dd 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php @@ -2,22 +2,33 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Trunc { + use ArrayEnabled; + /** * TRUNC. * * Truncates value to the number of fractional digits by number_digits. * - * @param float $value - * @param int $digits + * @param array|float $value + * Or can be an array of values + * @param array|int $digits + * Or can be an array of values * - * @return float|string Truncated value, or a string containing an error + * @return array|float|string Truncated value, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function evaluate($value = 0, $digits = 0) { + if (is_array($value) || is_array($digits)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $digits); + } + try { $value = Helpers::validateNumericNullBool($value); $digits = Helpers::validateNumericNullSubstitution($digits, null); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php index d43a85f90..73db0aa77 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php @@ -130,7 +130,7 @@ class Statistical * @param mixed $rMin * @param mixed $rMax * - * @return float|string + * @return array|float|string */ public static function BETADIST($value, $alpha, $beta, $rMin = 0, $rMax = 1) { @@ -153,7 +153,7 @@ class Statistical * @param float $rMin Minimum value * @param float $rMax Maximum value * - * @return float|string + * @return array|float|string */ public static function BETAINV($probability, $alpha, $beta, $rMin = 0, $rMax = 1) { @@ -179,7 +179,7 @@ class Statistical * @param mixed $probability Probability of success on each trial * @param mixed $cumulative * - * @return float|string + * @return array|float|string */ public static function BINOMDIST($value, $trials, $probability, $cumulative) { @@ -199,7 +199,7 @@ class Statistical * @param float $value Value for the function * @param float $degrees degrees of freedom * - * @return float|string + * @return array|float|string */ public static function CHIDIST($value, $degrees) { @@ -219,7 +219,7 @@ class Statistical * @param float $probability Probability for the function * @param float $degrees degrees of freedom * - * @return float|string + * @return array|float|string */ public static function CHIINV($probability, $degrees) { @@ -240,7 +240,7 @@ class Statistical * @param float $stdDev Standard Deviation * @param float $size * - * @return float|string + * @return array|float|string */ public static function CONFIDENCE($alpha, $stdDev, $size) { @@ -415,7 +415,7 @@ class Statistical * @param float $probability probability of a success on each trial * @param float $alpha criterion value * - * @return int|string + * @return array|int|string */ public static function CRITBINOM($trials, $probability, $alpha) { @@ -460,7 +460,7 @@ class Statistical * @param float $lambda The parameter value * @param bool $cumulative * - * @return float|string + * @return array|float|string */ public static function EXPONDIST($value, $lambda, $cumulative) { @@ -486,7 +486,7 @@ class Statistical * @param bool $cumulative If cumulative is TRUE, F.DIST returns the cumulative distribution function; * if FALSE, it returns the probability density function. * - * @return float|string + * @return array|float|string */ public static function FDIST2($value, $u, $v, $cumulative) { @@ -507,7 +507,7 @@ class Statistical * * @param float $value * - * @return float|string + * @return array|float|string */ public static function FISHER($value) { @@ -528,7 +528,7 @@ class Statistical * * @param float $value * - * @return float|string + * @return array|float|string */ public static function FISHERINV($value) { @@ -549,7 +549,7 @@ class Statistical * @param mixed $yValues array of mixed Data Series Y * @param mixed $xValues of mixed Data Series X * - * @return bool|float|string + * @return array|bool|float|string */ public static function FORECAST($xValue, $yValues, $xValues) { @@ -568,7 +568,7 @@ class Statistical * * @param float $value * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function GAMMAFunction($value) { @@ -590,7 +590,7 @@ class Statistical * @param float $b Parameter to the distribution * @param bool $cumulative * - * @return float|string + * @return array|float|string */ public static function GAMMADIST($value, $a, $b, $cumulative) { @@ -611,7 +611,7 @@ class Statistical * @param float $alpha Parameter to the distribution * @param float $beta Parameter to the distribution * - * @return float|string + * @return array|float|string */ public static function GAMMAINV($probability, $alpha, $beta) { @@ -630,7 +630,7 @@ class Statistical * * @param float $value * - * @return float|string + * @return array|float|string */ public static function GAMMALN($value) { @@ -650,7 +650,7 @@ class Statistical * * @param float $value * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function GAUSS($value) { @@ -742,7 +742,7 @@ class Statistical * @param mixed $populationSuccesses Number of successes in the population * @param mixed $populationNumber Population size * - * @return float|string + * @return array|float|string */ public static function HYPGEOMDIST($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) { @@ -879,7 +879,7 @@ class Statistical * @param float $mean * @param float $stdDev * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error * * @TODO Try implementing P J Acklam's refinement algorithm for greater * accuracy if I can get my head round the mathematics @@ -905,7 +905,7 @@ class Statistical * @param float $mean * @param float $stdDev * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function LOGNORMDIST($value, $mean, $stdDev) { @@ -928,7 +928,7 @@ class Statistical * @param float $stdDev * @param bool $cumulative * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function LOGNORMDIST2($value, $mean, $stdDev, $cumulative = false) { @@ -1131,7 +1131,7 @@ class Statistical * @param mixed $successes Threshold number of Successes * @param mixed $probability Probability of success on each trial * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NEGBINOMDIST($failures, $successes, $probability) { @@ -1155,7 +1155,7 @@ class Statistical * @param mixed $stdDev Standard Deviation * @param mixed $cumulative * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NORMDIST($value, $mean, $stdDev, $cumulative) { @@ -1176,7 +1176,7 @@ class Statistical * @param mixed $mean Mean Value * @param mixed $stdDev Standard Deviation * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NORMINV($probability, $mean, $stdDev) { @@ -1197,7 +1197,7 @@ class Statistical * * @param mixed $value * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NORMSDIST($value) { @@ -1219,7 +1219,7 @@ class Statistical * @param mixed $value * @param mixed $cumulative * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NORMSDIST2($value, $cumulative) { @@ -1238,7 +1238,7 @@ class Statistical * * @param mixed $value * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function NORMSINV($value) { @@ -1308,7 +1308,7 @@ class Statistical * @param int $numObjs Number of different objects * @param int $numInSet Number of objects in each permutation * - * @return float|int|string Number of permutations, or a string containing an error + * @return array|float|int|string Number of permutations, or a string containing an error */ public static function PERMUT($numObjs, $numInSet) { @@ -1331,7 +1331,7 @@ class Statistical * @param mixed $mean Mean Value * @param mixed $cumulative * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function POISSON($value, $mean, $cumulative) { @@ -1480,7 +1480,7 @@ class Statistical * @param float $mean Mean Value * @param float $stdDev Standard Deviation * - * @return float|string Standardized value, or a string containing an error + * @return array|float|string Standardized value, or a string containing an error */ public static function STANDARDIZE($value, $mean, $stdDev) { @@ -1610,7 +1610,7 @@ class Statistical * @param float $degrees degrees of freedom * @param float $tails number of tails (1 or 2) * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function TDIST($value, $degrees, $tails) { @@ -1630,7 +1630,7 @@ class Statistical * @param float $probability Probability for the function * @param float $degrees degrees of freedom * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error */ public static function TINV($probability, $degrees) { @@ -1787,7 +1787,7 @@ class Statistical * @param float $beta Beta Parameter * @param bool $cumulative * - * @return float|string (string if result is an error) + * @return array|float|string (string if result is an error) */ public static function WEIBULL($value, $alpha, $beta, $cumulative) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages.php index 1a627e99d..c6d84e741 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages.php @@ -24,7 +24,7 @@ class Averages extends AggregateBase $aArgs = Functions::flattenArrayIndexed($args); // Return value - $returnValue = 0; + $returnValue = 0.0; $aMean = self::average(...$args); if ($aMean === Functions::DIV0()) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php index c59c3a9ec..8f1a00180 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php @@ -2,27 +2,35 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Confidence { + use ArrayEnabled; + /** * CONFIDENCE. * * Returns the confidence interval for a population mean * * @param mixed $alpha As a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * @param mixed $size As an integer + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function CONFIDENCE($alpha, $stdDev, $size) { - $alpha = Functions::flattenSingleValue($alpha); - $stdDev = Functions::flattenSingleValue($stdDev); - $size = Functions::flattenSingleValue($size); + if (is_array($alpha) || is_array($stdDev) || is_array($size)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $alpha, $stdDev, $size); + } try { $alpha = StatisticalValidations::validateFloat($alpha); @@ -36,6 +44,6 @@ class Confidence return Functions::NAN(); } - return Distributions\StandardNormal::inverse(1 - $alpha / 2) * $stdDev / sqrt($size); + return Functions::scalar(Distributions\StandardNormal::inverse(1 - $alpha / 2) * $stdDev / sqrt($size)); } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php index 63e6eb4d6..0c6131dd6 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Beta { + use ArrayEnabled; + private const MAX_ITERATIONS = 256; private const LOG_GAMMA_X_MAX_VALUE = 2.55e305; @@ -19,20 +22,28 @@ class Beta * Returns the beta distribution. * * @param mixed $value Float value at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $alpha Parameter to the distribution as a float + * Or can be an array of values * @param mixed $beta Parameter to the distribution as a float + * Or can be an array of values * @param mixed $rMin as an float + * Or can be an array of values * @param mixed $rMax as an float + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $alpha, $beta, $rMin = 0.0, $rMax = 1.0) { - $value = Functions::flattenSingleValue($value); - $alpha = Functions::flattenSingleValue($alpha); - $beta = Functions::flattenSingleValue($beta); - $rMin = ($rMin === null) ? 0.0 : Functions::flattenSingleValue($rMin); - $rMax = ($rMax === null) ? 1.0 : Functions::flattenSingleValue($rMax); + if (is_array($value) || is_array($alpha) || is_array($beta) || is_array($rMin) || is_array($rMax)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $alpha, $beta, $rMin, $rMax); + } + + $rMin = $rMin ?? 0.0; + $rMax = $rMax ?? 1.0; try { $value = DistributionValidations::validateFloat($value); @@ -65,20 +76,28 @@ class Beta * Returns the inverse of the Beta distribution. * * @param mixed $probability Float probability at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $alpha Parameter to the distribution as a float + * Or can be an array of values * @param mixed $beta Parameter to the distribution as a float + * Or can be an array of values * @param mixed $rMin Minimum value as a float + * Or can be an array of values * @param mixed $rMax Maximum value as a float + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($probability, $alpha, $beta, $rMin = 0.0, $rMax = 1.0) { - $probability = Functions::flattenSingleValue($probability); - $alpha = Functions::flattenSingleValue($alpha); - $beta = Functions::flattenSingleValue($beta); - $rMin = ($rMin === null) ? 0.0 : Functions::flattenSingleValue($rMin); - $rMax = ($rMax === null) ? 1.0 : Functions::flattenSingleValue($rMax); + if (is_array($probability) || is_array($alpha) || is_array($beta) || is_array($rMin) || is_array($rMax)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $alpha, $beta, $rMin, $rMax); + } + + $rMin = $rMin ?? 0.0; + $rMax = $rMax ?? 1.0; try { $probability = DistributionValidations::validateProbability($probability); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php index 9631236ab..d188f2af3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations; class Binomial { + use ArrayEnabled; + /** * BINOMDIST. * @@ -18,17 +21,23 @@ class Binomial * babies born are male. * * @param mixed $value Integer number of successes in trials + * Or can be an array of values * @param mixed $trials Integer umber of trials + * Or can be an array of values * @param mixed $probability Probability of success on each trial as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $trials, $probability, $cumulative) { - $value = Functions::flattenSingleValue($value); - $trials = Functions::flattenSingleValue($trials); - $probability = Functions::flattenSingleValue($probability); + if (is_array($value) || is_array($trials) || is_array($probability) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $trials, $probability, $cumulative); + } try { $value = DistributionValidations::validateInt($value); @@ -58,19 +67,26 @@ class Binomial * of trials falling into a specified range. * * @param mixed $trials Integer number of trials + * Or can be an array of values * @param mixed $probability Probability of success on each trial as a float + * Or can be an array of values * @param mixed $successes The integer number of successes in trials + * Or can be an array of values * @param mixed $limit Upper limit for successes in trials as null, or an integer * If null, then this will indicate the same as the number of Successes + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function range($trials, $probability, $successes, $limit = null) { - $trials = Functions::flattenSingleValue($trials); - $probability = Functions::flattenSingleValue($probability); - $successes = Functions::flattenSingleValue($successes); - $limit = ($limit === null) ? $successes : Functions::flattenSingleValue($limit); + if (is_array($trials) || is_array($probability) || is_array($successes) || is_array($limit)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $trials, $probability, $successes, $limit); + } + + $limit = $limit ?? $successes; try { $trials = DistributionValidations::validateInt($trials); @@ -107,19 +123,24 @@ class Binomial * variable. Like the binomial, trials are assumed to be independent. * * @param mixed $failures Number of Failures as an integer + * Or can be an array of values * @param mixed $successes Threshold number of Successes as an integer + * Or can be an array of values * @param mixed $probability Probability of success on each trial as a float + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions * * TODO Add support for the cumulative flag not present for NEGBINOMDIST, but introduced for NEGBINOM.DIST * The cumulative default should be false to reflect the behaviour of NEGBINOMDIST */ public static function negative($failures, $successes, $probability) { - $failures = Functions::flattenSingleValue($failures); - $successes = Functions::flattenSingleValue($successes); - $probability = Functions::flattenSingleValue($probability); + if (is_array($failures) || is_array($successes) || is_array($probability)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $failures, $successes, $probability); + } try { $failures = DistributionValidations::validateInt($failures); @@ -143,22 +164,27 @@ class Binomial } /** - * CRITBINOM. + * BINOM.INV. * * Returns the smallest value for which the cumulative binomial distribution is greater * than or equal to a criterion value * * @param mixed $trials number of Bernoulli trials as an integer + * Or can be an array of values * @param mixed $probability probability of a success on each trial as a float + * Or can be an array of values * @param mixed $alpha criterion value as a float + * Or can be an array of values * - * @return int|string + * @return array|int|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($trials, $probability, $alpha) { - $trials = Functions::flattenSingleValue($trials); - $probability = Functions::flattenSingleValue($probability); - $alpha = Functions::flattenSingleValue($alpha); + if (is_array($trials) || is_array($probability) || is_array($alpha)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $trials, $probability, $alpha); + } try { $trials = DistributionValidations::validateInt($trials); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php index 5165d6397..4ccae9320 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class ChiSquared { + use ArrayEnabled; + private const MAX_ITERATIONS = 256; private const EPS = 2.22e-16; @@ -17,14 +20,19 @@ class ChiSquared * Returns the one-tailed probability of the chi-squared distribution. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $degrees Integer degrees of freedom + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distributionRightTail($value, $degrees) { - $value = Functions::flattenSingleValue($value); - $degrees = Functions::flattenSingleValue($degrees); + if (is_array($value) || is_array($degrees)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees); + } try { $value = DistributionValidations::validateFloat($value); @@ -53,16 +61,21 @@ class ChiSquared * Returns the one-tailed probability of the chi-squared distribution. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $degrees Integer degrees of freedom + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distributionLeftTail($value, $degrees, $cumulative) { - $value = Functions::flattenSingleValue($value); - $degrees = Functions::flattenSingleValue($degrees); - $cumulative = Functions::flattenSingleValue($cumulative); + if (is_array($value) || is_array($degrees) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); @@ -97,14 +110,19 @@ class ChiSquared * Returns the inverse of the right-tailed probability of the chi-squared distribution. * * @param mixed $probability Float probability at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $degrees Integer degrees of freedom + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverseRightTail($probability, $degrees) { - $probability = Functions::flattenSingleValue($probability); - $degrees = Functions::flattenSingleValue($degrees); + if (is_array($probability) || is_array($degrees)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees); + } try { $probability = DistributionValidations::validateProbability($probability); @@ -133,14 +151,19 @@ class ChiSquared * Returns the inverse of the left-tailed probability of the chi-squared distribution. * * @param mixed $probability Float probability at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $degrees Integer degrees of freedom + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverseLeftTail($probability, $degrees) { - $probability = Functions::flattenSingleValue($probability); - $degrees = Functions::flattenSingleValue($degrees); + if (is_array($probability) || is_array($degrees)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees); + } try { $probability = DistributionValidations::validateProbability($probability); @@ -193,7 +216,7 @@ class ChiSquared $degrees = self::degrees($rows, $columns); - $result = self::distributionRightTail($result, $degrees); + $result = Functions::scalar(self::distributionRightTail($result, $degrees)); return $result; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php index b3fd9460c..ca55857e7 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Exponential { + use ArrayEnabled; + /** * EXPONDIST. * @@ -15,16 +18,21 @@ class Exponential * use EXPONDIST to determine the probability that the process takes at most 1 minute. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $lambda The parameter value as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $lambda, $cumulative) { - $value = Functions::flattenSingleValue($value); - $lambda = Functions::flattenSingleValue($lambda); - $cumulative = Functions::flattenSingleValue($cumulative); + if (is_array($value) || is_array($lambda) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $lambda, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php index 54b1950d6..0fd0aab33 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class F { + use ArrayEnabled; + /** * F.DIST. * @@ -16,18 +19,23 @@ class F * if the variability in the females is different from that found in the males. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $u The numerator degrees of freedom as an integer + * Or can be an array of values * @param mixed $v The denominator degrees of freedom as an integer + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $u, $v, $cumulative) { - $value = Functions::flattenSingleValue($value); - $u = Functions::flattenSingleValue($u); - $v = Functions::flattenSingleValue($v); - $cumulative = Functions::flattenSingleValue($cumulative); + if (is_array($value) || is_array($u) || is_array($v) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $u, $v, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php index 923bf02d9..8d1b5ce6e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Fisher { + use ArrayEnabled; + /** * FISHER. * @@ -15,12 +18,17 @@ class Fisher * testing on the correlation coefficient. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value) { - $value = Functions::flattenSingleValue($value); + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } try { DistributionValidations::validateFloat($value); @@ -43,12 +51,17 @@ class Fisher * FISHERINV(y) = x. * * @param mixed $probability Float probability at which you want to evaluate the distribution + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($probability) { - $probability = Functions::flattenSingleValue($probability); + if (is_array($probability)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $probability); + } try { DistributionValidations::validateFloat($probability); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php index 2c6ed670a..adf534287 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php @@ -2,23 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Gamma extends GammaBase { + use ArrayEnabled; + /** * GAMMA. * * Return the gamma function value. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function gamma($value) { - $value = Functions::flattenSingleValue($value); + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } try { $value = DistributionValidations::validateFloat($value); @@ -39,17 +47,23 @@ class Gamma extends GammaBase * Returns the gamma distribution. * * @param mixed $value Float Value at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $a Parameter to the distribution as a float + * Or can be an array of values * @param mixed $b Parameter to the distribution as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $a, $b, $cumulative) { - $value = Functions::flattenSingleValue($value); - $a = Functions::flattenSingleValue($a); - $b = Functions::flattenSingleValue($b); + if (is_array($value) || is_array($a) || is_array($b) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $a, $b, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); @@ -73,16 +87,21 @@ class Gamma extends GammaBase * Returns the inverse of the Gamma distribution. * * @param mixed $probability Float probability at which you want to evaluate the distribution + * Or can be an array of values * @param mixed $alpha Parameter to the distribution as a float + * Or can be an array of values * @param mixed $beta Parameter to the distribution as a float + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($probability, $alpha, $beta) { - $probability = Functions::flattenSingleValue($probability); - $alpha = Functions::flattenSingleValue($alpha); - $beta = Functions::flattenSingleValue($beta); + if (is_array($probability) || is_array($alpha) || is_array($beta)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $alpha, $beta); + } try { $probability = DistributionValidations::validateProbability($probability); @@ -105,12 +124,17 @@ class Gamma extends GammaBase * Returns the natural logarithm of the gamma function. * * @param mixed $value Float Value at which you want to evaluate the distribution + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function ln($value) { - $value = Functions::flattenSingleValue($value); + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } try { $value = DistributionValidations::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php index fe30c0879..bb7adf7bd 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations; class HyperGeometric { + use ArrayEnabled; + /** * HYPGEOMDIST. * @@ -15,18 +18,32 @@ class HyperGeometric * sample successes, given the sample size, population successes, and population size. * * @param mixed $sampleSuccesses Integer number of successes in the sample + * Or can be an array of values * @param mixed $sampleNumber Integer size of the sample + * Or can be an array of values * @param mixed $populationSuccesses Integer number of successes in the population + * Or can be an array of values * @param mixed $populationNumber Integer population size + * Or can be an array of values * - * @return float|string + * @return array|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) { - $sampleSuccesses = Functions::flattenSingleValue($sampleSuccesses); - $sampleNumber = Functions::flattenSingleValue($sampleNumber); - $populationSuccesses = Functions::flattenSingleValue($populationSuccesses); - $populationNumber = Functions::flattenSingleValue($populationNumber); + if ( + is_array($sampleSuccesses) || is_array($sampleNumber) || + is_array($populationSuccesses) || is_array($populationNumber) + ) { + return self::evaluateArrayArguments( + [self::class, __FUNCTION__], + $sampleSuccesses, + $sampleNumber, + $populationSuccesses, + $populationNumber + ); + } try { $sampleSuccesses = DistributionValidations::validateInt($sampleSuccesses); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php index e15237736..4bf2e0c5b 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class LogNormal { + use ArrayEnabled; + /** * LOGNORMDIST. * @@ -14,16 +17,21 @@ class LogNormal * with parameters mean and standard_dev. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $mean Mean value as a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function cumulative($value, $mean, $stdDev) { - $value = Functions::flattenSingleValue($value); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); + if (is_array($value) || is_array($mean) || is_array($stdDev)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $stdDev); + } try { $value = DistributionValidations::validateFloat($value); @@ -47,18 +55,23 @@ class LogNormal * with parameters mean and standard_dev. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $mean Mean value as a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $mean, $stdDev, $cumulative = false) { - $value = Functions::flattenSingleValue($value); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); - $cumulative = Functions::flattenSingleValue($cumulative); + if (is_array($value) || is_array($mean) || is_array($stdDev) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $stdDev, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); @@ -87,10 +100,15 @@ class LogNormal * Returns the inverse of the lognormal cumulative distribution * * @param mixed $probability Float probability for which we want the value + * Or can be an array of values * @param mixed $mean Mean Value as a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions * * @TODO Try implementing P J Acklam's refinement algorithm for greater * accuracy if I can get my head round the mathematics @@ -98,9 +116,9 @@ class LogNormal */ public static function inverse($probability, $mean, $stdDev) { - $probability = Functions::flattenSingleValue($probability); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); + if (is_array($probability) || is_array($mean) || is_array($stdDev)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $mean, $stdDev); + } try { $probability = DistributionValidations::validateProbability($probability); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php index 4d158b8c8..f876ed6d7 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Engineering; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Normal { + use ArrayEnabled; + public const SQRT2PI = 2.5066282746310005024157652848110452530069867406099; /** @@ -18,17 +21,23 @@ class Normal * testing. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $mean Mean value as a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $mean, $stdDev, $cumulative) { - $value = Functions::flattenSingleValue($value); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); + if (is_array($value) || is_array($mean) || is_array($stdDev) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $stdDev, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); @@ -56,16 +65,21 @@ class Normal * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation. * * @param mixed $probability Float probability for which we want the value + * Or can be an array of values * @param mixed $mean Mean Value as a float + * Or can be an array of values * @param mixed $stdDev Standard Deviation as a float + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($probability, $mean, $stdDev) { - $probability = Functions::flattenSingleValue($probability); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); + if (is_array($probability) || is_array($mean) || is_array($stdDev)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $mean, $stdDev); + } try { $probability = DistributionValidations::validateProbability($probability); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php index e7252e028..484bed31f 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig; class Poisson { + use ArrayEnabled; + /** * POISSON. * @@ -16,15 +19,21 @@ class Poisson * cars arriving at a toll plaza in 1 minute. * * @param mixed $value Float value for which we want the probability + * Or can be an array of values * @param mixed $mean Mean value as a float + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $mean, $cumulative) { - $value = Functions::flattenSingleValue($value); - $mean = Functions::flattenSingleValue($mean); + if (is_array($value) || is_array($mean) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php index d10f02a5f..575add8a5 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages; use PhpOffice\PhpSpreadsheet\Calculation\Statistical\StandardDeviations; class StandardNormal { + use ArrayEnabled; + /** * NORMSDIST. * @@ -15,9 +18,16 @@ class StandardNormal * a mean of 0 (zero) and a standard deviation of one. Use this function in place of a * table of standard normal curve areas. * - * @param mixed $value Float value for which we want the probability + * NOTE: We don't need to check for arrays to array-enable this function, because that is already + * handled by the logic in Normal::distribution() + * All we need to do is pass the value through as scalar or as array. * - * @return float|string The result, or a string containing an error + * @param mixed $value Float value for which we want the probability + * Or can be an array of values + * + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function cumulative($value) { @@ -31,10 +41,18 @@ class StandardNormal * a mean of 0 (zero) and a standard deviation of one. Use this function in place of a * table of standard normal curve areas. * - * @param mixed $value Float value for which we want the probability - * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * NOTE: We don't need to check for arrays to array-enable this function, because that is already + * handled by the logic in Normal::distribution() + * All we need to do is pass the value and cumulative through as scalar or as array. * - * @return float|string The result, or a string containing an error + * @param mixed $value Float value for which we want the probability + * Or can be an array of values + * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values + * + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $cumulative) { @@ -46,9 +64,16 @@ class StandardNormal * * Returns the inverse of the standard normal cumulative distribution * - * @param mixed $value Float probability for which we want the value + * @param mixed $value float probability for which we want the value + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * NOTE: We don't need to check for arrays to array-enable this function, because that is already + * handled by the logic in Normal::inverse() + * All we need to do is pass the value through as scalar or as array + * + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($value) { @@ -62,12 +87,18 @@ class StandardNormal * the mean and z standard deviations from the mean. * * @param mixed $value + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function gauss($value) { - $value = Functions::flattenSingleValue($value); + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + if (!is_numeric($value)) { return Functions::VALUE(); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StudentT.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StudentT.php index 45d590dd6..27539d622 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StudentT.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StudentT.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class StudentT { + use ArrayEnabled; + private const MAX_ITERATIONS = 256; /** @@ -15,16 +18,21 @@ class StudentT * Returns the probability of Student's T distribution. * * @param mixed $value Float value for the distribution + * Or can be an array of values * @param mixed $degrees Integer value for degrees of freedom + * Or can be an array of values * @param mixed $tails Integer value for the number of tails (1 or 2) + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $degrees, $tails) { - $value = Functions::flattenSingleValue($value); - $degrees = Functions::flattenSingleValue($degrees); - $tails = Functions::flattenSingleValue($tails); + if (is_array($value) || is_array($degrees) || is_array($tails)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees, $tails); + } try { $value = DistributionValidations::validateFloat($value); @@ -47,14 +55,19 @@ class StudentT * Returns the one-tailed probability of the chi-squared distribution. * * @param mixed $probability Float probability for the function + * Or can be an array of values * @param mixed $degrees Integer value for degrees of freedom + * Or can be an array of values * - * @return float|string The result, or a string containing an error + * @return array|float|string The result, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function inverse($probability, $degrees) { - $probability = Functions::flattenSingleValue($probability); - $degrees = Functions::flattenSingleValue($degrees); + if (is_array($probability) || is_array($degrees)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees); + } try { $probability = DistributionValidations::validateProbability($probability); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php index ecec8a856..053a27edf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php @@ -2,11 +2,14 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Weibull { + use ArrayEnabled; + /** * WEIBULL. * @@ -14,18 +17,23 @@ class Weibull * analysis, such as calculating a device's mean time to failure. * * @param mixed $value Float value for the distribution + * Or can be an array of values * @param mixed $alpha Float alpha Parameter + * Or can be an array of values * @param mixed $beta Float beta Parameter + * Or can be an array of values * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false) + * Or can be an array of values * - * @return float|string (string if result is an error) + * @return array|float|string (string if result is an error) + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function distribution($value, $alpha, $beta, $cumulative) { - $value = Functions::flattenSingleValue($value); - $alpha = Functions::flattenSingleValue($alpha); - $beta = Functions::flattenSingleValue($beta); - $cumulative = Functions::flattenSingleValue($cumulative); + if (is_array($value) || is_array($alpha) || is_array($beta) || is_array($cumulative)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $alpha, $beta, $cumulative); + } try { $value = DistributionValidations::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php index 272a8a53d..7696878e8 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php @@ -2,6 +2,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig; @@ -9,6 +10,8 @@ use PhpOffice\PhpSpreadsheet\Shared\IntOrFloat; class Permutations { + use ArrayEnabled; + /** * PERMUT. * @@ -19,14 +22,19 @@ class Permutations * for lottery-style probability calculations. * * @param mixed $numObjs Integer number of different objects + * Or can be an array of values * @param mixed $numInSet Integer number of objects in each permutation + * Or can be an array of values * - * @return float|int|string Number of permutations, or a string containing an error + * @return array|float|int|string Number of permutations, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function PERMUT($numObjs, $numInSet) { - $numObjs = Functions::flattenSingleValue($numObjs); - $numInSet = Functions::flattenSingleValue($numInSet); + if (is_array($numObjs) || is_array($numInSet)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet); + } try { $numObjs = StatisticalValidations::validateInt($numObjs); @@ -50,14 +58,19 @@ class Permutations * that can be selected from the total objects. * * @param mixed $numObjs Integer number of different objects + * Or can be an array of values * @param mixed $numInSet Integer number of objects in each permutation + * Or can be an array of values * - * @return float|int|string Number of permutations, or a string containing an error + * @return array|float|int|string Number of permutations, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function PERMUTATIONA($numObjs, $numInSet) { - $numObjs = Functions::flattenSingleValue($numObjs); - $numInSet = Functions::flattenSingleValue($numInSet); + if (is_array($numObjs) || is_array($numInSet)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet); + } try { $numObjs = StatisticalValidations::validateInt($numObjs); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Standardize.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Standardize.php index 2f3c58e72..13240cc25 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Standardize.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Standardize.php @@ -2,27 +2,35 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Standardize extends StatisticalValidations { + use ArrayEnabled; + /** * STANDARDIZE. * * Returns a normalized value from a distribution characterized by mean and standard_dev. * - * @param float $value Value to normalize - * @param float $mean Mean Value - * @param float $stdDev Standard Deviation + * @param array|float $value Value to normalize + * Or can be an array of values + * @param array|float $mean Mean Value + * Or can be an array of values + * @param array|float $stdDev Standard Deviation + * Or can be an array of values * - * @return float|string Standardized value, or a string containing an error + * @return array|float|string Standardized value, or a string containing an error + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function execute($value, $mean, $stdDev) { - $value = Functions::flattenSingleValue($value); - $mean = Functions::flattenSingleValue($mean); - $stdDev = Functions::flattenSingleValue($stdDev); + if (is_array($value) || is_array($mean) || is_array($stdDev)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $stdDev); + } try { $value = self::validateFloat($value); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php index 93724a8c1..a43926faa 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php @@ -2,12 +2,15 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\Trend\Trend; class Trends { + use ArrayEnabled; + private static function filterTrendValues(array &$array1, array &$array2): void { foreach ($array1 as $key => $value) { @@ -108,14 +111,19 @@ class Trends * The predicted value is a y-value for a given x-value. * * @param mixed $xValue Float value of X for which we want to find Y + * Or can be an array of values * @param mixed $yValues array of mixed Data Series Y * @param mixed $xValues of mixed Data Series X * - * @return bool|float|string + * @return array|bool|float|string + * If an array of numbers is passed as an argument, then the returned result will also be an array + * with the same dimensions */ public static function FORECAST($xValue, $yValues, $xValues) { - $xValue = Functions::flattenSingleValue($xValue); + if (is_array($xValue)) { + return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $xValue, $yValues, $xValues); + } try { $xValue = StatisticalValidations::validateFloat($xValue); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php index 0bde3b7fe..6757a8d87 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php @@ -18,7 +18,7 @@ class TextData * * @param string $character Value * - * @return string + * @return array|string */ public static function CHARACTER($character) { @@ -34,7 +34,7 @@ class TextData * * @param mixed $stringValue Value to check * - * @return string + * @return null|array|string */ public static function TRIMNONPRINTABLE($stringValue = '') { @@ -50,7 +50,7 @@ class TextData * * @param mixed $stringValue Value to check * - * @return string + * @return array|string */ public static function TRIMSPACES($stringValue = '') { @@ -64,9 +64,9 @@ class TextData * * @see Use the code() method in the TextData\CharacterConvert class instead * - * @param string $characters Value + * @param array|string $characters Value * - * @return int|string A string if arguments are invalid + * @return array|int|string A string if arguments are invalid */ public static function ASCIICODE($characters) { @@ -102,7 +102,7 @@ class TextData * If decimals is negative, number is rounded to the left of the decimal point. * If you omit decimals, it is assumed to be 2 * - * @return string + * @return array|string */ public static function DOLLAR($value = 0, $decimals = 2) { @@ -110,17 +110,17 @@ class TextData } /** - * SEARCHSENSITIVE. + * FIND. * * @Deprecated 1.18.0 * * @see Use the sensitive() method in the TextData\Search class instead * - * @param string $needle The string to look for - * @param string $haystack The string in which to look - * @param int $offset Offset within $haystack + * @param array|string $needle The string to look for + * @param array|string $haystack The string in which to look + * @param array|int $offset Offset within $haystack * - * @return string + * @return array|int|string */ public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1) { @@ -128,17 +128,17 @@ class TextData } /** - * SEARCHINSENSITIVE. + * SEARCH. * * @Deprecated 1.18.0 * * @see Use the insensitive() method in the TextData\Search class instead * - * @param string $needle The string to look for - * @param string $haystack The string in which to look - * @param int $offset Offset within $haystack + * @param array|string $needle The string to look for + * @param array|string $haystack The string in which to look + * @param array|int $offset Offset within $haystack * - * @return string + * @return array|int|string */ public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1) { @@ -156,7 +156,7 @@ class TextData * @param int $decimals * @param bool $no_commas * - * @return string + * @return array|string */ public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false) { @@ -170,10 +170,10 @@ class TextData * * @see Use the left() method in the TextData\Extract class instead * - * @param string $value Value - * @param int $chars Number of characters + * @param array|string $value Value + * @param array|int $chars Number of characters * - * @return string + * @return array|string */ public static function LEFT($value = '', $chars = 1) { @@ -187,11 +187,11 @@ class TextData * * @see Use the mid() method in the TextData\Extract class instead * - * @param string $value Value - * @param int $start Start character - * @param int $chars Number of characters + * @param array|string $value Value + * @param array|int $start Start character + * @param array|int $chars Number of characters * - * @return string + * @return array|string */ public static function MID($value = '', $start = 1, $chars = null) { @@ -205,10 +205,10 @@ class TextData * * @see Use the right() method in the TextData\Extract class instead * - * @param string $value Value - * @param int $chars Number of characters + * @param array|string $value Value + * @param array|int $chars Number of characters * - * @return string + * @return array|string */ public static function RIGHT($value = '', $chars = 1) { @@ -224,7 +224,7 @@ class TextData * * @param string $value Value * - * @return int + * @return array|int */ public static function STRINGLENGTH($value = '') { @@ -234,15 +234,15 @@ class TextData /** * LOWERCASE. * - * Converts a string value to upper case. + * Converts a string value to lower case. * * @Deprecated 1.18.0 * * @see Use the lower() method in the TextData\CaseConvert class instead * - * @param string $mixedCaseString + * @param array|string $mixedCaseString * - * @return string + * @return array|string */ public static function LOWERCASE($mixedCaseString) { @@ -260,7 +260,7 @@ class TextData * * @param string $mixedCaseString * - * @return string + * @return array|string */ public static function UPPERCASE($mixedCaseString) { @@ -270,15 +270,15 @@ class TextData /** * PROPERCASE. * - * Converts a string value to upper case. + * Converts a string value to proper/title case. * * @Deprecated 1.18.0 * * @see Use the proper() method in the TextData\CaseConvert class instead * - * @param string $mixedCaseString + * @param array|string $mixedCaseString * - * @return string + * @return array|string */ public static function PROPERCASE($mixedCaseString) { @@ -297,7 +297,7 @@ class TextData * @param int $chars Number of characters * @param string $newText String to replace in defined position * - * @return string + * @return array|string */ public static function REPLACE($oldText, $start, $chars, $newText) { @@ -316,7 +316,7 @@ class TextData * @param string $toText To Value * @param int $instance Instance Number * - * @return string + * @return array|string */ public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0) { @@ -332,7 +332,7 @@ class TextData * * @param mixed $testValue Value to check * - * @return null|string + * @return null|array|string */ public static function RETURNSTRING($testValue = '') { @@ -349,7 +349,7 @@ class TextData * @param mixed $value Value to check * @param string $format Format mask to use * - * @return string + * @return array|string */ public static function TEXTFORMAT($value, $format) { @@ -365,7 +365,7 @@ class TextData * * @param mixed $value Value to check * - * @return DateTimeInterface|float|int|string A string if arguments are invalid + * @return array|DateTimeInterface|float|int|string A string if arguments are invalid */ public static function VALUE($value = '') { @@ -383,7 +383,7 @@ class TextData * @param string $decimalSeparator decimal separator, defaults to locale defined value * @param string $groupSeparator group/thosands separator, defaults to locale defined value * - * @return float|string + * @return array|float|string */ public static function NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null) { @@ -402,7 +402,7 @@ class TextData * @param mixed $value1 * @param mixed $value2 * - * @return bool + * @return array|bool */ public static function EXACT($value1, $value2) { @@ -420,7 +420,7 @@ class TextData * @param mixed $ignoreEmpty * @param mixed $args * - * @return string + * @return array|string */ public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args) { @@ -436,10 +436,10 @@ class TextData * * @see Use the builtinREPT() method in the TextData\Concatenate class instead * - * @param string $str Should be numeric + * @param array|string $str Should be numeric * @param mixed $number Should be int * - * @return string + * @return array|string */ public static function builtinREPT($str, $number) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php index 664cc2d88..f1aea1694 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php @@ -2,21 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; -use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Shared\StringHelper; class CaseConvert { + use ArrayEnabled; + /** * LOWERCASE. * * Converts a string value to upper case. * * @param mixed $mixedCaseValue The string value to convert to lower case + * Or can be an array of values + * + * @return array|string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ - public static function lower($mixedCaseValue): string + public static function lower($mixedCaseValue) { - $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue); + if (is_array($mixedCaseValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue); + } + $mixedCaseValue = Helpers::extractString($mixedCaseValue); return StringHelper::strToLower($mixedCaseValue); @@ -28,10 +38,18 @@ class CaseConvert * Converts a string value to upper case. * * @param mixed $mixedCaseValue The string value to convert to upper case + * Or can be an array of values + * + * @return array|string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ - public static function upper($mixedCaseValue): string + public static function upper($mixedCaseValue) { - $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue); + if (is_array($mixedCaseValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue); + } + $mixedCaseValue = Helpers::extractString($mixedCaseValue); return StringHelper::strToUpper($mixedCaseValue); @@ -43,10 +61,18 @@ class CaseConvert * Converts a string value to proper or title case. * * @param mixed $mixedCaseValue The string value to convert to title case + * Or can be an array of values + * + * @return array|string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ - public static function proper($mixedCaseValue): string + public static function proper($mixedCaseValue) { - $mixedCaseValue = Functions::flattenSingleValue($mixedCaseValue); + if (is_array($mixedCaseValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $mixedCaseValue); + } + $mixedCaseValue = Helpers::extractString($mixedCaseValue); return StringHelper::strToTitle($mixedCaseValue); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php index 0aca57e6c..714d789e5 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php @@ -2,17 +2,29 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class CharacterConvert { + use ArrayEnabled; + /** * CHAR. * * @param mixed $character Integer Value to convert to its character representation + * Or can be an array of values + * + * @return array|string The character string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ - public static function character($character): string + public static function character($character) { + if (is_array($character)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $character); + } + $character = Helpers::validateInt($character); $min = Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE ? 0 : 1; if ($character < $min || $character > 255) { @@ -27,11 +39,18 @@ class CharacterConvert * CODE. * * @param mixed $characters String character to convert to its ASCII value + * Or can be an array of values * - * @return int|string A string if arguments are invalid + * @return array|int|string A string if arguments are invalid + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function code($characters) { + if (is_array($characters)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $characters); + } + $characters = Helpers::extractString($characters); if ($characters === '') { return Functions::VALUE(); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php index d53fc8228..f23996a6a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Concatenate { + use ArrayEnabled; + /** * CONCATENATE. * @@ -28,14 +31,28 @@ class Concatenate /** * TEXTJOIN. * - * @param mixed $delimiter - * @param mixed $ignoreEmpty - * @param mixed $args + * @param mixed $delimiter The delimter to use between the joined arguments + * Or can be an array of values + * @param mixed $ignoreEmpty true/false Flag indicating whether empty arguments should be skipped + * Or can be an array of values + * @param mixed $args The values to join + * + * @return array|string The joined string + * If an array of values is passed for the $delimiter or $ignoreEmpty arguments, then the returned result + * will also be an array with matching dimensions */ - public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args): string + public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args) { - $delimiter = Functions::flattenSingleValue($delimiter); - $ignoreEmpty = Functions::flattenSingleValue($ignoreEmpty); + if (is_array($delimiter) || is_array($ignoreEmpty)) { + return self::evaluateArrayArgumentsSubset( + [self::class, __FUNCTION__], + 2, + $delimiter, + $ignoreEmpty, + ...$args + ); + } + // Loop through arguments $aArgs = Functions::flattenArray($args); foreach ($aArgs as $key => &$arg) { @@ -55,11 +72,20 @@ class Concatenate * Returns the result of builtin function round after validating args. * * @param mixed $stringValue The value to repeat + * Or can be an array of values * @param mixed $repeatCount The number of times the string value should be repeated + * Or can be an array of values + * + * @return array|string The repeated string + * If an array of values is passed for the $stringValue or $repeatCount arguments, then the returned result + * will also be an array with matching dimensions */ - public static function builtinREPT($stringValue, $repeatCount): string + public static function builtinREPT($stringValue, $repeatCount) { - $repeatCount = Functions::flattenSingleValue($repeatCount); + if (is_array($stringValue) || is_array($repeatCount)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $stringValue, $repeatCount); + } + $stringValue = Helpers::extractString($stringValue); if (!is_numeric($repeatCount) || $repeatCount < 0) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php index 7f18e0c6e..d29f80cab 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php @@ -2,18 +2,31 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcExp; class Extract { + use ArrayEnabled; + /** * LEFT. * * @param mixed $value String value from which to extract characters + * Or can be an array of values * @param mixed $chars The number of characters to extract (as an integer) + * Or can be an array of values + * + * @return array|string The joined string + * If an array of values is passed for the $value or $chars arguments, then the returned result + * will also be an array with matching dimensions */ - public static function left($value, $chars = 1): string + public static function left($value, $chars = 1) { + if (is_array($value) || is_array($chars)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars); + } + try { $value = Helpers::extractString($value); $chars = Helpers::extractInt($chars, 0, 1); @@ -28,11 +41,22 @@ class Extract * MID. * * @param mixed $value String value from which to extract characters + * Or can be an array of values * @param mixed $start Integer offset of the first character that we want to extract + * Or can be an array of values * @param mixed $chars The number of characters to extract (as an integer) + * Or can be an array of values + * + * @return array|string The joined string + * If an array of values is passed for the $value, $start or $chars arguments, then the returned result + * will also be an array with matching dimensions */ - public static function mid($value, $start, $chars): string + public static function mid($value, $start, $chars) { + if (is_array($value) || is_array($start) || is_array($chars)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $start, $chars); + } + try { $value = Helpers::extractString($value); $start = Helpers::extractInt($start, 1); @@ -48,10 +72,20 @@ class Extract * RIGHT. * * @param mixed $value String value from which to extract characters + * Or can be an array of values * @param mixed $chars The number of characters to extract (as an integer) + * Or can be an array of values + * + * @return array|string The joined string + * If an array of values is passed for the $value or $chars arguments, then the returned result + * will also be an array with matching dimensions */ - public static function right($value, $chars = 1): string + public static function right($value, $chars = 1) { + if (is_array($value) || is_array($chars)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars); + } + try { $value = Helpers::extractString($value); $chars = Helpers::extractInt($chars, 0, 1); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php index 3286de0cb..b4b634fbf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php @@ -3,6 +3,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; use DateTimeInterface; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcExp; use PhpOffice\PhpSpreadsheet\Calculation\Functions; @@ -13,6 +14,8 @@ use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class Format { + use ArrayEnabled; + /** * DOLLAR. * @@ -20,12 +23,22 @@ class Format * The format used is $#,##0.00_);($#,##0.00).. * * @param mixed $value The value to format + * Or can be an array of values * @param mixed $decimals The number of digits to display to the right of the decimal point (as an integer). * If decimals is negative, number is rounded to the left of the decimal point. * If you omit decimals, it is assumed to be 2 + * Or can be an array of values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function DOLLAR($value = 0, $decimals = 2): string + public static function DOLLAR($value = 0, $decimals = 2) { + if (is_array($value) || is_array($decimals)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimals); + } + try { $value = Helpers::extractFloat($value); $decimals = Helpers::extractInt($decimals, -100, 0, true); @@ -52,15 +65,25 @@ class Format * FIXED. * * @param mixed $value The value to format + * Or can be an array of values * @param mixed $decimals Integer value for the number of decimal places that should be formatted + * Or can be an array of values * @param mixed $noCommas Boolean value indicating whether the value should have thousands separators or not + * Or can be an array of values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function FIXEDFORMAT($value, $decimals = 2, $noCommas = false): string + public static function FIXEDFORMAT($value, $decimals = 2, $noCommas = false) { + if (is_array($value) || is_array($decimals) || is_array($noCommas)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimals, $noCommas); + } + try { $value = Helpers::extractFloat($value); $decimals = Helpers::extractInt($decimals, -100, 0, true); - $noCommas = Functions::flattenSingleValue($noCommas); } catch (CalcExp $e) { return $e->getMessage(); } @@ -85,10 +108,20 @@ class Format * TEXT. * * @param mixed $value The value to format + * Or can be an array of values * @param mixed $format A string with the Format mask that should be used + * Or can be an array of values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function TEXTFORMAT($value, $format): string + public static function TEXTFORMAT($value, $format) { + if (is_array($value) || is_array($format)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format); + } + $value = Helpers::extractString($value); $format = Helpers::extractString($format); @@ -106,7 +139,7 @@ class Format */ private static function convertValue($value) { - $value = ($value === null) ? 0 : Functions::flattenSingleValue($value); + $value = $value ?? 0; if (is_bool($value)) { if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) { $value = (int) $value; @@ -122,11 +155,18 @@ class Format * VALUE. * * @param mixed $value Value to check + * Or can be an array of values * - * @return DateTimeInterface|float|int|string A string if arguments are invalid + * @return array|DateTimeInterface|float|int|string A string if arguments are invalid + * If an array of values is passed for the argument, then the returned result + * will also be an array with matching dimensions */ public static function VALUE($value = '') { + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + try { $value = self::convertValue($value); } catch (CalcExp $e) { @@ -146,14 +186,14 @@ class Format Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); if (strpos($value, ':') !== false) { - $timeValue = DateTimeExcel\TimeValue::fromString($value); + $timeValue = Functions::scalar(DateTimeExcel\TimeValue::fromString($value)); if ($timeValue !== Functions::VALUE()) { Functions::setReturnDateType($dateSetting); return $timeValue; } } - $dateValue = DateTimeExcel\DateValue::fromString($value); + $dateValue = Functions::scalar(DateTimeExcel\DateValue::fromString($value)); if ($dateValue !== Functions::VALUE()) { Functions::setReturnDateType($dateSetting); @@ -172,8 +212,6 @@ class Format */ private static function getDecimalSeparator($decimalSeparator): string { - $decimalSeparator = Functions::flattenSingleValue($decimalSeparator); - return empty($decimalSeparator) ? StringHelper::getDecimalSeparator() : (string) $decimalSeparator; } @@ -182,8 +220,6 @@ class Format */ private static function getGroupSeparator($groupSeparator): string { - $groupSeparator = Functions::flattenSingleValue($groupSeparator); - return empty($groupSeparator) ? StringHelper::getThousandsSeparator() : (string) $groupSeparator; } @@ -191,13 +227,20 @@ class Format * NUMBERVALUE. * * @param mixed $value The value to format + * Or can be an array of values * @param mixed $decimalSeparator A string with the decimal separator to use, defaults to locale defined value + * Or can be an array of values * @param mixed $groupSeparator A string with the group/thousands separator to use, defaults to locale defined value + * Or can be an array of values * - * @return float|string + * @return array|float|string */ public static function NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null) { + if (is_array($value) || is_array($decimalSeparator) || is_array($groupSeparator)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimalSeparator, $groupSeparator); + } + try { $value = self::convertValue($value); $decimalSeparator = self::getDecimalSeparator($decimalSeparator); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php index 423b6d3f9..86c405abf 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php @@ -22,7 +22,6 @@ class Helpers */ public static function extractString($value): string { - $value = Functions::flattenSingleValue($value); if (is_bool($value)) { return self::convertBooleanValue($value); } @@ -35,7 +34,6 @@ class Helpers */ public static function extractInt($value, int $minValue, int $gnumericNull = 0, bool $ooBoolOk = false): int { - $value = Functions::flattenSingleValue($value); if ($value === null) { // usually 0, but sometimes 1 for Gnumeric $value = (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_GNUMERIC) ? $gnumericNull : 0; @@ -59,7 +57,6 @@ class Helpers */ public static function extractFloat($value): float { - $value = Functions::flattenSingleValue($value); if ($value === null) { $value = 0.0; } @@ -78,7 +75,6 @@ class Helpers */ public static function validateInt($value): int { - $value = Functions::flattenSingleValue($value); if ($value === null) { $value = 0; } elseif (is_bool($value)) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Replace.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Replace.php index 36c13590e..c3290a2a6 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Replace.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Replace.php @@ -2,21 +2,36 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcExp; use PhpOffice\PhpSpreadsheet\Calculation\Functions; class Replace { + use ArrayEnabled; + /** * REPLACE. * * @param mixed $oldText The text string value to modify + * Or can be an array of values * @param mixed $start Integer offset for start character of the replacement + * Or can be an array of values * @param mixed $chars Integer number of characters to replace from the start offset + * Or can be an array of values * @param mixed $newText String to replace in the defined position + * Or can be an array of values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function replace($oldText, $start, $chars, $newText): string + public static function replace($oldText, $start, $chars, $newText) { + if (is_array($oldText) || is_array($start) || is_array($chars) || is_array($newText)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $oldText, $start, $chars, $newText); + } + try { $start = Helpers::extractInt($start, 1, 0, true); $chars = Helpers::extractInt($chars, 0, 0, true); @@ -36,17 +51,28 @@ class Replace * SUBSTITUTE. * * @param mixed $text The text string value to modify + * Or can be an array of values * @param mixed $fromText The string value that we want to replace in $text + * Or can be an array of values * @param mixed $toText The string value that we want to replace with in $text + * Or can be an array of values * @param mixed $instance Integer instance Number for the occurrence of frmText to change + * Or can be an array of values + * + * @return array|string + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function substitute($text = '', $fromText = '', $toText = '', $instance = null): string + public static function substitute($text = '', $fromText = '', $toText = '', $instance = null) { + if (is_array($text) || is_array($fromText) || is_array($toText) || is_array($instance)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $text, $fromText, $toText, $instance); + } + try { $text = Helpers::extractString($text); $fromText = Helpers::extractString($fromText); $toText = Helpers::extractString($toText); - $instance = Functions::flattenSingleValue($instance); if ($instance === null) { return str_replace($fromText, $toText, $text); } @@ -61,6 +87,14 @@ class Replace return $e->getMessage(); } + return self::executeSubstitution($text, $fromText, $toText, $instance); + } + + /** + * @return string + */ + private static function executeSubstitution(string $text, string $fromText, string $toText, int $instance) + { $pos = -1; while ($instance > 0) { $pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8'); @@ -71,7 +105,7 @@ class Replace } if ($pos !== false) { - return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText); + return Functions::scalar(self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText)); } return $text; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php index c9eed2e5a..b6a723802 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php @@ -2,23 +2,35 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcExp; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Shared\StringHelper; class Search { + use ArrayEnabled; + /** * FIND (case sensitive search). * * @param mixed $needle The string to look for + * Or can be an array of values * @param mixed $haystack The string in which to look + * Or can be an array of values * @param mixed $offset Integer offset within $haystack to start searching from + * Or can be an array of values * - * @return int|string + * @return array|int|string The offset where the first occurrence of needle was found in the haystack + * If an array of values is passed for the $value or $chars arguments, then the returned result + * will also be an array with matching dimensions */ public static function sensitive($needle, $haystack, $offset = 1) { + if (is_array($needle) || is_array($haystack) || is_array($offset)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $needle, $haystack, $offset); + } + try { $needle = Helpers::extractString($needle); $haystack = Helpers::extractString($haystack); @@ -45,13 +57,22 @@ class Search * SEARCH (case insensitive search). * * @param mixed $needle The string to look for + * Or can be an array of values * @param mixed $haystack The string in which to look + * Or can be an array of values * @param mixed $offset Integer offset within $haystack to start searching from + * Or can be an array of values * - * @return int|string + * @return array|int|string The offset where the first occurrence of needle was found in the haystack + * If an array of values is passed for the $value or $chars arguments, then the returned result + * will also be an array with matching dimensions */ public static function insensitive($needle, $haystack, $offset = 1) { + if (is_array($needle) || is_array($haystack) || is_array($offset)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $needle, $haystack, $offset); + } + try { $needle = Helpers::extractString($needle); $haystack = Helpers::extractString($haystack); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php index 6f8253eab..490c43c20 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php @@ -2,17 +2,28 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; -use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; class Text { + use ArrayEnabled; + /** * LEN. * * @param mixed $value String Value + * Or can be an array of values + * + * @return array|int + * If an array of values is passed for the argument, then the returned result + * will also be an array with matching dimensions */ - public static function length($value = ''): int + public static function length($value = '') { + if (is_array($value)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value); + } + $value = Helpers::extractString($value); return mb_strlen($value ?? '', 'UTF-8'); @@ -24,10 +35,20 @@ class Text * Use EXACT to test text being entered into a document. * * @param mixed $value1 String Value + * Or can be an array of values * @param mixed $value2 String Value + * Or can be an array of values + * + * @return array|bool + * If an array of values is passed for either of the arguments, then the returned result + * will also be an array with matching dimensions */ - public static function exact($value1, $value2): bool + public static function exact($value1, $value2) { + if (is_array($value1) || is_array($value2)) { + return self::evaluateArrayArguments([self::class, __FUNCTION__], $value1, $value2); + } + $value1 = Helpers::extractString($value1); $value2 = Helpers::extractString($value2); @@ -38,12 +59,17 @@ class Text * RETURNSTRING. * * @param mixed $testValue Value to check + * Or can be an array of values * - * @return null|string + * @return null|array|string + * If an array of values is passed for the argument, then the returned result + * will also be an array with matching dimensions */ public static function test($testValue = '') { - $testValue = Functions::flattenSingleValue($testValue); + if (is_array($testValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $testValue); + } if (is_string($testValue)) { return $testValue; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php index 22f4554b3..e52c00954 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php @@ -2,17 +2,28 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\TextData; +use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; + class Trim { + use ArrayEnabled; + /** * CLEAN. * * @param mixed $stringValue String Value to check + * Or can be an array of values * - * @return null|string + * @return null|array|string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function nonPrintable($stringValue = '') { + if (is_array($stringValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $stringValue); + } + $stringValue = Helpers::extractString($stringValue); return preg_replace('/[\\x00-\\x1f]/', '', "$stringValue"); @@ -22,11 +33,18 @@ class Trim * TRIM. * * @param mixed $stringValue String Value to check + * Or can be an array of values * - * @return string + * @return array|string + * If an array of values is passed as the argument, then the returned result will also be an array + * with the same dimensions */ public static function spaces($stringValue = '') { + if (is_array($stringValue)) { + return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $stringValue); + } + $stringValue = Helpers::extractString($stringValue); return trim(preg_replace('/ +/', ' ', trim("$stringValue", ' ')) ?? '', ' '); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx index 518176ab9..6f758b9c5 100644 Binary files a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx and b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx differ diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions index 7f9ce7832..9f05d5afa 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions @@ -177,6 +177,7 @@ SYD = АСЧ TBILLEQ = РАВНОКЧЕК TBILLPRICE = ЦЕНАКЧЕК TBILLYIELD = ДОХОДКЧЕК +USDOLLAR = ДОЛЛСША VDB = ПУО XIRR = ЧИСТВНДОХ XNPV = ЧИСТНЗ @@ -231,6 +232,7 @@ AREAS = ОБЛАСТИ CHOOSE = ВЫБОР COLUMN = СТОЛБЕЦ COLUMNS = ЧИСЛСТОЛБ +FILTER = ФИЛЬТР FORMULATEXT = Ф.ТЕКСТ GETPIVOTDATA = ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ HLOOKUP = ГПР @@ -243,8 +245,13 @@ OFFSET = СМЕЩ ROW = СТРОКА ROWS = ЧСТРОК RTD = ДРВ +SORT = СОРТ +SORTBY = СОРТПО TRANSPOSE = ТРАНСП +UNIQUE = УНИК VLOOKUP = ВПР +XLOOKUP = ПРОСМОТРX +XMATCH = ПОИСКПОЗX ## ## Математические и тригонометрические функции (Math & Trig Functions) @@ -302,6 +309,7 @@ PRODUCT = ПРОИЗВЕД QUOTIENT = ЧАСТНОЕ RADIANS = РАДИАНЫ RAND = СЛЧИС +RANDARRAY = СЛУЧМАССИВ RANDBETWEEN = СЛУЧМЕЖДУ ROMAN = РИМСКОЕ ROUND = ОКРУГЛ @@ -312,6 +320,7 @@ ROUNDUP = ОКРУГЛВВЕРХ SEC = SEC SECH = SECH SERIESSUM = РЯД.СУММ +SEQUENCE = ПОСЛЕДОВ SIGN = ЗНАК SIN = SIN SINH = SINH @@ -447,27 +456,36 @@ Z.TEST = Z.ТЕСТ ## ## Текстовые функции (Text Functions) ## +ARRAYTOTEXT = МАССИВВТЕКСТ BAHTTEXT = БАТТЕКСТ CHAR = СИМВОЛ CLEAN = ПЕЧСИМВ CODE = КОДСИМВ CONCAT = СЦЕП +DBCS = БДЦС DOLLAR = РУБЛЬ EXACT = СОВПАД FIND = НАЙТИ +FINDB = НАЙТИБ FIXED = ФИКСИРОВАННЫЙ -ISTHAIDIGIT = TAYRAKAMIYSA +ISTHAIDIGIT = ЕТАЙЦИФРЫ LEFT = ЛЕВСИМВ +LEFTB = ЛЕВБ LEN = ДЛСТР +LENB = ДЛИНБ LOWER = СТРОЧН MID = ПСТР +MIDB = ПСТРБ NUMBERSTRING = СТРОКАЧИСЕЛ NUMBERVALUE = ЧЗНАЧ PROPER = ПРОПНАЧ REPLACE = ЗАМЕНИТЬ +REPLACEB = ЗАМЕНИТЬБ REPT = ПОВТОР RIGHT = ПРАВСИМВ +RIGHTB = ПРАВБ SEARCH = ПОИСК +SEARCHB = ПОИСКБ SUBSTITUTE = ПОДСТАВИТЬ T = Т TEXT = ТЕКСТ @@ -481,6 +499,7 @@ UNICHAR = ЮНИСИМВ UNICODE = UNICODE UPPER = ПРОПИСН VALUE = ЗНАЧЕН +VALUETOTEXT = ЗНАЧЕНИЕВТЕКСТ ## ## Веб-функции (Web Functions) diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php index 5a9def375..fe4a1f41a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php @@ -2,10 +2,13 @@ namespace PhpOffice\PhpSpreadsheet\Cell; +use DateTime; use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Collection\Cells; use PhpOffice\PhpSpreadsheet\Exception; use PhpOffice\PhpSpreadsheet\RichText\RichText; +use PhpOffice\PhpSpreadsheet\Shared\Date as SharedDate; +use PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting\CellStyleAssessor; use PhpOffice\PhpSpreadsheet\Style\NumberFormat; use PhpOffice\PhpSpreadsheet\Style\Style; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; @@ -234,6 +237,22 @@ class Cell case DataType::TYPE_BOOL: $this->value = (bool) $value; + break; + case DataType::TYPE_ISO_DATE: + if (!is_string($value)) { + throw new Exception('Non-string supplied for datatype Date'); + } + $date = new DateTime($value); + $newValue = SharedDate::PHPToExcel($date); + if ($newValue === false) { + throw new Exception("Invalid string $value supplied for datatype Date"); + } + if (preg_match('/^\\d\\d:\\d\\d:\\d\\d/', $value) == 1) { + $newValue = fmod($newValue, 1.0); + } + $this->value = $newValue; + $dataType = DataType::TYPE_NUMERIC; + break; case DataType::TYPE_ERROR: $this->value = DataType::checkErrorCode($value); @@ -541,14 +560,30 @@ class Cell /** * Get cell style. - * - * @return Style */ - public function getStyle() + public function getStyle(): Style { return $this->getWorksheet()->getStyle($this->getCoordinate()); } + /** + * Get cell style. + */ + public function getAppliedStyle(): Style + { + if ($this->getWorksheet()->conditionalStylesExists($this->getCoordinate()) === false) { + return $this->getStyle(); + } + $range = $this->getWorksheet()->getConditionalRange($this->getCoordinate()); + if ($range === null) { + return $this->getStyle(); + } + + $matcher = new CellStyleAssessor($this, $range); + + return $matcher->matchConditions($this->getWorksheet()->getConditionalStyles($this->getCoordinate())); + } + /** * Re-bind parent. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php index cee3e1e5e..0f7efe2a4 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php @@ -16,6 +16,7 @@ class DataType const TYPE_NULL = 'null'; const TYPE_INLINE = 'inlineStr'; const TYPE_ERROR = 'e'; + const TYPE_ISO_DATE = 'd'; /** * List of error codes. diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php index 5f96dcfcd..1644e40ec 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php @@ -7912,4 +7912,17 @@ class Xls extends BaseReader return $value; } + + /** + * Phpstan 1.4.4 complains that this property is never read. + * So, we might be able to get rid of it altogether. + * For now, however, this function makes it readable, + * which satisfies Phpstan. + * + * @codeCoverageIgnore + */ + public function getMapCellStyleXfIndex(): array + { + return $this->mapCellStyleXfIndex; + } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php index 6b2c2fd6e..f7625d5e1 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php @@ -149,6 +149,7 @@ class Xlsx extends BaseReader private const REL_TO_MAIN = [ Namespaces::PURL_OFFICE_DOCUMENT => Namespaces::PURL_MAIN, + Namespaces::THUMBNAIL => '', ]; private const REL_TO_DRAWING = [ @@ -538,16 +539,14 @@ class Xlsx extends BaseReader if ($xpath === null) { $xmlStyles = self::testSimpleXml(null); } else { - // I think Nonamespace is okay because I'm using xpath. - $xmlStyles = $this->loadZipNonamespace("$dir/$xpath[Target]", $mainNS); + $xmlStyles = $this->loadZip("$dir/$xpath[Target]", $mainNS); } - $xmlStyles->registerXPathNamespace('smm', Namespaces::MAIN); - $fills = self::xpathNoFalse($xmlStyles, 'smm:fills/smm:fill'); - $fonts = self::xpathNoFalse($xmlStyles, 'smm:fonts/smm:font'); - $borders = self::xpathNoFalse($xmlStyles, 'smm:borders/smm:border'); - $xfTags = self::xpathNoFalse($xmlStyles, 'smm:cellXfs/smm:xf'); - $cellXfTags = self::xpathNoFalse($xmlStyles, 'smm:cellStyleXfs/smm:xf'); + $fills = self::extractStyles($xmlStyles, 'fills', 'fill'); + $fonts = self::extractStyles($xmlStyles, 'fonts', 'font'); + $borders = self::extractStyles($xmlStyles, 'borders', 'border'); + $xfTags = self::extractStyles($xmlStyles, 'cellXfs', 'xf'); + $cellXfTags = self::extractStyles($xmlStyles, 'cellStyleXfs', 'xf'); $styles = []; $cellStyles = []; @@ -558,6 +557,7 @@ class Xlsx extends BaseReader if (isset($numFmts) && ($numFmts !== null)) { $numFmts->registerXPathNamespace('sml', $mainNS); } + $this->styleReader->setNamespace($mainNS); if (!$this->readDataOnly/* && $xmlStyles*/) { foreach ($xfTags as $xfTag) { $xf = self::getAttributes($xfTag); @@ -642,6 +642,7 @@ class Xlsx extends BaseReader } } $this->styleReader->setStyleXml($xmlStyles); + $this->styleReader->setNamespace($mainNS); $this->styleReader->setStyleBaseData($theme, $styles, $cellStyles); $dxfs = $this->styleReader->dxfs($this->readDataOnly); $styles = $this->styleReader->styles(); @@ -708,9 +709,12 @@ class Xlsx extends BaseReader $xmlSheetMain = $xmlSheetNS->children($mainNS); // Setting Conditional Styles adjusts selected cells, so we need to execute this // before reading the sheet view data to get the actual selected cells - if (!$this->readDataOnly && $xmlSheet->conditionalFormatting) { + if (!$this->readDataOnly && ($xmlSheet->conditionalFormatting)) { (new ConditionalStyles($docSheet, $xmlSheet, $dxfs))->load(); } + if (!$this->readDataOnly && $xmlSheet->extLst) { + (new ConditionalStyles($docSheet, $xmlSheet, $dxfs))->loadFromExt($this->styleReader); + } if (isset($xmlSheetMain->sheetViews, $xmlSheetMain->sheetViews->sheetView)) { $sheetViews = new SheetViews($xmlSheetMain->sheetViews->sheetView, $docSheet); $sheetViews->load(); @@ -767,7 +771,12 @@ class Xlsx extends BaseReader break; case 'b': if (!isset($c->f)) { - $value = self::castToBoolean($c); + if (isset($c->v)) { + $value = self::castToBoolean($c); + } else { + $value = null; + $cellDataType = DATATYPE::TYPE_NULL; + } } else { // Formula $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean'); @@ -821,10 +830,12 @@ class Xlsx extends BaseReader // Assign value if ($cellDataType != '') { // it is possible, that datatype is numeric but with an empty string, which result in an error - if ($cellDataType === DataType::TYPE_NUMERIC && $value === '') { - $cellDataType = DataType::TYPE_STRING; + if ($cellDataType === DataType::TYPE_NUMERIC && ($value === '' || $value === null)) { + $cellDataType = DataType::TYPE_NULL; + } + if ($cellDataType !== DataType::TYPE_NULL) { + $cell->setValueExplicit($value, $cellDataType); } - $cell->setValueExplicit($value, $cellDataType); } else { $cell->setValue($value); } @@ -1250,8 +1261,8 @@ class Xlsx extends BaseReader $objDrawing->setOffsetX((int) Drawing::EMUToPixels($oneCellAnchor->from->colOff)); $objDrawing->setOffsetY(Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); $objDrawing->setResizeProportional(false); - $objDrawing->setWidth(Drawing::EMUToPixels(self::getArrayItem((int) self::getAttributes($oneCellAnchor->ext), 'cx'))); - $objDrawing->setHeight(Drawing::EMUToPixels(self::getArrayItem((int) self::getAttributes($oneCellAnchor->ext), 'cy'))); + $objDrawing->setWidth(Drawing::EMUToPixels(self::getArrayItem(self::getAttributes($oneCellAnchor->ext), 'cx'))); + $objDrawing->setHeight(Drawing::EMUToPixels(self::getArrayItem(self::getAttributes($oneCellAnchor->ext), 'cy'))); if ($xfrm) { $objDrawing->setRotation((int) Drawing::angleToDegrees(self::getArrayItem(self::getAttributes($xfrm), 'rot'))); } @@ -1680,13 +1691,17 @@ class Xlsx extends BaseReader } else { $objText = $value->createTextRun(StringHelper::controlCharacterOOXML2PHP((string) $run->t)); - $attr = $run->rPr->rFont->attributes(); - if (isset($attr['val'])) { - $objText->getFont()->setName((string) $attr['val']); + if (isset($run->rPr->rFont)) { + $attr = $run->rPr->rFont->attributes(); + if (isset($attr['val'])) { + $objText->getFont()->setName((string) $attr['val']); + } } - $attr = $run->rPr->sz->attributes(); - if (isset($attr['val'])) { - $objText->getFont()->setSize((float) $attr['val']); + if (isset($run->rPr->sz)) { + $attr = $run->rPr->sz->attributes(); + if (isset($attr['val'])) { + $objText->getFont()->setSize((float) $attr['val']); + } } if (isset($run->rPr->color)) { $objText->getFont()->setColor(new Color($this->styleReader->readColor($run->rPr->color))); @@ -2077,4 +2092,16 @@ class Xlsx extends BaseReader } } } + + private static function extractStyles(?SimpleXMLElement $sxml, string $node1, string $node2): array + { + $array = []; + if ($sxml && $sxml->{$node1}->{$node2}) { + foreach ($sxml->{$node1}->{$node2} as $node) { + $array[] = $node; + } + } + + return $array; + } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php index b88f90567..fdc56ce12 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php @@ -22,7 +22,7 @@ class AutoFilter public function load(): void { // Remove all "$" in the auto filter range - $autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref']); + $autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref'] ?? ''); if (strpos($autoFilterRange, ':') !== false) { $this->readAutoFilter($autoFilterRange, $this->worksheetXml); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php index dcd7ad12c..ce1e1e63e 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php @@ -2,10 +2,12 @@ namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx; +use PhpOffice\PhpSpreadsheet\Reader\Xlsx\Styles as StyleReader; use PhpOffice\PhpSpreadsheet\Style\Conditional; use PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting\ConditionalDataBar; use PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting\ConditionalFormattingRuleExtension; use PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting\ConditionalFormatValueObject; +use PhpOffice\PhpSpreadsheet\Style\Style as Style; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use SimpleXMLElement; @@ -15,6 +17,11 @@ class ConditionalStyles private $worksheetXml; + /** + * @var array + */ + private $ns; + private $dxfs; public function __construct(Worksheet $workSheet, SimpleXMLElement $worksheetXml, array $dxfs = []) @@ -33,7 +40,113 @@ class ConditionalStyles ); } - private function readConditionalStyles($xmlSheet) + public function loadFromExt(StyleReader $styleReader): void + { + $this->ns = $this->worksheetXml->getNamespaces(true); + $this->setConditionalsFromExt( + $this->readConditionalsFromExt($this->worksheetXml->extLst, $styleReader) + ); + } + + private function setConditionalsFromExt(array $conditionals): void + { + foreach ($conditionals as $conditionalRange => $cfRules) { + ksort($cfRules); + // Priority is used as the key for sorting; but may not start at 0, + // so we use array_values to reset the index after sorting. + $this->worksheet->getStyle($conditionalRange) + ->setConditionalStyles(array_values($cfRules)); + } + } + + private function readConditionalsFromExt(SimpleXMLElement $extLst, StyleReader $styleReader): array + { + $conditionals = []; + + if (isset($extLst->ext['uri']) && (string) $extLst->ext['uri'] === '{78C0D931-6437-407d-A8EE-F0AAD7539E65}') { + $conditionalFormattingRuleXml = $extLst->ext->children($this->ns['x14']); + if (!$conditionalFormattingRuleXml->conditionalFormattings) { + return []; + } + + foreach ($conditionalFormattingRuleXml->children($this->ns['x14']) as $extFormattingXml) { + $extFormattingRangeXml = $extFormattingXml->children($this->ns['xm']); + if (!$extFormattingRangeXml->sqref) { + continue; + } + + $sqref = (string) $extFormattingRangeXml->sqref; + $extCfRuleXml = $extFormattingXml->cfRule; + + $attributes = $extCfRuleXml->attributes(); + if (!$attributes) { + continue; + } + $conditionType = (string) $attributes->type; + if ( + !Conditional::isValidConditionType($conditionType) || + $conditionType === Conditional::CONDITION_DATABAR + ) { + continue; + } + + $priority = (int) $attributes->priority; + + $conditional = $this->readConditionalRuleFromExt($extCfRuleXml, $attributes); + $cfStyle = $this->readStyleFromExt($extCfRuleXml, $styleReader); + $conditional->setStyle($cfStyle); + $conditionals[$sqref][$priority] = $conditional; + } + } + + return $conditionals; + } + + private function readConditionalRuleFromExt(SimpleXMLElement $cfRuleXml, SimpleXMLElement $attributes): Conditional + { + $conditionType = (string) $attributes->type; + $operatorType = (string) $attributes->operator; + + $operands = []; + foreach ($cfRuleXml->children($this->ns['xm']) as $cfRuleOperandsXml) { + $operands[] = (string) $cfRuleOperandsXml; + } + + $conditional = new Conditional(); + $conditional->setConditionType($conditionType); + $conditional->setOperatorType($operatorType); + if ( + $conditionType === Conditional::CONDITION_CONTAINSTEXT || + $conditionType === Conditional::CONDITION_NOTCONTAINSTEXT || + $conditionType === Conditional::CONDITION_BEGINSWITH || + $conditionType === Conditional::CONDITION_ENDSWITH || + $conditionType === Conditional::CONDITION_TIMEPERIOD + ) { + $conditional->setText(array_pop($operands) ?? ''); + } + $conditional->setConditions($operands); + + return $conditional; + } + + private function readStyleFromExt(SimpleXMLElement $extCfRuleXml, StyleReader $styleReader): Style + { + $cfStyle = new Style(false, true); + if ($extCfRuleXml->dxf) { + $styleXML = $extCfRuleXml->dxf->children(); + + if ($styleXML->borders) { + $styleReader->readBorderStyle($cfStyle->getBorders(), $styleXML->borders); + } + if ($styleXML->fill) { + $styleReader->readFillStyle($cfStyle->getFill(), $styleXML->fill); + } + } + + return $cfStyle; + } + + private function readConditionalStyles($xmlSheet): array { $conditionals = []; foreach ($xmlSheet->conditionalFormatting as $conditional) { @@ -51,12 +164,12 @@ class ConditionalStyles private function setConditionalStyles(Worksheet $worksheet, array $conditionals, $xmlExtLst): void { - foreach ($conditionals as $ref => $cfRules) { + foreach ($conditionals as $cellRangeReference => $cfRules) { ksort($cfRules); $conditionalStyles = $this->readStyleRules($cfRules, $xmlExtLst); - // Extract all cell references in $ref - $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref))); + // Extract all cell references in $cellRangeReference + $cellBlocks = explode(' ', str_replace('$', '', strtoupper($cellRangeReference))); foreach ($cellBlocks as $cellBlock) { $worksheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles); } @@ -67,6 +180,7 @@ class ConditionalStyles { $conditionalFormattingRuleExtensions = ConditionalFormattingRuleExtension::parseExtLstXml($extLst); $conditionalStyles = []; + foreach ($cfRules as $cfRule) { $objConditional = new Conditional(); $objConditional->setConditionType((string) $cfRule['type']); @@ -74,6 +188,8 @@ class ConditionalStyles if ((string) $cfRule['text'] != '') { $objConditional->setText((string) $cfRule['text']); + } elseif ((string) $cfRule['timePeriod'] != '') { + $objConditional->setText((string) $cfRule['timePeriod']); } if (isset($cfRule['stopIfTrue']) && (int) $cfRule['stopIfTrue'] === 1) { diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Namespaces.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Namespaces.php index 54f56d724..c0713ae4a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Namespaces.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Namespaces.php @@ -14,6 +14,8 @@ class Namespaces // This one used in Reader\Xlsx\Properties const CORE_PROPERTIES2 = 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'; + const THUMBNAIL = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail'; + const THEME = 'http://schemas.openxmlformats.org/package/2006/relationships/theme'; const COMPATIBILITY = 'http://schemas.openxmlformats.org/markup-compatibility/2006'; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php index 6f01c7457..65dac529f 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php @@ -33,6 +33,37 @@ class Styles extends BaseParserClass /** @var SimpleXMLElement */ private $styleXml; + /** @var string */ + private $namespace = ''; + + public function setNamespace(string $namespace): void + { + $this->namespace = $namespace; + } + + /** + * Cast SimpleXMLElement to bool to overcome Scrutinizer problem. + * + * @param mixed $value + */ + private static function castBool($value): bool + { + return (bool) $value; + } + + private function getStyleAttributes(SimpleXMLElement $value): SimpleXMLElement + { + $attr = null; + if (self::castBool($value)) { + $attr = $value->attributes(''); + if ($attr === null || count($attr) === 0) { + $attr = $value->attributes($this->namespace); + } + } + + return Xlsx::testSimpleXml($attr); + } + public function setStyleXml(SimpleXmlElement $styleXml): void { $this->styleXml = $styleXml; @@ -52,48 +83,62 @@ class Styles extends BaseParserClass public function readFontStyle(Font $fontStyle, SimpleXMLElement $fontStyleXml): void { - if (isset($fontStyleXml->name, $fontStyleXml->name['val'])) { - $fontStyle->setName((string) $fontStyleXml->name['val']); + if (isset($fontStyleXml->name)) { + $attr = $this->getStyleAttributes($fontStyleXml->name); + if (isset($attr['val'])) { + $fontStyle->setName((string) $attr['val']); + } } - if (isset($fontStyleXml->sz, $fontStyleXml->sz['val'])) { - $fontStyle->setSize((float) $fontStyleXml->sz['val']); + if (isset($fontStyleXml->sz)) { + $attr = $this->getStyleAttributes($fontStyleXml->sz); + if (isset($attr['val'])) { + $fontStyle->setSize((float) $attr['val']); + } } if (isset($fontStyleXml->b)) { - $fontStyle->setBold(!isset($fontStyleXml->b['val']) || self::boolean((string) $fontStyleXml->b['val'])); + $attr = $this->getStyleAttributes($fontStyleXml->b); + $fontStyle->setBold(!isset($attr['val']) || self::boolean((string) $attr['val'])); } if (isset($fontStyleXml->i)) { - $fontStyle->setItalic(!isset($fontStyleXml->i['val']) || self::boolean((string) $fontStyleXml->i['val'])); + $attr = $this->getStyleAttributes($fontStyleXml->i); + $fontStyle->setItalic(!isset($attr['val']) || self::boolean((string) $attr['val'])); } if (isset($fontStyleXml->strike)) { - $fontStyle->setStrikethrough( - !isset($fontStyleXml->strike['val']) || self::boolean((string) $fontStyleXml->strike['val']) - ); + $attr = $this->getStyleAttributes($fontStyleXml->strike); + $fontStyle->setStrikethrough(!isset($attr['val']) || self::boolean((string) $attr['val'])); } $fontStyle->getColor()->setARGB($this->readColor($fontStyleXml->color)); - if (isset($fontStyleXml->u) && !isset($fontStyleXml->u['val'])) { - $fontStyle->setUnderline(Font::UNDERLINE_SINGLE); - } elseif (isset($fontStyleXml->u, $fontStyleXml->u['val'])) { - $fontStyle->setUnderline((string) $fontStyleXml->u['val']); + if (isset($fontStyleXml->u)) { + $attr = $this->getStyleAttributes($fontStyleXml->u); + if (!isset($attr['val'])) { + $fontStyle->setUnderline(Font::UNDERLINE_SINGLE); + } else { + $fontStyle->setUnderline((string) $attr['val']); + } } - - if (isset($fontStyleXml->vertAlign, $fontStyleXml->vertAlign['val'])) { - $verticalAlign = strtolower((string) $fontStyleXml->vertAlign['val']); - if ($verticalAlign === 'superscript') { - $fontStyle->setSuperscript(true); - } elseif ($verticalAlign === 'subscript') { - $fontStyle->setSubscript(true); + if (isset($fontStyleXml->vertAlign)) { + $attr = $this->getStyleAttributes($fontStyleXml->vertAlign); + if (!isset($attr['val'])) { + $verticalAlign = strtolower((string) $attr['val']); + if ($verticalAlign === 'superscript') { + $fontStyle->setSuperscript(true); + } elseif ($verticalAlign === 'subscript') { + $fontStyle->setSubscript(true); + } } } } private function readNumberFormat(NumberFormat $numfmtStyle, SimpleXMLElement $numfmtStyleXml): void { - if ($numfmtStyleXml->count() === 0) { + if ((string) $numfmtStyleXml['formatCode'] !== '') { + $numfmtStyle->setFormatCode(self::formatGeneral((string) $numfmtStyleXml['formatCode'])); + return; } - $numfmt = Xlsx::getAttributes($numfmtStyleXml); - if ($numfmt->count() > 0 && isset($numfmt['formatCode'])) { + $numfmt = $this->getStyleAttributes($numfmtStyleXml); + if (isset($numfmt['formatCode'])) { $numfmtStyle->setFormatCode(self::formatGeneral((string) $numfmt['formatCode'])); } } @@ -103,10 +148,11 @@ class Styles extends BaseParserClass if ($fillStyleXml->gradientFill) { /** @var SimpleXMLElement $gradientFill */ $gradientFill = $fillStyleXml->gradientFill[0]; - if (!empty($gradientFill['type'])) { - $fillStyle->setFillType((string) $gradientFill['type']); + $attr = $this->getStyleAttributes($gradientFill); + if (!empty($attr['type'])) { + $fillStyle->setFillType((string) $attr['type']); } - $fillStyle->setRotation((float) ($gradientFill['degree'])); + $fillStyle->setRotation((float) ($attr['degree'])); $gradientFill->registerXPathNamespace('sml', Namespaces::MAIN); $fillStyle->getStartColor()->setARGB($this->readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=0]'))->color)); $fillStyle->getEndColor()->setARGB($this->readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=1]'))->color)); @@ -121,9 +167,14 @@ class Styles extends BaseParserClass $defaultFillStyle = Fill::FILL_SOLID; } - $patternType = (string) $fillStyleXml->patternFill['patternType'] != '' - ? (string) $fillStyleXml->patternFill['patternType'] - : $defaultFillStyle; + $type = ''; + if ((string) $fillStyleXml->patternFill['patternType'] !== '') { + $type = (string) $fillStyleXml->patternFill['patternType']; + } else { + $attr = $this->getStyleAttributes($fillStyleXml->patternFill); + $type = (string) $attr['patternType']; + } + $patternType = ($type === '') ? $defaultFillStyle : $type; $fillStyle->setFillType($patternType); } @@ -131,8 +182,10 @@ class Styles extends BaseParserClass public function readBorderStyle(Borders $borderStyle, SimpleXMLElement $borderStyleXml): void { - $diagonalUp = self::boolean((string) $borderStyleXml['diagonalUp']); - $diagonalDown = self::boolean((string) $borderStyleXml['diagonalDown']); + $diagonalUp = $this->getAttribute($borderStyleXml, 'diagonalUp'); + $diagonalUp = self::boolean($diagonalUp); + $diagonalDown = $this->getAttribute($borderStyleXml, 'diagonalDown'); + $diagonalDown = self::boolean($diagonalDown); if (!$diagonalUp && !$diagonalDown) { $borderStyle->setDiagonalDirection(Borders::DIAGONAL_NONE); } elseif ($diagonalUp && !$diagonalDown) { @@ -150,10 +203,26 @@ class Styles extends BaseParserClass $this->readBorder($borderStyle->getDiagonal(), $borderStyleXml->diagonal); } + private function getAttribute(SimpleXMLElement $xml, string $attribute): string + { + $style = ''; + if ((string) $xml[$attribute] !== '') { + $style = (string) $xml[$attribute]; + } else { + $attr = $this->getStyleAttributes($xml); + if (isset($attr[$attribute])) { + $style = (string) $attr[$attribute]; + } + } + + return $style; + } + private function readBorder(Border $border, SimpleXMLElement $borderXml): void { - if (isset($borderXml['style'])) { - $border->setBorderStyle((string) $borderXml['style']); + $style = $this->getAttribute($borderXml, 'style'); + if ($style !== '') { + $border->setBorderStyle((string) $style); } if (isset($borderXml->color)) { $border->getColor()->setARGB($this->readColor($borderXml->color)); @@ -162,25 +231,25 @@ class Styles extends BaseParserClass public function readAlignmentStyle(Alignment $alignment, SimpleXMLElement $alignmentXml): void { - $alignment->setHorizontal((string) $alignmentXml['horizontal']); - $alignment->setVertical((string) $alignmentXml['vertical']); + $horizontal = $this->getAttribute($alignmentXml, 'horizontal'); + $alignment->setHorizontal($horizontal); + $vertical = $this->getAttribute($alignmentXml, 'vertical'); + $alignment->setVertical((string) $vertical); - $textRotation = 0; - if ((int) $alignmentXml['textRotation'] <= 90) { - $textRotation = (int) $alignmentXml['textRotation']; - } elseif ((int) $alignmentXml['textRotation'] > 90) { - $textRotation = 90 - (int) $alignmentXml['textRotation']; + $textRotation = (int) $this->getAttribute($alignmentXml, 'textRotation'); + if ($textRotation > 90) { + $textRotation = 90 - $textRotation; } + $alignment->setTextRotation($textRotation); - $alignment->setTextRotation((int) $textRotation); - $alignment->setWrapText(self::boolean((string) $alignmentXml['wrapText'])); - $alignment->setShrinkToFit(self::boolean((string) $alignmentXml['shrinkToFit'])); - $alignment->setIndent( - (int) ((string) $alignmentXml['indent']) > 0 ? (int) ((string) $alignmentXml['indent']) : 0 - ); - $alignment->setReadOrder( - (int) ((string) $alignmentXml['readingOrder']) > 0 ? (int) ((string) $alignmentXml['readingOrder']) : 0 - ); + $wrapText = $this->getAttribute($alignmentXml, 'wrapText'); + $alignment->setWrapText(self::boolean((string) $wrapText)); + $shrinkToFit = $this->getAttribute($alignmentXml, 'shrinkToFit'); + $alignment->setShrinkToFit(self::boolean((string) $shrinkToFit)); + $indent = (int) $this->getAttribute($alignmentXml, 'indent'); + $alignment->setIndent(max($indent, 0)); + $readingOrder = (int) $this->getAttribute($alignmentXml, 'readingOrder'); + $alignment->setReadOrder(max($readingOrder, 0)); } private static function formatGeneral(string $formatString): string @@ -223,8 +292,8 @@ class Styles extends BaseParserClass // protection if (isset($style->protection)) { - $this->readProtectionLocked($docStyle, $style); - $this->readProtectionHidden($docStyle, $style); + $this->readProtectionLocked($docStyle, $style->protection); + $this->readProtectionHidden($docStyle, $style->protection); } // top-level style settings @@ -235,13 +304,20 @@ class Styles extends BaseParserClass /** * Read protection locked attribute. - * - * @param SimpleXMLElement|stdClass $style */ - public function readProtectionLocked(Style $docStyle, $style): void + public function readProtectionLocked(Style $docStyle, SimpleXMLElement $style): void { - if (isset($style->protection['locked'])) { - if (self::boolean((string) $style->protection['locked'])) { + $locked = ''; + if ((string) $style['locked'] !== '') { + $locked = (string) $style['locked']; + } else { + $attr = $this->getStyleAttributes($style); + if (isset($attr['locked'])) { + $locked = (string) $attr['locked']; + } + } + if ($locked !== '') { + if (self::boolean($locked)) { $docStyle->getProtection()->setLocked(Protection::PROTECTION_PROTECTED); } else { $docStyle->getProtection()->setLocked(Protection::PROTECTION_UNPROTECTED); @@ -251,13 +327,20 @@ class Styles extends BaseParserClass /** * Read protection hidden attribute. - * - * @param SimpleXMLElement|stdClass $style */ - public function readProtectionHidden(Style $docStyle, $style): void + public function readProtectionHidden(Style $docStyle, SimpleXMLElement $style): void { - if (isset($style->protection['hidden'])) { - if (self::boolean((string) $style->protection['hidden'])) { + $hidden = ''; + if ((string) $style['hidden'] !== '') { + $hidden = (string) $style['hidden']; + } else { + $attr = $this->getStyleAttributes($style); + if (isset($attr['hidden'])) { + $hidden = (string) $attr['hidden']; + } + } + if ($hidden !== '') { + if (self::boolean((string) $hidden)) { $docStyle->getProtection()->setHidden(Protection::PROTECTION_PROTECTED); } else { $docStyle->getProtection()->setHidden(Protection::PROTECTION_UNPROTECTED); @@ -267,15 +350,18 @@ class Styles extends BaseParserClass public function readColor(SimpleXMLElement $color, bool $background = false): string { - if (isset($color['rgb'])) { - return (string) $color['rgb']; - } elseif (isset($color['indexed'])) { - return Color::indexedColor((int) ($color['indexed'] - 7), $background)->getARGB() ?? ''; - } elseif (isset($color['theme'])) { + $attr = $this->getStyleAttributes($color); + if (isset($attr['rgb'])) { + return (string) $attr['rgb']; + } + if (isset($attr['indexed'])) { + return Color::indexedColor((int) ($attr['indexed'] - 7), $background)->getARGB() ?? ''; + } + if (isset($attr['theme'])) { if ($this->theme !== null) { - $returnColour = $this->theme->getColourByIndex((int) $color['theme']); - if (isset($color['tint'])) { - $tintAdjust = (float) $color['tint']; + $returnColour = $this->theme->getColourByIndex((int) $attr['theme']); + if (isset($attr['tint'])) { + $tintAdjust = (float) $attr['tint']; $returnColour = Color::changeBrightness($returnColour ?? '', $tintAdjust); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php index 0d72b3055..98c4807a2 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php @@ -398,6 +398,26 @@ class ReferenceHelper } } + // Find missing coordinates. This is important when inserting column before the last column + $missingCoordinates = array_filter( + array_map(function ($row) use ($highestColumn) { + return $highestColumn . $row; + }, range(1, $highestRow)), + function ($coordinate) use ($allCoordinates) { + return !in_array($coordinate, $allCoordinates); + } + ); + + // Create missing cells with null values + if (!empty($missingCoordinates)) { + foreach ($missingCoordinates as $coordinate) { + $worksheet->createNewCell($coordinate); + } + + // Refresh all coordinates + $allCoordinates = $worksheet->getCoordinates(); + } + // Loop through cells, bottom-up, and change cell coordinate if ($remove) { // It's faster to reverse and pop than to use unshift, especially with large cell collections diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php index 5b0a2907a..b4cf1913a 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php @@ -228,7 +228,7 @@ class Date * @param mixed $dateValue PHP DateTime object or a string - Unix timestamp is also permitted, but discouraged; * not Y2038-safe on a 32-bit system, and no timezone info * - * @return bool|float Excel date/time value + * @return false|float Excel date/time value * or boolean FALSE on failure */ public static function PHPToExcel($dateValue) diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php index 5c6ccfd3a..66111b6c8 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php @@ -415,7 +415,7 @@ class EigenvalueDecomposition $norm = 0.0; for ($i = 0; $i < $nn; ++$i) { - if (($i < $low) || ($i > $high)) { + if ($i > $high) { $this->d[$i] = $this->H[$i][$i]; $this->e[$i] = 0.0; } @@ -762,7 +762,7 @@ class EigenvalueDecomposition // Vectors of isolated roots for ($i = 0; $i < $nn; ++$i) { - if ($i < $low | $i > $high) { + if ($i > $high) { for ($j = $i; $j < $nn; ++$j) { $this->V[$i][$j] = $this->H[$i][$j]; } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index 7a31d77f6..fa92fd5db 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -71,12 +71,12 @@ class Root extends PPS $this->fileHandle = $fileHandle; // Initial Setting for saving - $this->bigBlockSize = 2 ** ( + $this->bigBlockSize = (int) (2 ** ( (isset($this->bigBlockSize)) ? self::adjust2($this->bigBlockSize) : 9 - ); - $this->smallBlockSize = 2 ** ( + )); + $this->smallBlockSize = (int) (2 ** ( (isset($this->smallBlockSize)) ? self::adjust2($this->smallBlockSize) : 6 - ); + )); // Make an array of PPS's (for Save) $aList = []; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php index 435d0e4cd..9970a2115 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php @@ -49,7 +49,7 @@ class StringHelper /** * Is iconv extension avalable? * - * @var bool + * @var ?bool */ private static $isIconvEnabled; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php index 61d1183ab..1162284b2 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php @@ -72,6 +72,7 @@ class Trend case self::TREND_POWER: if (!isset(self::$trendCache[$key])) { $className = '\PhpOffice\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit'; + // @phpstan-ignore-next-line self::$trendCache[$key] = new $className($yValues, $xValues, $const); } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php index 350ba652f..2b8c8360b 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php @@ -313,7 +313,7 @@ class Spreadsheet break; case 'target': case 'data': - if (is_array($this->ribbonXMLData) && isset($this->ribbonXMLData[$what])) { + if (is_array($this->ribbonXMLData)) { $returnData = $this->ribbonXMLData[$what]; } @@ -608,7 +608,7 @@ class Spreadsheet /** * Add sheet. * - * @param Worksheet $worksheet The worskeet to add + * @param Worksheet $worksheet The worksheet to add * @param null|int $sheetIndex Index where sheet should go (0,1,..., or null for last) * * @return Worksheet diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php index c2d4f7490..6fd91c64f 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php @@ -26,10 +26,24 @@ class Color extends Supervisor const COLOR_DARKGREEN = 'FF008000'; const COLOR_YELLOW = 'FFFFFF00'; const COLOR_DARKYELLOW = 'FF808000'; + const COLOR_MAGENTA = 'FFFF00FF'; + const COLOR_CYAN = 'FF00FFFF'; + + const NAMED_COLOR_TRANSLATIONS = [ + 'Black' => self::COLOR_BLACK, + 'White' => self::COLOR_WHITE, + 'Red' => self::COLOR_RED, + 'Green' => self::COLOR_GREEN, + 'Blue' => self::COLOR_BLUE, + 'Yellow' => self::COLOR_YELLOW, + 'Magenta' => self::COLOR_MAGENTA, + 'Cyan' => self::COLOR_CYAN, + ]; const VALIDATE_ARGB_SIZE = 8; const VALIDATE_RGB_SIZE = 6; - const VALIDATE_COLOR_VALUE = '/^[A-F0-9]{%d}$/i'; + const VALIDATE_COLOR_6 = '/^[A-F0-9]{6}$/i'; + const VALIDATE_COLOR_8 = '/^[A-F0-9]{8}$/i'; /** * Indexed colors array. @@ -66,7 +80,7 @@ class Color extends Supervisor // Initialise values if (!$isConditional) { - $this->argb = $this->validateColor($colorValue, self::VALIDATE_ARGB_SIZE) ? $colorValue : self::COLOR_BLACK; + $this->argb = $this->validateColor($colorValue) ?: self::COLOR_BLACK; } } @@ -135,10 +149,23 @@ class Color extends Supervisor return $this; } - private function validateColor(string $colorValue, int $size): bool + private function validateColor(?string $colorValue): string { - return in_array(ucfirst(strtolower($colorValue)), self::NAMED_COLORS) || - preg_match(sprintf(self::VALIDATE_COLOR_VALUE, $size), $colorValue); + if ($colorValue === null || $colorValue === '') { + return self::COLOR_BLACK; + } + $named = ucfirst(strtolower($colorValue)); + if (array_key_exists($named, self::NAMED_COLOR_TRANSLATIONS)) { + return self::NAMED_COLOR_TRANSLATIONS[$named]; + } + if (preg_match(self::VALIDATE_COLOR_8, $colorValue) === 1) { + return $colorValue; + } + if (preg_match(self::VALIDATE_COLOR_6, $colorValue) === 1) { + return 'FF' . $colorValue; + } + + return ''; } /** @@ -163,9 +190,8 @@ class Color extends Supervisor public function setARGB(?string $colorValue = self::COLOR_BLACK) { $this->hasChanged = true; - if ($colorValue === '' || $colorValue === null) { - $colorValue = self::COLOR_BLACK; - } elseif (!$this->validateColor($colorValue, self::VALIDATE_ARGB_SIZE)) { + $colorValue = $this->validateColor($colorValue); + if ($colorValue === '') { return $this; } @@ -200,21 +226,7 @@ class Color extends Supervisor */ public function setRGB(?string $colorValue = self::COLOR_BLACK) { - $this->hasChanged = true; - if ($colorValue === '' || $colorValue === null) { - $colorValue = '000000'; - } elseif (!$this->validateColor($colorValue, self::VALIDATE_RGB_SIZE)) { - return $this; - } - - if ($this->isSupervisor) { - $styleArray = $this->getStyleArray(['argb' => 'FF' . $colorValue]); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->argb = 'FF' . $colorValue; - } - - return $this; + return $this->setARGB($colorValue); } /** diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php index e148ee82b..e67964c2c 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php @@ -9,23 +9,37 @@ class Conditional implements IComparable { // Condition types const CONDITION_NONE = 'none'; + const CONDITION_BEGINSWITH = 'beginsWith'; const CONDITION_CELLIS = 'cellIs'; - const CONDITION_CONTAINSTEXT = 'containsText'; - const CONDITION_EXPRESSION = 'expression'; const CONDITION_CONTAINSBLANKS = 'containsBlanks'; - const CONDITION_NOTCONTAINSBLANKS = 'notContainsBlanks'; + const CONDITION_CONTAINSERRORS = 'containsErrors'; + const CONDITION_CONTAINSTEXT = 'containsText'; const CONDITION_DATABAR = 'dataBar'; + const CONDITION_ENDSWITH = 'endsWith'; + const CONDITION_EXPRESSION = 'expression'; + const CONDITION_NOTCONTAINSBLANKS = 'notContainsBlanks'; + const CONDITION_NOTCONTAINSERRORS = 'notContainsErrors'; const CONDITION_NOTCONTAINSTEXT = 'notContainsText'; + const CONDITION_TIMEPERIOD = 'timePeriod'; + const CONDITION_DUPLICATES = 'duplicateValues'; + const CONDITION_UNIQUE = 'uniqueValues'; private const CONDITION_TYPES = [ + self::CONDITION_BEGINSWITH, self::CONDITION_CELLIS, self::CONDITION_CONTAINSBLANKS, + self::CONDITION_CONTAINSERRORS, self::CONDITION_CONTAINSTEXT, self::CONDITION_DATABAR, + self::CONDITION_DUPLICATES, + self::CONDITION_ENDSWITH, self::CONDITION_EXPRESSION, self::CONDITION_NONE, self::CONDITION_NOTCONTAINSBLANKS, + self::CONDITION_NOTCONTAINSERRORS, self::CONDITION_NOTCONTAINSTEXT, + self::CONDITION_TIMEPERIOD, + self::CONDITION_UNIQUE, ]; // Operator types @@ -43,6 +57,17 @@ class Conditional implements IComparable const OPERATOR_BETWEEN = 'between'; const OPERATOR_NOTBETWEEN = 'notBetween'; + const TIMEPERIOD_TODAY = 'today'; + const TIMEPERIOD_YESTERDAY = 'yesterday'; + const TIMEPERIOD_TOMORROW = 'tomorrow'; + const TIMEPERIOD_LAST_7_DAYS = 'last7Days'; + const TIMEPERIOD_LAST_WEEK = 'lastWeek'; + const TIMEPERIOD_THIS_WEEK = 'thisWeek'; + const TIMEPERIOD_NEXT_WEEK = 'nextWeek'; + const TIMEPERIOD_LAST_MONTH = 'lastMonth'; + const TIMEPERIOD_THIS_MONTH = 'thisMonth'; + const TIMEPERIOD_NEXT_MONTH = 'nextMonth'; + /** * Condition type. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellMatcher.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellMatcher.php new file mode 100644 index 000000000..7d5201205 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellMatcher.php @@ -0,0 +1,312 @@ + '=', + Conditional::OPERATOR_GREATERTHAN => '>', + Conditional::OPERATOR_GREATERTHANOREQUAL => '>=', + Conditional::OPERATOR_LESSTHAN => '<', + Conditional::OPERATOR_LESSTHANOREQUAL => '<=', + Conditional::OPERATOR_NOTEQUAL => '<>', + ]; + + public const COMPARISON_RANGE_OPERATORS = [ + Conditional::OPERATOR_BETWEEN => 'IF(AND(A1>=%s,A1<=%s),TRUE,FALSE)', + Conditional::OPERATOR_NOTBETWEEN => 'IF(AND(A1>=%s,A1<=%s),FALSE,TRUE)', + ]; + + public const COMPARISON_DUPLICATES_OPERATORS = [ + Conditional::CONDITION_DUPLICATES => "COUNTIF('%s'!%s,%s)>1", + Conditional::CONDITION_UNIQUE => "COUNTIF('%s'!%s,%s)=1", + ]; + + /** + * @var Cell + */ + protected $cell; + + /** + * @var int + */ + protected $cellRow; + + /** + * @var Worksheet + */ + protected $worksheet; + + /** + * @var int + */ + protected $cellColumn; + + /** + * @var string + */ + protected $conditionalRange; + + /** + * @var string + */ + protected $referenceCell; + + /** + * @var int + */ + protected $referenceRow; + + /** + * @var int + */ + protected $referenceColumn; + + /** + * @var Calculation + */ + protected $engine; + + public function __construct(Cell $cell, string $conditionalRange) + { + $this->cell = $cell; + $this->worksheet = $cell->getWorksheet(); + [$this->cellColumn, $this->cellRow] = Coordinate::indexesFromString($this->cell->getCoordinate()); + $this->setReferenceCellForExpressions($conditionalRange); + + $this->engine = Calculation::getInstance($this->worksheet->getParent()); + } + + protected function setReferenceCellForExpressions(string $conditionalRange): void + { + $conditionalRange = Coordinate::splitRange(str_replace('$', '', strtoupper($conditionalRange))); + [$this->referenceCell] = $conditionalRange[0]; + + [$this->referenceColumn, $this->referenceRow] = Coordinate::indexesFromString($this->referenceCell); + + // Convert our conditional range to an absolute conditional range, so it can be used "pinned" in formulae + $rangeSets = []; + foreach ($conditionalRange as $rangeSet) { + $absoluteRangeSet = array_map( + [Coordinate::class, 'absoluteCoordinate'], + $rangeSet + ); + $rangeSets[] = implode(':', $absoluteRangeSet); + } + $this->conditionalRange = implode(',', $rangeSets); + } + + public function evaluateConditional(Conditional $conditional): bool + { + // Some calculations may modify the stored cell; so reset it before every evaluation. + $cellColumn = Coordinate::stringFromColumnIndex($this->cellColumn); + $cellAddress = "{$cellColumn}{$this->cellRow}"; + $this->cell = $this->worksheet->getCell($cellAddress); + + switch ($conditional->getConditionType()) { + case Conditional::CONDITION_CELLIS: + return $this->processOperatorComparison($conditional); + case Conditional::CONDITION_DUPLICATES: + case Conditional::CONDITION_UNIQUE: + return $this->processDuplicatesComparison($conditional); + case Conditional::CONDITION_CONTAINSTEXT: + // Expression is NOT(ISERROR(SEARCH("",))) + case Conditional::CONDITION_NOTCONTAINSTEXT: + // Expression is ISERROR(SEARCH("",)) + case Conditional::CONDITION_BEGINSWITH: + // Expression is LEFT(,LEN(""))="" + case Conditional::CONDITION_ENDSWITH: + // Expression is RIGHT(,LEN(""))="" + case Conditional::CONDITION_CONTAINSBLANKS: + // Expression is LEN(TRIM())=0 + case Conditional::CONDITION_NOTCONTAINSBLANKS: + // Expression is LEN(TRIM())>0 + case Conditional::CONDITION_CONTAINSERRORS: + // Expression is ISERROR() + case Conditional::CONDITION_NOTCONTAINSERRORS: + // Expression is NOT(ISERROR()) + case Conditional::CONDITION_TIMEPERIOD: + // Expression varies, depending on specified timePeriod value, e.g. + // Yesterday FLOOR(,1)=TODAY()-1 + // Today FLOOR(,1)=TODAY() + // Tomorrow FLOOR(,1)=TODAY()+1 + // Last 7 Days AND(TODAY()-FLOOR(,1)<=6,FLOOR(,1)<=TODAY()) + case Conditional::CONDITION_EXPRESSION: + return $this->processExpression($conditional); + } + + return false; + } + + /** + * @param mixed $value + * + * @return float|int|string + */ + protected function wrapValue($value) + { + if (!is_numeric($value)) { + if (is_bool($value)) { + return $value ? 'TRUE' : 'FALSE'; + } elseif ($value === null) { + return 'NULL'; + } + + return '"' . $value . '"'; + } + + return $value; + } + + /** + * @return float|int|string + */ + protected function wrapCellValue() + { + return $this->wrapValue($this->cell->getCalculatedValue()); + } + + /** + * @return float|int|string + */ + protected function conditionCellAdjustment(array $matches) + { + $column = $matches[6]; + $row = $matches[7]; + + if (strpos($column, '$') === false) { + $column = Coordinate::columnIndexFromString($column); + $column += $this->cellColumn - $this->referenceColumn; + $column = Coordinate::stringFromColumnIndex($column); + } + + if (strpos($row, '$') === false) { + $row += $this->cellRow - $this->referenceRow; + } + + if (!empty($matches[4])) { + $worksheet = $this->worksheet->getParent()->getSheetByName(trim($matches[4], "'")); + if ($worksheet === null) { + return $this->wrapValue(null); + } + + return $this->wrapValue( + $worksheet + ->getCell(str_replace('$', '', "{$column}{$row}")) + ->getCalculatedValue() + ); + } + + return $this->wrapValue( + $this->worksheet + ->getCell(str_replace('$', '', "{$column}{$row}")) + ->getCalculatedValue() + ); + } + + protected function cellConditionCheck(string $condition): string + { + $splitCondition = explode(Calculation::FORMULA_STRING_QUOTE, $condition); + $i = false; + foreach ($splitCondition as &$value) { + // Only count/replace in alternating array entries (ie. not in quoted strings) + if ($i = !$i) { + $value = preg_replace_callback( + '/' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '/i', + [$this, 'conditionCellAdjustment'], + $value + ); + } + } + unset($value); + // Then rebuild the condition string to return it + return implode(Calculation::FORMULA_STRING_QUOTE, $splitCondition); + } + + protected function adjustConditionsForCellReferences(array $conditions): array + { + return array_map( + [$this, 'cellConditionCheck'], + $conditions + ); + } + + protected function processOperatorComparison(Conditional $conditional): bool + { + if (array_key_exists($conditional->getOperatorType(), self::COMPARISON_RANGE_OPERATORS)) { + return $this->processRangeOperator($conditional); + } + + $operator = self::COMPARISON_OPERATORS[$conditional->getOperatorType()]; + $conditions = $this->adjustConditionsForCellReferences($conditional->getConditions()); + $expression = sprintf('%s%s%s', (string) $this->wrapCellValue(), $operator, (string) array_pop($conditions)); + + return $this->evaluateExpression($expression); + } + + protected function processRangeOperator(Conditional $conditional): bool + { + $conditions = $this->adjustConditionsForCellReferences($conditional->getConditions()); + sort($conditions); + $expression = sprintf( + (string) preg_replace( + '/\bA1\b/i', + (string) $this->wrapCellValue(), + self::COMPARISON_RANGE_OPERATORS[$conditional->getOperatorType()] + ), + ...$conditions + ); + + return $this->evaluateExpression($expression); + } + + protected function processDuplicatesComparison(Conditional $conditional): bool + { + $worksheetName = $this->cell->getWorksheet()->getTitle(); + + $expression = sprintf( + self::COMPARISON_DUPLICATES_OPERATORS[$conditional->getConditionType()], + $worksheetName, + $this->conditionalRange, + $this->cellConditionCheck($this->cell->getCalculatedValue()) + ); + + return $this->evaluateExpression($expression); + } + + protected function processExpression(Conditional $conditional): bool + { + $conditions = $this->adjustConditionsForCellReferences($conditional->getConditions()); + $expression = array_pop($conditions); + + $expression = preg_replace( + '/\b' . $this->referenceCell . '\b/i', + (string) $this->wrapCellValue(), + $expression + ); + + return $this->evaluateExpression($expression); + } + + protected function evaluateExpression(string $expression): bool + { + $expression = "={$expression}"; + + try { + $this->engine->flushInstance(); + $result = (bool) $this->engine->calculateFormula($expression); + } catch (Exception $e) { + return false; + } + + return $result; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellStyleAssessor.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellStyleAssessor.php new file mode 100644 index 000000000..4c000db32 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellStyleAssessor.php @@ -0,0 +1,45 @@ +cellMatcher = new CellMatcher($cell, $conditionalRange); + $this->styleMerger = new StyleMerger($cell->getStyle()); + } + + /** + * @param Conditional[] $conditionalStyles + */ + public function matchConditions(array $conditionalStyles = []): Style + { + foreach ($conditionalStyles as $conditional) { + /** @var Conditional $conditional */ + if ($this->cellMatcher->evaluateConditional($conditional) === true) { + // Merging the conditional style into the base style goes in here + $this->styleMerger->mergeStyle($conditional->getStyle()); + if ($conditional->getStopIfTrue() === true) { + break; + } + } + } + + return $this->styleMerger->getStyle(); + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php new file mode 100644 index 000000000..95e6dfd8b --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php @@ -0,0 +1,118 @@ +baseStyle = $baseStyle; + } + + public function getStyle(): Style + { + return $this->baseStyle; + } + + public function mergeStyle(Style $style): void + { + if ($style->getNumberFormat() !== null && $style->getNumberFormat()->getFormatCode() !== null) { + $this->baseStyle->getNumberFormat()->setFormatCode($style->getNumberFormat()->getFormatCode()); + } + + if ($style->getFont() !== null) { + $this->mergeFontStyle($this->baseStyle->getFont(), $style->getFont()); + } + + if ($style->getFill() !== null) { + $this->mergeFillStyle($this->baseStyle->getFill(), $style->getFill()); + } + + if ($style->getBorders() !== null) { + $this->mergeBordersStyle($this->baseStyle->getBorders(), $style->getBorders()); + } + } + + protected function mergeFontStyle(Font $baseFontStyle, Font $fontStyle): void + { + if ($fontStyle->getBold() !== null) { + $baseFontStyle->setBold($fontStyle->getBold()); + } + + if ($fontStyle->getItalic() !== null) { + $baseFontStyle->setItalic($fontStyle->getItalic()); + } + + if ($fontStyle->getStrikethrough() !== null) { + $baseFontStyle->setStrikethrough($fontStyle->getStrikethrough()); + } + + if ($fontStyle->getUnderline() !== null) { + $baseFontStyle->setUnderline($fontStyle->getUnderline()); + } + + if ($fontStyle->getColor() !== null && $fontStyle->getColor()->getARGB() !== null) { + $baseFontStyle->setColor($fontStyle->getColor()); + } + } + + protected function mergeFillStyle(Fill $baseFillStyle, Fill $fillStyle): void + { + if ($fillStyle->getFillType() !== null) { + $baseFillStyle->setFillType($fillStyle->getFillType()); + } + + if ($fillStyle->getRotation() !== null) { + $baseFillStyle->setRotation($fillStyle->getRotation()); + } + + if ($fillStyle->getStartColor() !== null && $fillStyle->getStartColor()->getARGB() !== null) { + $baseFillStyle->setStartColor($fillStyle->getStartColor()); + } + + if ($fillStyle->getEndColor() !== null && $fillStyle->getEndColor()->getARGB() !== null) { + $baseFillStyle->setEndColor($fillStyle->getEndColor()); + } + } + + protected function mergeBordersStyle(Borders $baseBordersStyle, Borders $bordersStyle): void + { + if ($bordersStyle->getTop() !== null) { + $this->mergeBorderStyle($baseBordersStyle->getTop(), $bordersStyle->getTop()); + } + + if ($bordersStyle->getBottom() !== null) { + $this->mergeBorderStyle($baseBordersStyle->getBottom(), $bordersStyle->getBottom()); + } + + if ($bordersStyle->getLeft() !== null) { + $this->mergeBorderStyle($baseBordersStyle->getLeft(), $bordersStyle->getLeft()); + } + + if ($bordersStyle->getRight() !== null) { + $this->mergeBorderStyle($baseBordersStyle->getRight(), $bordersStyle->getRight()); + } + } + + protected function mergeBorderStyle(Border $baseBorderStyle, Border $borderStyle): void + { + if ($borderStyle->getBorderStyle() !== null) { + $baseBorderStyle->setBorderStyle($borderStyle->getBorderStyle()); + } + + if ($borderStyle->getColor() !== null && $borderStyle->getColor()->getARGB() !== null) { + $baseBorderStyle->setColor($borderStyle->getColor()); + } + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php new file mode 100644 index 000000000..d5d56a9a3 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php @@ -0,0 +1,95 @@ +cellRange = $cellRange; + } + + public function newRule(string $ruleType): WizardInterface + { + switch ($ruleType) { + case self::CELL_VALUE: + return new Wizard\CellValue($this->cellRange); + case self::TEXT_VALUE: + return new Wizard\TextValue($this->cellRange); + case self::BLANKS: + return new Wizard\Blanks($this->cellRange, true); + case self::NOT_BLANKS: + return new Wizard\Blanks($this->cellRange, false); + case self::ERRORS: + return new Wizard\Errors($this->cellRange, true); + case self::NOT_ERRORS: + return new Wizard\Errors($this->cellRange, false); + case self::EXPRESSION: + case self::FORMULA: + return new Wizard\Expression($this->cellRange); + case self::DATES_OCCURRING: + return new Wizard\DateValue($this->cellRange); + case self::DUPLICATES: + return new Wizard\Duplicates($this->cellRange, false); + case self::UNIQUE: + return new Wizard\Duplicates($this->cellRange, true); + default: + throw new Exception('No wizard exists for this CF rule type'); + } + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + $conditionalType = $conditional->getConditionType(); + + switch ($conditionalType) { + case Conditional::CONDITION_CELLIS: + return Wizard\CellValue::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_CONTAINSTEXT: + case Conditional::CONDITION_NOTCONTAINSTEXT: + case Conditional::CONDITION_BEGINSWITH: + case Conditional::CONDITION_ENDSWITH: + return Wizard\TextValue::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_CONTAINSBLANKS: + case Conditional::CONDITION_NOTCONTAINSBLANKS: + return Wizard\Blanks::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_CONTAINSERRORS: + case Conditional::CONDITION_NOTCONTAINSERRORS: + return Wizard\Errors::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_TIMEPERIOD: + return Wizard\DateValue::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_EXPRESSION: + return Wizard\Expression::fromConditional($conditional, $cellRange); + case Conditional::CONDITION_DUPLICATES: + case Conditional::CONDITION_UNIQUE: + return Wizard\Duplicates::fromConditional($conditional, $cellRange); + default: + throw new Exception('No wizard exists for this CF rule type'); + } + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php new file mode 100644 index 000000000..14f30d39e --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php @@ -0,0 +1,99 @@ + false, + 'isBlank' => true, + 'notEmpty' => false, + 'empty' => true, + ]; + + protected const EXPRESSIONS = [ + Wizard::NOT_BLANKS => 'LEN(TRIM(%s))>0', + Wizard::BLANKS => 'LEN(TRIM(%s))=0', + ]; + + /** + * @var bool + */ + protected $inverse; + + public function __construct(string $cellRange, bool $inverse = false) + { + parent::__construct($cellRange); + $this->inverse = $inverse; + } + + protected function inverse(bool $inverse): void + { + $this->inverse = $inverse; + } + + protected function getExpression(): void + { + $this->expression = sprintf( + self::EXPRESSIONS[$this->inverse ? Wizard::BLANKS : Wizard::NOT_BLANKS], + $this->referenceCell + ); + } + + public function getConditional(): Conditional + { + $this->getExpression(); + + $conditional = new Conditional(); + $conditional->setConditionType( + $this->inverse ? Conditional::CONDITION_CONTAINSBLANKS : Conditional::CONDITION_NOTCONTAINSBLANKS + ); + $conditional->setConditions([$this->expression]); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ( + $conditional->getConditionType() !== Conditional::CONDITION_CONTAINSBLANKS && + $conditional->getConditionType() !== Conditional::CONDITION_NOTCONTAINSBLANKS + ) { + throw new Exception('Conditional is not a Blanks CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + $wizard->inverse = $conditional->getConditionType() === Conditional::CONDITION_CONTAINSBLANKS; + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!array_key_exists($methodName, self::OPERATORS)) { + throw new Exception('Invalid Operation for Blanks CF Rule Wizard'); + } + + $this->inverse(self::OPERATORS[$methodName]); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php new file mode 100644 index 000000000..f36033dd1 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php @@ -0,0 +1,189 @@ + Conditional::OPERATOR_EQUAL, + 'notEquals' => Conditional::OPERATOR_NOTEQUAL, + 'greaterThan' => Conditional::OPERATOR_GREATERTHAN, + 'greaterThanOrEqual' => Conditional::OPERATOR_GREATERTHANOREQUAL, + 'lessThan' => Conditional::OPERATOR_LESSTHAN, + 'lessThanOrEqual' => Conditional::OPERATOR_LESSTHANOREQUAL, + 'between' => Conditional::OPERATOR_BETWEEN, + 'notBetween' => Conditional::OPERATOR_NOTBETWEEN, + ]; + + protected const SINGLE_OPERATORS = CellMatcher::COMPARISON_OPERATORS; + + protected const RANGE_OPERATORS = CellMatcher::COMPARISON_RANGE_OPERATORS; + + /** @var string */ + protected $operator = Conditional::OPERATOR_EQUAL; + + /** @var array */ + protected $operand = [0]; + + /** + * @var string[] + */ + protected $operandValueType = []; + + public function __construct(string $cellRange) + { + parent::__construct($cellRange); + } + + protected function operator(string $operator): void + { + if ((!isset(self::SINGLE_OPERATORS[$operator])) && (!isset(self::RANGE_OPERATORS[$operator]))) { + throw new Exception('Invalid Operator for Cell Value CF Rule Wizard'); + } + + $this->operator = $operator; + } + + /** + * @param mixed $operand + */ + protected function operand(int $index, $operand, string $operandValueType = Wizard::VALUE_TYPE_LITERAL): void + { + if (is_string($operand)) { + $operand = $this->validateOperand($operand, $operandValueType); + } + + $this->operand[$index] = $operand; + $this->operandValueType[$index] = $operandValueType; + } + + /** + * @param mixed $value + * + * @return float|int|string + */ + protected function wrapValue($value, string $operandValueType) + { + if (!is_numeric($value) && !is_bool($value) && null !== $value) { + if ($operandValueType === Wizard::VALUE_TYPE_LITERAL) { + return '"' . str_replace('"', '""', $value) . '"'; + } + + return $this->cellConditionCheck($value); + } + + if (null === $value) { + $value = 'NULL'; + } elseif (is_bool($value)) { + $value = $value ? 'TRUE' : 'FALSE'; + } + + return $value; + } + + public function getConditional(): Conditional + { + if (!isset(self::RANGE_OPERATORS[$this->operator])) { + unset($this->operand[1], $this->operandValueType[1]); + } + $values = array_map([$this, 'wrapValue'], $this->operand, $this->operandValueType); + + $conditional = new Conditional(); + $conditional->setConditionType(Conditional::CONDITION_CELLIS); + $conditional->setOperatorType($this->operator); + $conditional->setConditions($values); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + protected static function unwrapString(string $condition): string + { + if ((strpos($condition, '"') === 0) && (strpos(strrev($condition), '"') === 0)) { + $condition = substr($condition, 1, -1); + } + + return str_replace('""', '"', $condition); + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ($conditional->getConditionType() !== Conditional::CONDITION_CELLIS) { + throw new Exception('Conditional is not a Cell Value CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + + $wizard->operator = $conditional->getOperatorType(); + $conditions = $conditional->getConditions(); + foreach ($conditions as $index => $condition) { + // Best-guess to try and identify if the text is a string literal, a cell reference or a formula? + $operandValueType = Wizard::VALUE_TYPE_LITERAL; + if (is_string($condition)) { + if (array_key_exists($condition, Calculation::$excelConstants)) { + $condition = Calculation::$excelConstants[$condition]; + } elseif (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '$/i', $condition)) { + $operandValueType = Wizard::VALUE_TYPE_CELL; + $condition = self::reverseAdjustCellRef($condition, $cellRange); + } elseif ( + preg_match('/\(\)/', $condition) || + preg_match('/' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '/i', $condition) + ) { + $operandValueType = Wizard::VALUE_TYPE_FORMULA; + $condition = self::reverseAdjustCellRef($condition, $cellRange); + } else { + $condition = self::unwrapString($condition); + } + } + $wizard->operand($index, $condition, $operandValueType); + } + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!isset(self::MAGIC_OPERATIONS[$methodName]) && $methodName !== 'and') { + throw new Exception('Invalid Operator for Cell Value CF Rule Wizard'); + } + + if ($methodName === 'and') { + if (!isset(self::RANGE_OPERATORS[$this->operator])) { + throw new Exception('AND Value is only appropriate for range operators'); + } + + $this->operand(1, ...$arguments); + + return $this; + } + + $this->operator(self::MAGIC_OPERATIONS[$methodName]); + $this->operand(0, ...$arguments); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/DateValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/DateValue.php new file mode 100644 index 000000000..453dcdf91 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/DateValue.php @@ -0,0 +1,111 @@ + Conditional::TIMEPERIOD_YESTERDAY, + 'today' => Conditional::TIMEPERIOD_TODAY, + 'tomorrow' => Conditional::TIMEPERIOD_TOMORROW, + 'lastSevenDays' => Conditional::TIMEPERIOD_LAST_7_DAYS, + 'last7Days' => Conditional::TIMEPERIOD_LAST_7_DAYS, + 'lastWeek' => Conditional::TIMEPERIOD_LAST_WEEK, + 'thisWeek' => Conditional::TIMEPERIOD_THIS_WEEK, + 'nextWeek' => Conditional::TIMEPERIOD_NEXT_WEEK, + 'lastMonth' => Conditional::TIMEPERIOD_LAST_MONTH, + 'thisMonth' => Conditional::TIMEPERIOD_THIS_MONTH, + 'nextMonth' => Conditional::TIMEPERIOD_NEXT_MONTH, + ]; + + protected const EXPRESSIONS = [ + Conditional::TIMEPERIOD_YESTERDAY => 'FLOOR(%s,1)=TODAY()-1', + Conditional::TIMEPERIOD_TODAY => 'FLOOR(%s,1)=TODAY()', + Conditional::TIMEPERIOD_TOMORROW => 'FLOOR(%s,1)=TODAY()+1', + Conditional::TIMEPERIOD_LAST_7_DAYS => 'AND(TODAY()-FLOOR(%s,1)<=6,FLOOR(%s,1)<=TODAY())', + Conditional::TIMEPERIOD_LAST_WEEK => 'AND(TODAY()-ROUNDDOWN(%s,0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(%s,0)<(WEEKDAY(TODAY())+7))', + Conditional::TIMEPERIOD_THIS_WEEK => 'AND(TODAY()-ROUNDDOWN(%s,0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(%s,0)-TODAY()<=7-WEEKDAY(TODAY()))', + Conditional::TIMEPERIOD_NEXT_WEEK => 'AND(ROUNDDOWN(%s,0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(%s,0)-TODAY()<(15-WEEKDAY(TODAY())))', + Conditional::TIMEPERIOD_LAST_MONTH => 'AND(MONTH(%s)=MONTH(EDATE(TODAY(),0-1)),YEAR(%s)=YEAR(EDATE(TODAY(),0-1)))', + Conditional::TIMEPERIOD_THIS_MONTH => 'AND(MONTH(%s)=MONTH(TODAY()),YEAR(%s)=YEAR(TODAY()))', + Conditional::TIMEPERIOD_NEXT_MONTH => 'AND(MONTH(%s)=MONTH(EDATE(TODAY(),0+1)),YEAR(%s)=YEAR(EDATE(TODAY(),0+1)))', + ]; + + /** @var string */ + protected $operator; + + public function __construct(string $cellRange) + { + parent::__construct($cellRange); + } + + protected function operator(string $operator): void + { + $this->operator = $operator; + } + + protected function setExpression(): void + { + $referenceCount = substr_count(self::EXPRESSIONS[$this->operator], '%s'); + $references = array_fill(0, $referenceCount, $this->referenceCell); + $this->expression = sprintf(self::EXPRESSIONS[$this->operator], ...$references); + } + + public function getConditional(): Conditional + { + $this->setExpression(); + + $conditional = new Conditional(); + $conditional->setConditionType(Conditional::CONDITION_TIMEPERIOD); + $conditional->setText($this->operator); + $conditional->setConditions([$this->expression]); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ($conditional->getConditionType() !== Conditional::CONDITION_TIMEPERIOD) { + throw new Exception('Conditional is not a Date Value CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + $wizard->operator = $conditional->getText(); + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!isset(self::MAGIC_OPERATIONS[$methodName])) { + throw new Exception('Invalid Operation for Date Value CF Rule Wizard'); + } + + $this->operator(self::MAGIC_OPERATIONS[$methodName]); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Duplicates.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Duplicates.php new file mode 100644 index 000000000..3f063fefd --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Duplicates.php @@ -0,0 +1,78 @@ + false, + 'unique' => true, + ]; + + /** + * @var bool + */ + protected $inverse; + + public function __construct(string $cellRange, bool $inverse = false) + { + parent::__construct($cellRange); + $this->inverse = $inverse; + } + + protected function inverse(bool $inverse): void + { + $this->inverse = $inverse; + } + + public function getConditional(): Conditional + { + $conditional = new Conditional(); + $conditional->setConditionType( + $this->inverse ? Conditional::CONDITION_UNIQUE : Conditional::CONDITION_DUPLICATES + ); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ( + $conditional->getConditionType() !== Conditional::CONDITION_DUPLICATES && + $conditional->getConditionType() !== Conditional::CONDITION_UNIQUE + ) { + throw new Exception('Conditional is not a Duplicates CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + $wizard->inverse = $conditional->getConditionType() === Conditional::CONDITION_UNIQUE; + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!array_key_exists($methodName, self::OPERATORS)) { + throw new Exception('Invalid Operation for Errors CF Rule Wizard'); + } + + $this->inverse(self::OPERATORS[$methodName]); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Errors.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Errors.php new file mode 100644 index 000000000..56b9086c8 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Errors.php @@ -0,0 +1,95 @@ + false, + 'isError' => true, + ]; + + protected const EXPRESSIONS = [ + Wizard::NOT_ERRORS => 'NOT(ISERROR(%s))', + Wizard::ERRORS => 'ISERROR(%s)', + ]; + + /** + * @var bool + */ + protected $inverse; + + public function __construct(string $cellRange, bool $inverse = false) + { + parent::__construct($cellRange); + $this->inverse = $inverse; + } + + protected function inverse(bool $inverse): void + { + $this->inverse = $inverse; + } + + protected function getExpression(): void + { + $this->expression = sprintf( + self::EXPRESSIONS[$this->inverse ? Wizard::ERRORS : Wizard::NOT_ERRORS], + $this->referenceCell + ); + } + + public function getConditional(): Conditional + { + $this->getExpression(); + + $conditional = new Conditional(); + $conditional->setConditionType( + $this->inverse ? Conditional::CONDITION_CONTAINSERRORS : Conditional::CONDITION_NOTCONTAINSERRORS + ); + $conditional->setConditions([$this->expression]); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ( + $conditional->getConditionType() !== Conditional::CONDITION_CONTAINSERRORS && + $conditional->getConditionType() !== Conditional::CONDITION_NOTCONTAINSERRORS + ) { + throw new Exception('Conditional is not an Errors CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + $wizard->inverse = $conditional->getConditionType() === Conditional::CONDITION_CONTAINSERRORS; + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!array_key_exists($methodName, self::OPERATORS)) { + throw new Exception('Invalid Operation for Errors CF Rule Wizard'); + } + + $this->inverse(self::OPERATORS[$methodName]); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php new file mode 100644 index 000000000..8c8c7f276 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php @@ -0,0 +1,73 @@ +validateOperand($expression, Wizard::VALUE_TYPE_FORMULA); + $this->expression = $expression; + + return $this; + } + + public function getConditional(): Conditional + { + $expression = $this->adjustConditionsForCellReferences([$this->expression]); + + $conditional = new Conditional(); + $conditional->setConditionType(Conditional::CONDITION_EXPRESSION); + $conditional->setConditions($expression); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if ($conditional->getConditionType() !== Conditional::CONDITION_EXPRESSION) { + throw new Exception('Conditional is not an Expression CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + $wizard->expression = self::reverseAdjustCellRef($conditional->getConditions()[0], $cellRange); + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if ($methodName !== 'formula') { + throw new Exception('Invalid Operation for Expression CF Rule Wizard'); + } + + $this->expression(...$arguments); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/TextValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/TextValue.php new file mode 100644 index 000000000..4fa635bec --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/TextValue.php @@ -0,0 +1,163 @@ + Conditional::OPERATOR_CONTAINSTEXT, + 'doesntContain' => Conditional::OPERATOR_NOTCONTAINS, + 'doesNotContain' => Conditional::OPERATOR_NOTCONTAINS, + 'beginsWith' => Conditional::OPERATOR_BEGINSWITH, + 'startsWith' => Conditional::OPERATOR_BEGINSWITH, + 'endsWith' => Conditional::OPERATOR_ENDSWITH, + ]; + + protected const OPERATORS = [ + Conditional::OPERATOR_CONTAINSTEXT => Conditional::CONDITION_CONTAINSTEXT, + Conditional::OPERATOR_NOTCONTAINS => Conditional::CONDITION_NOTCONTAINSTEXT, + Conditional::OPERATOR_BEGINSWITH => Conditional::CONDITION_BEGINSWITH, + Conditional::OPERATOR_ENDSWITH => Conditional::CONDITION_ENDSWITH, + ]; + + protected const EXPRESSIONS = [ + Conditional::OPERATOR_CONTAINSTEXT => 'NOT(ISERROR(SEARCH(%s,%s)))', + Conditional::OPERATOR_NOTCONTAINS => 'ISERROR(SEARCH(%s,%s))', + Conditional::OPERATOR_BEGINSWITH => 'LEFT(%s,LEN(%s))=%s', + Conditional::OPERATOR_ENDSWITH => 'RIGHT(%s,LEN(%s))=%s', + ]; + + /** @var string */ + protected $operator; + + /** @var string */ + protected $operand; + + /** + * @var string + */ + protected $operandValueType; + + public function __construct(string $cellRange) + { + parent::__construct($cellRange); + } + + protected function operator(string $operator): void + { + if (!isset(self::OPERATORS[$operator])) { + throw new Exception('Invalid Operator for Text Value CF Rule Wizard'); + } + + $this->operator = $operator; + } + + protected function operand(string $operand, string $operandValueType = Wizard::VALUE_TYPE_LITERAL): void + { + if (is_string($operand)) { + $operand = $this->validateOperand($operand, $operandValueType); + } + + $this->operand = $operand; + $this->operandValueType = $operandValueType; + } + + protected function wrapValue(string $value): string + { + return '"' . $value . '"'; + } + + protected function setExpression(): void + { + $operand = $this->operandValueType === Wizard::VALUE_TYPE_LITERAL + ? $this->wrapValue(str_replace('"', '""', $this->operand)) + : $this->cellConditionCheck($this->operand); + + if ( + $this->operator === Conditional::OPERATOR_CONTAINSTEXT || + $this->operator === Conditional::OPERATOR_NOTCONTAINS + ) { + $this->expression = sprintf(self::EXPRESSIONS[$this->operator], $operand, $this->referenceCell); + } else { + $this->expression = sprintf(self::EXPRESSIONS[$this->operator], $this->referenceCell, $operand, $operand); + } + } + + public function getConditional(): Conditional + { + $this->setExpression(); + + $conditional = new Conditional(); + $conditional->setConditionType(self::OPERATORS[$this->operator]); + $conditional->setOperatorType($this->operator); + $conditional->setText( + $this->operandValueType !== Wizard::VALUE_TYPE_LITERAL + ? $this->cellConditionCheck($this->operand) + : $this->operand + ); + $conditional->setConditions([$this->expression]); + $conditional->setStyle($this->getStyle()); + $conditional->setStopIfTrue($this->getStopIfTrue()); + + return $conditional; + } + + public static function fromConditional(Conditional $conditional, string $cellRange = 'A1'): WizardInterface + { + if (!in_array($conditional->getConditionType(), self::OPERATORS, true)) { + throw new Exception('Conditional is not a Text Value CF Rule conditional'); + } + + $wizard = new self($cellRange); + $wizard->operator = (string) array_search($conditional->getConditionType(), self::OPERATORS, true); + $wizard->style = $conditional->getStyle(); + $wizard->stopIfTrue = $conditional->getStopIfTrue(); + + // Best-guess to try and identify if the text is a string literal, a cell reference or a formula? + $wizard->operandValueType = Wizard::VALUE_TYPE_LITERAL; + $condition = $conditional->getText(); + if (is_string($condition) && array_key_exists($condition, Calculation::$excelConstants)) { + $condition = Calculation::$excelConstants[$condition]; + } elseif (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '$/i', $condition)) { + $wizard->operandValueType = Wizard::VALUE_TYPE_CELL; + $condition = self::reverseAdjustCellRef($condition, $cellRange); + } elseif ( + preg_match('/\(\)/', $condition) || + preg_match('/' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '/i', $condition) + ) { + $wizard->operandValueType = Wizard::VALUE_TYPE_FORMULA; + } + $wizard->operand = $condition; + + return $wizard; + } + + /** + * @param string $methodName + * @param mixed[] $arguments + */ + public function __call($methodName, $arguments): self + { + if (!isset(self::MAGIC_OPERATIONS[$methodName])) { + throw new Exception('Invalid Operation for Text Value CF Rule Wizard'); + } + + $this->operator(self::MAGIC_OPERATIONS[$methodName]); + $this->operand(...$arguments); + + return $this; + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardAbstract.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardAbstract.php new file mode 100644 index 000000000..75d6856e2 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardAbstract.php @@ -0,0 +1,197 @@ +setCellRange($cellRange); + } + + public function getCellRange(): string + { + return $this->cellRange; + } + + public function setCellRange(string $cellRange): void + { + $this->cellRange = $cellRange; + $this->setReferenceCellForExpressions($cellRange); + } + + protected function setReferenceCellForExpressions(string $conditionalRange): void + { + $conditionalRange = Coordinate::splitRange(str_replace('$', '', strtoupper($conditionalRange))); + [$this->referenceCell] = $conditionalRange[0]; + + [$this->referenceColumn, $this->referenceRow] = Coordinate::indexesFromString($this->referenceCell); + } + + public function getStopIfTrue(): bool + { + return $this->stopIfTrue; + } + + public function setStopIfTrue(bool $stopIfTrue): void + { + $this->stopIfTrue = $stopIfTrue; + } + + public function getStyle(): Style + { + return $this->style ?? new Style(false, true); + } + + public function setStyle(Style $style): void + { + $this->style = $style; + } + + protected function validateOperand(string $operand, string $operandValueType = Wizard::VALUE_TYPE_LITERAL): string + { + if ( + $operandValueType === Wizard::VALUE_TYPE_LITERAL && + substr($operand, 0, 1) === '"' && + substr($operand, -1) === '"' + ) { + $operand = str_replace('""', '"', substr($operand, 1, -1)); + } elseif ($operandValueType === Wizard::VALUE_TYPE_FORMULA && substr($operand, 0, 1) === '=') { + $operand = substr($operand, 1); + } + + return $operand; + } + + protected static function reverseCellAdjustment(array $matches, int $referenceColumn, int $referenceRow): string + { + $worksheet = $matches[1]; + $column = $matches[6]; + $row = $matches[7]; + + if (strpos($column, '$') === false) { + $column = Coordinate::columnIndexFromString($column); + $column -= $referenceColumn - 1; + $column = Coordinate::stringFromColumnIndex($column); + } + + if (strpos($row, '$') === false) { + $row -= $referenceRow - 1; + } + + return "{$worksheet}{$column}{$row}"; + } + + protected static function reverseAdjustCellRef(string $condition, string $cellRange): string + { + $conditionalRange = Coordinate::splitRange(str_replace('$', '', strtoupper($cellRange))); + [$referenceCell] = $conditionalRange[0]; + [$referenceColumnIndex, $referenceRow] = Coordinate::indexesFromString($referenceCell); + + $splitCondition = explode(Calculation::FORMULA_STRING_QUOTE, $condition); + $i = false; + foreach ($splitCondition as &$value) { + // Only count/replace in alternating array entries (ie. not in quoted strings) + if ($i = !$i) { + $value = preg_replace_callback( + '/' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '/i', + function ($matches) use ($referenceColumnIndex, $referenceRow) { + return self::reverseCellAdjustment($matches, $referenceColumnIndex, $referenceRow); + }, + $value + ); + } + } + unset($value); + + // Then rebuild the condition string to return it + return implode(Calculation::FORMULA_STRING_QUOTE, $splitCondition); + } + + protected function conditionCellAdjustment(array $matches): string + { + $worksheet = $matches[1]; + $column = $matches[6]; + $row = $matches[7]; + + if (strpos($column, '$') === false) { + $column = Coordinate::columnIndexFromString($column); + $column += $this->referenceColumn - 1; + $column = Coordinate::stringFromColumnIndex($column); + } + + if (strpos($row, '$') === false) { + $row += $this->referenceRow - 1; + } + + return "{$worksheet}{$column}{$row}"; + } + + protected function cellConditionCheck(string $condition): string + { + $splitCondition = explode(Calculation::FORMULA_STRING_QUOTE, $condition); + $i = false; + foreach ($splitCondition as &$value) { + // Only count/replace in alternating array entries (ie. not in quoted strings) + if ($i = !$i) { + $value = preg_replace_callback( + '/' . Calculation::CALCULATION_REGEXP_CELLREF_RELATIVE . '/i', + [$this, 'conditionCellAdjustment'], + $value + ); + } + } + unset($value); + + // Then rebuild the condition string to return it + return implode(Calculation::FORMULA_STRING_QUOTE, $splitCondition); + } + + protected function adjustConditionsForCellReferences(array $conditions): array + { + return array_map( + [$this, 'cellConditionCheck'], + $conditions + ); + } +} diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardInterface.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardInterface.php new file mode 100644 index 000000000..10ad57b20 --- /dev/null +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardInterface.php @@ -0,0 +1,25 @@ +-] // language info is in hexadecimal // strip off chinese part like [DBNum1][$-804] - $format = preg_replace('/^(\[DBNum\d\])*(\[\$[^\]]*\])/i', '', $format); + $format = preg_replace('/^(\[DBNum\d\])*(\[\$[^\]]*\])/i', '', $format) ?? ''; // OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case; // but we don't want to change any quoted strings - $format = preg_replace_callback('/(?:^|")([^"]*)(?:$|")/', ['self', 'setLowercaseCallback'], $format); + /** @var callable */ + $callable = ['self', 'setLowercaseCallback']; + $format = preg_replace_callback('/(?:^|")([^"]*)(?:$|")/', $callable, $format); // Only process the non-quoted blocks for date format characters $blocks = explode('"', $format); @@ -106,7 +108,9 @@ class DateFormatter $format = implode('"', $blocks); // escape any quoted characters so that DateTime format() will render them correctly - $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format); + /** @var callable */ + $callback = ['self', 'escapeQuotesCallback']; + $format = preg_replace_callback('/"(.*)"/U', $callback, $format); $dateObj = Date::excelToDateTimeObject($value); // If the colon preceding minute had been quoted, as happens in diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php index cf1731ec8..334c40df6 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php @@ -37,6 +37,9 @@ class PercentageFormatter extends BaseFormatter $replacement = "{$wholePartSize}.{$decimalPartSize}"; $mask = preg_replace('/[#0,]+\.?[?#0,]*/ui', "%{$replacement}f{$placeHolders}", $format); - return sprintf($mask, $value); + /** @var float */ + $valueFloat = $value; + + return sprintf($mask, round($valueFloat, $decimalPartSize)); } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php index fdb15451b..78e5ebbff 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php @@ -78,9 +78,7 @@ class Style extends Supervisor * @see Style::applyFromArray() * @see Style::getHashCode() * - * @phpstan-var null|array{styleByHash: array, hashByObjId: array} - * - * @var array + * @var ?array */ private static $cachedStyles; diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index 8a48f470c..17dd261b3 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -2,6 +2,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet; +use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadsheet\Helper\Dimension as CssDimension; class ColumnDimension extends Dimension @@ -53,16 +54,32 @@ class ColumnDimension extends Dimension /** * Set column index as string eg: 'A'. - * - * @return $this */ - public function setColumnIndex(string $index) + public function setColumnIndex(string $index): self { $this->columnIndex = $index; return $this; } + /** + * Get column index as numeric. + */ + public function getColumnNumeric(): int + { + return Coordinate::columnIndexFromString($this->columnIndex); + } + + /** + * Set column index as numeric. + */ + public function setColumnNumeric(int $index): self + { + $this->columnIndex = Coordinate::stringFromColumnIndex($index); + + return $this; + } + /** * Get Width. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php index 894ac19ed..ba03b5b72 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -131,19 +131,4 @@ abstract class Dimension return $this; } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() - { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } } diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php index ca8c3dfe4..362f20f08 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -1291,7 +1291,7 @@ class Worksheet implements IComparable * * @return Cell Cell that was created */ - private function createNewCell($coordinate) + public function createNewCell($coordinate) { $cell = new Cell(null, DataType::TYPE_NULL, $this); $this->cellCollection->add($coordinate, $cell); @@ -1415,10 +1415,8 @@ class Worksheet implements IComparable * Get style for cell. * * @param string $cellCoordinate Cell coordinate (or range) to get style for, eg: 'A1' - * - * @return Style */ - public function getStyle($cellCoordinate) + public function getStyle($cellCoordinate): Style { // set this sheet as active $this->parent->setActiveSheetIndex($this->parent->getIndex($this)); @@ -1440,7 +1438,7 @@ class Worksheet implements IComparable * * @return Conditional[] */ - public function getConditionalStyles($coordinate) + public function getConditionalStyles(string $coordinate): array { $coordinate = strtoupper($coordinate); if (strpos($coordinate, ':') !== false) { @@ -1457,6 +1455,19 @@ class Worksheet implements IComparable return []; } + public function getConditionalRange(string $coordinate): ?string + { + $coordinate = strtoupper($coordinate); + $cell = $this->getCell($coordinate); + foreach (array_keys($this->conditionalStylesCollection) as $conditionalRange) { + if ($cell->isInRange($conditionalRange)) { + return $conditionalRange; + } + } + + return null; + } + /** * Do conditional styles exist for this cell? * @@ -1465,10 +1476,8 @@ class Worksheet implements IComparable * conditional style range. * If a range of cells is specified, then true will only be returned if the range matches the entire * range of the conditional. - * - * @return bool */ - public function conditionalStylesExists($coordinate) + public function conditionalStylesExists($coordinate): bool { $coordinate = strtoupper($coordinate); if (strpos($coordinate, ':') !== false) { @@ -1689,27 +1698,33 @@ class Worksheet implements IComparable { // Uppercase coordinate $range = strtoupper($range); + // Convert 'A:C' to 'A1:C1048576' + $range = self::pregReplace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $range); + // Convert '1:3' to 'A1:XFD3' + $range = self::pregReplace('/^(\\d+):(\\d+)$/', 'A${1}:XFD${2}', $range); - if (strpos($range, ':') !== false) { + if (preg_match('/^([A-Z]+)(\\d+):([A-Z]+)(\\d+)$/', $range, $matches) === 1) { $this->mergeCells[$range] = $range; - - // make sure cells are created - - // get the cells in the range - $aReferences = Coordinate::extractAllCellReferencesInRange($range); + $firstRow = (int) $matches[2]; + $lastRow = (int) $matches[4]; + $firstColumn = $matches[1]; + $lastColumn = $matches[3]; + $firstColumnIndex = Coordinate::columnIndexFromString($firstColumn); + $lastColumnIndex = Coordinate::columnIndexFromString($lastColumn); + $numberRows = $lastRow - $firstRow; + $numberColumns = $lastColumnIndex - $firstColumnIndex; // create upper left cell if it does not already exist - $upperLeft = $aReferences[0]; + $upperLeft = "$firstColumn$firstRow"; if (!$this->cellExists($upperLeft)) { $this->getCell($upperLeft)->setValueExplicit(null, DataType::TYPE_NULL); } // Blank out the rest of the cells in the range (if they exist) - $count = count($aReferences); - for ($i = 1; $i < $count; ++$i) { - if ($this->cellExists($aReferences[$i])) { - $this->getCell($aReferences[$i])->setValueExplicit(null, DataType::TYPE_NULL); - } + if ($numberRows > $numberColumns) { + $this->clearMergeCellsByColumn($firstColumn, $lastColumn, $firstRow, $lastRow, $upperLeft); + } else { + $this->clearMergeCellsByRow($firstColumn, $lastColumnIndex, $firstRow, $lastRow, $upperLeft); } } else { throw new Exception('Merge must be set on a range of cells.'); @@ -1718,6 +1733,47 @@ class Worksheet implements IComparable return $this; } + private function clearMergeCellsByColumn(string $firstColumn, string $lastColumn, int $firstRow, int $lastRow, string $upperLeft): void + { + foreach ($this->getColumnIterator($firstColumn, $lastColumn) as $column) { + $iterator = $column->getCellIterator($firstRow); + $iterator->setIterateOnlyExistingCells(true); + foreach ($iterator as $cell) { + if ($cell !== null) { + $row = $cell->getRow(); + if ($row > $lastRow) { + break; + } + $thisCell = $cell->getColumn() . $row; + if ($upperLeft !== $thisCell) { + $cell->setValueExplicit(null, DataType::TYPE_NULL); + } + } + } + } + } + + private function clearMergeCellsByRow(string $firstColumn, int $lastColumnIndex, int $firstRow, int $lastRow, string $upperLeft): void + { + foreach ($this->getRowIterator($firstRow, $lastRow) as $row) { + $iterator = $row->getCellIterator($firstColumn); + $iterator->setIterateOnlyExistingCells(true); + foreach ($iterator as $cell) { + if ($cell !== null) { + $column = $cell->getColumn(); + $columnIndex = Coordinate::columnIndexFromString($column); + if ($columnIndex > $lastColumnIndex) { + break; + } + $thisCell = $column . $cell->getRow(); + if ($upperLeft !== $thisCell) { + $cell->setValueExplicit(null, DataType::TYPE_NULL); + } + } + } + } + } + /** * Set merge on a cell range by using numeric cell coordinates. * @@ -2101,6 +2157,7 @@ class Worksheet implements IComparable throw new Exception('Rows to be deleted should at least start from row 1.'); } + $holdRowDimensions = $this->removeRowDimensions($row, $numberOfRows); $highestRow = $this->getHighestDataRow(); $removedRowsCounter = 0; @@ -2118,9 +2175,30 @@ class Worksheet implements IComparable --$highestRow; } + $this->rowDimensions = $holdRowDimensions; + return $this; } + private function removeRowDimensions(int $row, int $numberOfRows): array + { + $highRow = $row + $numberOfRows - 1; + $holdRowDimensions = []; + foreach ($this->rowDimensions as $rowDimension) { + $num = $rowDimension->getRowIndex(); + if ($num < $row) { + $holdRowDimensions[$num] = $rowDimension; + } elseif ($num > $highRow) { + $num -= $numberOfRows; + $cloneDimension = clone $rowDimension; + $cloneDimension->setRowIndex($num); + $holdRowDimensions[$num] = $cloneDimension; + } + } + + return $holdRowDimensions; + } + /** * Remove a column, updating all possible related data. * @@ -2143,6 +2221,8 @@ class Worksheet implements IComparable return $this; } + $holdColumnDimensions = $this->removeColumnDimensions($pColumnIndex, $numberOfColumns); + $column = Coordinate::stringFromColumnIndex($pColumnIndex + $numberOfColumns); $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore($column . '1', -$numberOfColumns, 0, $this); @@ -2154,11 +2234,33 @@ class Worksheet implements IComparable $highestColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($highestColumn) - 1); } + $this->columnDimensions = $holdColumnDimensions; + $this->garbageCollect(); return $this; } + private function removeColumnDimensions(int $pColumnIndex, int $numberOfColumns): array + { + $highCol = $pColumnIndex + $numberOfColumns - 1; + $holdColumnDimensions = []; + foreach ($this->columnDimensions as $columnDimension) { + $num = $columnDimension->getColumnNumeric(); + if ($num < $pColumnIndex) { + $str = $columnDimension->getColumnIndex(); + $holdColumnDimensions[$str] = $columnDimension; + } elseif ($num > $highCol) { + $cloneDimension = clone $columnDimension; + $cloneDimension->setColumnNumeric($num - $numberOfColumns); + $str = $cloneDimension->getColumnIndex(); + $holdColumnDimensions[$str] = $cloneDimension; + } + } + + return $holdColumnDimensions; + } + /** * Remove a column, updating all possible related data. * diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index 2387ceb06..979d3cb74 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -433,6 +433,7 @@ class Worksheet extends BIFFwriter } else { switch ($cell->getDatatype()) { case DataType::TYPE_STRING: + case DataType::TYPE_INLINE: case DataType::TYPE_NULL: if ($cVal === '' || $cVal === null) { $this->writeBlank($row, $column, $xfIndex); diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index 494dc70ac..ab390a904 100644 --- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -205,10 +205,10 @@ class Worksheet extends WriterPart // Zoom scales if ($worksheet->getSheetView()->getZoomScale() != 100) { - $objWriter->writeAttribute('zoomScale', $worksheet->getSheetView()->getZoomScale()); + $objWriter->writeAttribute('zoomScale', (string) $worksheet->getSheetView()->getZoomScale()); } if ($worksheet->getSheetView()->getZoomScaleNormal() != 100) { - $objWriter->writeAttribute('zoomScaleNormal', $worksheet->getSheetView()->getZoomScaleNormal()); + $objWriter->writeAttribute('zoomScaleNormal', (string) $worksheet->getSheetView()->getZoomScaleNormal()); } // Show zeros (Excel also writes this attribute only if set to false) @@ -468,21 +468,63 @@ class Worksheet extends WriterPart private static function writeOtherCondElements(XMLWriter $objWriter, Conditional $conditional, string $cellCoordinate): void { + $conditions = $conditional->getConditions(); if ( $conditional->getConditionType() == Conditional::CONDITION_CELLIS - || $conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT || $conditional->getConditionType() == Conditional::CONDITION_EXPRESSION + || !empty($conditions) ) { - foreach ($conditional->getConditions() as $formula) { + foreach ($conditions as $formula) { // Formula $objWriter->writeElement('formula', Xlfn::addXlfn($formula)); } - } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSBLANKS) { - // formula copied from ms xlsx xml source file - $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))=0'); - } elseif ($conditional->getConditionType() == Conditional::CONDITION_NOTCONTAINSBLANKS) { - // formula copied from ms xlsx xml source file - $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))>0'); + } else { + if ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSBLANKS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))=0'); + } elseif ($conditional->getConditionType() == Conditional::CONDITION_NOTCONTAINSBLANKS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))>0'); + } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSERRORS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'ISERROR(' . $cellCoordinate . ')'); + } elseif ($conditional->getConditionType() == Conditional::CONDITION_NOTCONTAINSERRORS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'NOT(ISERROR(' . $cellCoordinate . '))'); + } + } + } + + private static function writeTimePeriodCondElements(XMLWriter $objWriter, Conditional $conditional, string $cellCoordinate): void + { + $txt = $conditional->getText(); + if ($txt !== null) { + $objWriter->writeAttribute('timePeriod', $txt); + if (empty($conditional->getConditions())) { + if ($conditional->getOperatorType() == Conditional::TIMEPERIOD_TODAY) { + $objWriter->writeElement('formula', 'FLOOR(' . $cellCoordinate . ')=TODAY()'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_TOMORROW) { + $objWriter->writeElement('formula', 'FLOOR(' . $cellCoordinate . ')=TODAY()+1'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_YESTERDAY) { + $objWriter->writeElement('formula', 'FLOOR(' . $cellCoordinate . ')=TODAY()-1'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_LAST_7_DAYS) { + $objWriter->writeElement('formula', 'AND(TODAY()-FLOOR(' . $cellCoordinate . ',1)<=6,FLOOR(' . $cellCoordinate . ',1)<=TODAY())'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_LAST_WEEK) { + $objWriter->writeElement('formula', 'AND(TODAY()-ROUNDDOWN(' . $cellCoordinate . ',0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(' . $cellCoordinate . ',0)<(WEEKDAY(TODAY())+7))'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_THIS_WEEK) { + $objWriter->writeElement('formula', 'AND(TODAY()-ROUNDDOWN(' . $cellCoordinate . ',0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(' . $cellCoordinate . ',0)-TODAY()<=7-WEEKDAY(TODAY()))'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_NEXT_WEEK) { + $objWriter->writeElement('formula', 'AND(ROUNDDOWN(' . $cellCoordinate . ',0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(' . $cellCoordinate . ',0)-TODAY()<(15-WEEKDAY(TODAY())))'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_LAST_MONTH) { + $objWriter->writeElement('formula', 'AND(MONTH(' . $cellCoordinate . ')=MONTH(EDATE(TODAY(),0-1)),YEAR(' . $cellCoordinate . ')=YEAR(EDATE(TODAY(),0-1)))'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_THIS_MONTH) { + $objWriter->writeElement('formula', 'AND(MONTH(' . $cellCoordinate . ')=MONTH(TODAY()),YEAR(' . $cellCoordinate . ')=YEAR(TODAY()))'); + } elseif ($conditional->getOperatorType() == Conditional::TIMEPERIOD_NEXT_MONTH) { + $objWriter->writeElement('formula', 'AND(MONTH(' . $cellCoordinate . ')=MONTH(EDATE(TODAY(),0+1)),YEAR(' . $cellCoordinate . ')=YEAR(EDATE(TODAY(),0+1)))'); + } + } else { + $objWriter->writeElement('formula', $conditional->getConditions()[0]); + } } } @@ -491,14 +533,18 @@ class Worksheet extends WriterPart $txt = $conditional->getText(); if ($txt !== null) { $objWriter->writeAttribute('text', $txt); - if ($conditional->getOperatorType() == Conditional::OPERATOR_CONTAINSTEXT) { - $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $txt . '",' . $cellCoordinate . ')))'); - } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_BEGINSWITH) { - $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($txt) . ')="' . $txt . '"'); - } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_ENDSWITH) { - $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($txt) . ')="' . $txt . '"'); - } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_NOTCONTAINS) { - $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $txt . '",' . $cellCoordinate . '))'); + if (empty($conditional->getConditions())) { + if ($conditional->getOperatorType() == Conditional::OPERATOR_CONTAINSTEXT) { + $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $txt . '",' . $cellCoordinate . ')))'); + } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_BEGINSWITH) { + $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',LEN("' . $txt . '"))="' . $txt . '"'); + } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_ENDSWITH) { + $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',LEN("' . $txt . '"))="' . $txt . '"'); + } elseif ($conditional->getOperatorType() == Conditional::OPERATOR_NOTCONTAINS) { + $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $txt . '",' . $cellCoordinate . '))'); + } + } else { + $objWriter->writeElement('formula', $conditional->getConditions()[0]); } } } @@ -601,57 +647,63 @@ class Worksheet extends WriterPart // Loop through styles in the current worksheet foreach ($worksheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { + $objWriter->startElement('conditionalFormatting'); + $objWriter->writeAttribute('sqref', $cellCoordinate); + foreach ($conditionalStyles as $conditional) { // WHY was this again? // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') { // continue; // } - if ($conditional->getConditionType() != Conditional::CONDITION_NONE) { - // conditionalFormatting - $objWriter->startElement('conditionalFormatting'); - $objWriter->writeAttribute('sqref', $cellCoordinate); + // cfRule + $objWriter->startElement('cfRule'); + $objWriter->writeAttribute('type', $conditional->getConditionType()); + self::writeAttributeIf( + $objWriter, + ($conditional->getConditionType() != Conditional::CONDITION_DATABAR), + 'dxfId', + (string) $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) + ); + $objWriter->writeAttribute('priority', $id++); - // cfRule - $objWriter->startElement('cfRule'); - $objWriter->writeAttribute('type', $conditional->getConditionType()); - self::writeAttributeIf( - $objWriter, - ($conditional->getConditionType() != Conditional::CONDITION_DATABAR), - 'dxfId', - (string) $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) - ); - $objWriter->writeAttribute('priority', $id++); - - self::writeAttributeif( - $objWriter, - ( - $conditional->getConditionType() === Conditional::CONDITION_CELLIS - || $conditional->getConditionType() === Conditional::CONDITION_CONTAINSTEXT - || $conditional->getConditionType() === Conditional::CONDITION_NOTCONTAINSTEXT - ) && $conditional->getOperatorType() !== Conditional::OPERATOR_NONE, - 'operator', - $conditional->getOperatorType() - ); - - self::writeAttributeIf($objWriter, $conditional->getStopIfTrue(), 'stopIfTrue', '1'); - - if ( - $conditional->getConditionType() === Conditional::CONDITION_CONTAINSTEXT + self::writeAttributeif( + $objWriter, + ( + $conditional->getConditionType() === Conditional::CONDITION_CELLIS + || $conditional->getConditionType() === Conditional::CONDITION_CONTAINSTEXT || $conditional->getConditionType() === Conditional::CONDITION_NOTCONTAINSTEXT - ) { - self::writeTextCondElements($objWriter, $conditional, $cellCoordinate); - } else { - self::writeOtherCondElements($objWriter, $conditional, $cellCoordinate); - } + || $conditional->getConditionType() === Conditional::CONDITION_BEGINSWITH + || $conditional->getConditionType() === Conditional::CONDITION_ENDSWITH + ) && $conditional->getOperatorType() !== Conditional::OPERATOR_NONE, + 'operator', + $conditional->getOperatorType() + ); - // - self::writeDataBarElements($objWriter, $conditional->getDataBar()); + self::writeAttributeIf($objWriter, $conditional->getStopIfTrue(), 'stopIfTrue', '1'); - $objWriter->endElement(); //end cfRule + $cellRange = Coordinate::splitRange(str_replace('$', '', strtoupper($cellCoordinate))); + [$topLeftCell] = $cellRange[0]; - $objWriter->endElement(); + if ( + $conditional->getConditionType() === Conditional::CONDITION_CONTAINSTEXT + || $conditional->getConditionType() === Conditional::CONDITION_NOTCONTAINSTEXT + || $conditional->getConditionType() === Conditional::CONDITION_BEGINSWITH + || $conditional->getConditionType() === Conditional::CONDITION_ENDSWITH + ) { + self::writeTextCondElements($objWriter, $conditional, $topLeftCell); + } elseif ($conditional->getConditionType() === Conditional::CONDITION_TIMEPERIOD) { + self::writeTimePeriodCondElements($objWriter, $conditional, $topLeftCell); + } else { + self::writeOtherCondElements($objWriter, $conditional, $topLeftCell); } + + // + self::writeDataBarElements($objWriter, $conditional->getDataBar()); + + $objWriter->endElement(); //end cfRule } + + $objWriter->endElement(); //end conditionalFormatting } } @@ -1137,10 +1189,12 @@ class Worksheet extends WriterPart { $objWriter->writeAttribute('t', $mappedType); if (!$cellValue instanceof RichText) { + $objWriter->startElement('is'); $objWriter->writeElement( 't', StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue, Settings::htmlEntityFlags())) ); + $objWriter->endElement(); } elseif ($cellValue instanceof RichText) { $objWriter->startElement('is'); $this->getParentWriter()->getWriterPartstringtable()->writeRichText($objWriter, $cellValue); diff --git a/vendor/services.php b/vendor/services.php index e6056e741..29c0a5fa3 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php index 5fef51184..362dd1a95 100644 --- a/vendor/symfony/polyfill-php80/Php80.php +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -100,6 +100,16 @@ final class Php80 public static function str_ends_with(string $haystack, string $needle): bool { - return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle))); + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); } } diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 000000000..fe6e69105 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 000000000..72f10812b --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,7 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Nicolas Grekas + * + * @internal + */ +final class MysqliCaster +{ + public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested): array + { + foreach ($a as $k => $v) { + if (isset($c->$k)) { + $a[$k] = $c->$k; + } + } + + return $a; + } +} diff --git a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index eeac88295..d2e5039b8 100644 --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -144,6 +144,8 @@ abstract class AbstractCloner implements ClonerInterface 'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'], 'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'], + 'mysqli_driver' => ['Symfony\Component\VarDumper\Caster\MysqliCaster', 'castMysqliDriver'], + 'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], ':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 8409a0c74..88e5ba928 100644 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -978,7 +978,7 @@ EOHTML } $this->lastDepth = $depth; - $this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8'); + $this->line = mb_encode_numericentity($this->line, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8'); if (-1 === $depth) { AbstractDumper::dumpLine(0); diff --git a/vendor/symfony/var-dumper/LICENSE b/vendor/symfony/var-dumper/LICENSE index c1f0aac1c..a843ec124 100644 --- a/vendor/symfony/var-dumper/LICENSE +++ b/vendor/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2021 Fabien Potencier +Copyright (c) 2014-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/topthink/think-orm/src/db/Raw.php b/vendor/topthink/think-orm/src/db/Raw.php index 833fbf08c..b956ff690 100644 --- a/vendor/topthink/think-orm/src/db/Raw.php +++ b/vendor/topthink/think-orm/src/db/Raw.php @@ -64,8 +64,4 @@ class Raw return $this->bind; } - public function __toString() - { - return (string) $this->value; - } }