-
\ No newline at end of file
diff --git a/public/userarea/photos_popup.php b/public/userarea/photos_popup.php
deleted file mode 100644
index e84019c..0000000
--- a/public/userarea/photos_popup.php
+++ /dev/null
@@ -1,428 +0,0 @@
-
-
-
-
-load();
-} catch (Exception $e) {
- error_log("Errore nel caricamento del file .env: " . $e->getMessage());
-?>
-
-
Errore: Impossibile caricare il file di configurazione.
-
-
-
-
Errore: Variabile BASE_URL non definita.
-
-getConnection();
-
-// Verifica che almeno uno degli ID sia passato
-$iddatadb = isset($_GET['iddatadb']) && !empty($_GET['iddatadb']) ? intval($_GET['iddatadb']) : null;
-$idquotations = isset($_GET['idquotations']) && !empty($_GET['idquotations']) ? intval($_GET['idquotations']) : null;
-
-if (!$iddatadb && !$idquotations) {
- error_log("Errore: ID riga o ID quotations non fornito");
-?>
-
-
Errore: ID riga o ID quotations non fornito.
-
-
-
-
Errore: Non è possibile specificare sia iddatadb che idquotations.
-
- prepare("SELECT {$paramName}, {$field} FROM {$table} WHERE {$paramName} = ?");
- $stmt->execute([$paramValue]);
- $row = $stmt->fetch(PDO::FETCH_ASSOC);
-
- if (!$row) {
- error_log("Errore: Riga non trovata per {$paramName} = {$paramValue}");
- ?>
-
-
Errore: Riga non trovata.
-
- getMessage());
- ?>
-
-
Errore: Impossibile recuperare i dettagli della riga.
-
-prepare("SELECT id, file_path, file_name, description, uploaded_at FROM {$photoTable} WHERE {$photoParamName} = ? ORDER BY uploaded_at DESC");
- $stmt->execute([$paramValue]);
- $photos = $stmt->fetchAll(PDO::FETCH_ASSOC);
-} catch (Exception $e) {
- error_log("Errore query foto: " . $e->getMessage());
- $photos = []; // Imposta array vuoto in caso di errore
-}
-
-// Definisci il percorso base per le foto
-$photoBasePath = '../photostrf/';
-
-// Usa la variabile d'ambiente BASE_URL
-$baseUrl = rtrim($_ENV['BASE_URL'], '/');
-$uploadUrl = $iddatadb
- ? $baseUrl . "/upload_photos_mobile.php?iddatadb=" . $iddatadb
- : $baseUrl . "/upload_photos_mobile.php?idquotations=" . $idquotations;
-
-// Genera il QR code con endroid/qr-code 6.0.6
-$qrCodeDir = '../photostrf/qrcodes/';
-if (!is_dir($qrCodeDir)) {
- mkdir($qrCodeDir, 0755, true);
-}
-$qrCodeFile = $qrCodeDir . "qrcode_{$id}.png";
-
-$writer = new PngWriter();
-$qrCode = new QrCode(
- data: $uploadUrl,
- encoding: new Encoding('UTF-8'),
- errorCorrectionLevel: ErrorCorrectionLevel::Low,
- size: 150,
- margin: 10,
- roundBlockSizeMode: RoundBlockSizeMode::Margin,
- foregroundColor: new Color(0, 0, 0),
- backgroundColor: new Color(255, 255, 255)
-);
-
-$result = $writer->write($qrCode);
-$result->saveToFile($qrCodeFile);
-?>
-
-
-
-
-
-
Caricamento in corso...
-
-
-
Manage Photos
-
ID: = htmlspecialchars($id) ?>
-
Code: = htmlspecialchars($code) ?>
-
-
-
-
Scan the QR Code with the mobile to take photo with camera:
- Are you sure you want to delete this template?
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 5d5afaa..167db80 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -14,10 +14,7 @@ if (PHP_VERSION_ID < 50600) {
echo $err;
}
}
- trigger_error(
- $err,
- E_USER_ERROR
- );
+ throw new RuntimeException($err);
}
require_once __DIR__ . '/composer/autoload_real.php';
diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
index 51e734a..2052022 100644
--- a/vendor/composer/InstalledVersions.php
+++ b/vendor/composer/InstalledVersions.php
@@ -26,12 +26,23 @@ use Composer\Semver\VersionParser;
*/
class InstalledVersions
{
+ /**
+ * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
+ * @internal
+ */
+ private static $selfDir = null;
+
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
*/
private static $installed;
+ /**
+ * @var bool
+ */
+ private static $installedIsLocalDir;
+
/**
* @var bool|null
*/
@@ -309,6 +320,24 @@ class InstalledVersions
{
self::$installed = $data;
self::$installedByVendor = array();
+
+ // when using reload, we disable the duplicate protection to ensure that self::$installed data is
+ // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
+ // so we have to assume it does not, and that may result in duplicate data being returned when listing
+ // all installed packages for example
+ self::$installedIsLocalDir = false;
+ }
+
+ /**
+ * @return string
+ */
+ private static function getSelfDir()
+ {
+ if (self::$selfDir === null) {
+ self::$selfDir = strtr(__DIR__, '\\', '/');
+ }
+
+ return self::$selfDir;
}
/**
@@ -322,19 +351,27 @@ class InstalledVersions
}
$installed = array();
+ $copiedLocalDir = false;
if (self::$canGetVendors) {
+ $selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ $vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
$required = require $vendorDir.'/composer/installed.php';
- $installed[] = self::$installedByVendor[$vendorDir] = $required;
- if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
- self::$installed = $installed[count($installed) - 1];
+ self::$installedByVendor[$vendorDir] = $required;
+ $installed[] = $required;
+ if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
+ self::$installed = $required;
+ self::$installedIsLocalDir = true;
}
}
+ if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
+ $copiedLocalDir = true;
+ }
}
}
@@ -350,7 +387,7 @@ class InstalledVersions
}
}
- if (self::$installed !== array()) {
+ if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 69f2620..601d0eb 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -5303,6 +5303,8 @@ return array(
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalDataBarExtension' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalFormatValueObject' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalFormattingRuleExtension' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php',
+ 'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalIconSet' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalIconSet.php',
+ 'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\IconSetValues' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/IconSetValues.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\StyleMerger' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\Wizard' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\Wizard\\Blanks' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php',
@@ -5400,6 +5402,7 @@ return array(
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Dompdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Mpdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Tcpdf' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php',
+ 'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\TcpdfNoDie' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/TcpdfNoDie.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\CellDataValidation' => $vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/CellDataValidation.php',
@@ -6314,6 +6317,52 @@ return array(
'SebastianBergmann\\Type\\UnknownType' => $vendorDir . '/sebastian/type/src/type/UnknownType.php',
'SebastianBergmann\\Type\\VoidType' => $vendorDir . '/sebastian/type/src/type/VoidType.php',
'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php',
+ 'Smalot\\PdfParser\\Config' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Config.php',
+ 'Smalot\\PdfParser\\Document' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Document.php',
+ 'Smalot\\PdfParser\\Element' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element.php',
+ 'Smalot\\PdfParser\\Element\\ElementArray' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementArray.php',
+ 'Smalot\\PdfParser\\Element\\ElementBoolean' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementBoolean.php',
+ 'Smalot\\PdfParser\\Element\\ElementDate' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementDate.php',
+ 'Smalot\\PdfParser\\Element\\ElementHexa' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementHexa.php',
+ 'Smalot\\PdfParser\\Element\\ElementMissing' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementMissing.php',
+ 'Smalot\\PdfParser\\Element\\ElementName' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementName.php',
+ 'Smalot\\PdfParser\\Element\\ElementNull' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementNull.php',
+ 'Smalot\\PdfParser\\Element\\ElementNumeric' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementNumeric.php',
+ 'Smalot\\PdfParser\\Element\\ElementString' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementString.php',
+ 'Smalot\\PdfParser\\Element\\ElementStruct' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementStruct.php',
+ 'Smalot\\PdfParser\\Element\\ElementXRef' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementXRef.php',
+ 'Smalot\\PdfParser\\Encoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\AbstractEncoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/AbstractEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\EncodingLocator' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/EncodingLocator.php',
+ 'Smalot\\PdfParser\\Encoding\\ISOLatin1Encoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/ISOLatin1Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\ISOLatin9Encoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/ISOLatin9Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\MacRomanEncoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/MacRomanEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\PDFDocEncoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/PDFDocEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\PostScriptGlyphs' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/PostScriptGlyphs.php',
+ 'Smalot\\PdfParser\\Encoding\\StandardEncoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/StandardEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\WinAnsiEncoding' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/WinAnsiEncoding.php',
+ 'Smalot\\PdfParser\\Exception\\EmptyPdfException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/EmptyPdfException.php',
+ 'Smalot\\PdfParser\\Exception\\EncodingNotFoundException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/EncodingNotFoundException.php',
+ 'Smalot\\PdfParser\\Exception\\InvalidDictionaryObjectException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/InvalidDictionaryObjectException.php',
+ 'Smalot\\PdfParser\\Exception\\MissingCatalogException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/MissingCatalogException.php',
+ 'Smalot\\PdfParser\\Exception\\MissingPdfHeaderException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/MissingPdfHeaderException.php',
+ 'Smalot\\PdfParser\\Exception\\NotImplementedException' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/NotImplementedException.php',
+ 'Smalot\\PdfParser\\Font' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font.php',
+ 'Smalot\\PdfParser\\Font\\FontCIDFontType0' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontCIDFontType0.php',
+ 'Smalot\\PdfParser\\Font\\FontCIDFontType2' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontCIDFontType2.php',
+ 'Smalot\\PdfParser\\Font\\FontTrueType' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontTrueType.php',
+ 'Smalot\\PdfParser\\Font\\FontType0' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType0.php',
+ 'Smalot\\PdfParser\\Font\\FontType1' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType1.php',
+ 'Smalot\\PdfParser\\Font\\FontType3' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType3.php',
+ 'Smalot\\PdfParser\\Header' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Header.php',
+ 'Smalot\\PdfParser\\PDFObject' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php',
+ 'Smalot\\PdfParser\\Page' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Page.php',
+ 'Smalot\\PdfParser\\Pages' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Pages.php',
+ 'Smalot\\PdfParser\\Parser' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/Parser.php',
+ 'Smalot\\PdfParser\\RawData\\FilterHelper' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/RawData/FilterHelper.php',
+ 'Smalot\\PdfParser\\RawData\\RawDataParser' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/RawData/RawDataParser.php',
+ 'Smalot\\PdfParser\\XObject\\Form' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/XObject/Form.php',
+ 'Smalot\\PdfParser\\XObject\\Image' => $vendorDir . '/smalot/pdfparser/src/Smalot/PdfParser/XObject/Image.php',
'SocialiteProviders\\Manager\\Config' => $vendorDir . '/socialiteproviders/manager/src/Config.php',
'SocialiteProviders\\Manager\\ConfigTrait' => $vendorDir . '/socialiteproviders/manager/src/ConfigTrait.php',
'SocialiteProviders\\Manager\\Contracts\\ConfigInterface' => $vendorDir . '/socialiteproviders/manager/src/Contracts/ConfigInterface.php',
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
index 5dcae5d..58426dd 100644
--- a/vendor/composer/autoload_namespaces.php
+++ b/vendor/composer/autoload_namespaces.php
@@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
return array(
'Webpatser\\Countries' => array($vendorDir . '/webpatser/laravel-countries/src'),
+ 'Smalot\\PdfParser\\' => array($vendorDir . '/smalot/pdfparser/src'),
'Detection' => array($vendorDir . '/mobiledetect/mobiledetectlib/namespaced'),
'Barryvdh' => array($vendorDir . '/barryvdh/reflection-docblock/src'),
);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index 98a2b36..89947f5 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -8,7 +8,7 @@ $baseDir = dirname($vendorDir);
return array(
'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'),
'phpseclib3\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
- 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
+ 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-common/src'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'Whoops\\' => array($vendorDir . '/filp/whoops/src/Whoops'),
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
@@ -55,8 +55,8 @@ return array(
'Spatie\\QueryBuilder\\Database\\Factories\\' => array($vendorDir . '/spatie/laravel-query-builder/database/factories'),
'Spatie\\QueryBuilder\\' => array($vendorDir . '/spatie/laravel-query-builder/src'),
'Spatie\\LaravelPackageTools\\' => array($vendorDir . '/spatie/laravel-package-tools/src'),
- 'Spatie\\LaravelIgnition\\' => array($vendorDir . '/spatie/error-solutions/legacy/laravel-ignition', $vendorDir . '/spatie/laravel-ignition/src'),
- 'Spatie\\Ignition\\' => array($vendorDir . '/spatie/error-solutions/legacy/ignition', $vendorDir . '/spatie/ignition/src'),
+ 'Spatie\\LaravelIgnition\\' => array($vendorDir . '/spatie/laravel-ignition/src', $vendorDir . '/spatie/error-solutions/legacy/laravel-ignition'),
+ 'Spatie\\Ignition\\' => array($vendorDir . '/spatie/ignition/src', $vendorDir . '/spatie/error-solutions/legacy/ignition'),
'Spatie\\FlareClient\\' => array($vendorDir . '/spatie/flare-client-php/src'),
'Spatie\\ErrorSolutions\\' => array($vendorDir . '/spatie/error-solutions/src'),
'Spatie\\Backtrace\\' => array($vendorDir . '/spatie/backtrace/src'),
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 2feeac8..6302cef 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -257,8 +257,8 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
),
'phpDocumentor\\Reflection\\' =>
array (
- 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
- 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
+ 0 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
+ 1 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
),
'ZipStream\\' =>
array (
@@ -446,13 +446,13 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
),
'Spatie\\LaravelIgnition\\' =>
array (
- 0 => __DIR__ . '/..' . '/spatie/error-solutions/legacy/laravel-ignition',
- 1 => __DIR__ . '/..' . '/spatie/laravel-ignition/src',
+ 0 => __DIR__ . '/..' . '/spatie/laravel-ignition/src',
+ 1 => __DIR__ . '/..' . '/spatie/error-solutions/legacy/laravel-ignition',
),
'Spatie\\Ignition\\' =>
array (
- 0 => __DIR__ . '/..' . '/spatie/error-solutions/legacy/ignition',
- 1 => __DIR__ . '/..' . '/spatie/ignition/src',
+ 0 => __DIR__ . '/..' . '/spatie/ignition/src',
+ 1 => __DIR__ . '/..' . '/spatie/error-solutions/legacy/ignition',
),
'Spatie\\FlareClient\\' =>
array (
@@ -805,6 +805,13 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
0 => __DIR__ . '/..' . '/webpatser/laravel-countries/src',
),
),
+ 'S' =>
+ array (
+ 'Smalot\\PdfParser\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/smalot/pdfparser/src',
+ ),
+ ),
'D' =>
array (
'Detection' =>
@@ -6119,6 +6126,8 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalDataBarExtension' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalFormatValueObject' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalFormattingRuleExtension' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php',
+ 'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\ConditionalIconSet' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalIconSet.php',
+ 'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\IconSetValues' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/IconSetValues.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\StyleMerger' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\Wizard' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php',
'PhpOffice\\PhpSpreadsheet\\Style\\ConditionalFormatting\\Wizard\\Blanks' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php',
@@ -6216,6 +6225,7 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Dompdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Mpdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\Tcpdf' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php',
+ 'PhpOffice\\PhpSpreadsheet\\Writer\\Pdf\\TcpdfNoDie' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/TcpdfNoDie.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\BIFFwriter' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php',
'PhpOffice\\PhpSpreadsheet\\Writer\\Xls\\CellDataValidation' => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/CellDataValidation.php',
@@ -7130,6 +7140,52 @@ class ComposerStaticInitc91cd9c5b1e6a9e8573a14b799ea9342
'SebastianBergmann\\Type\\UnknownType' => __DIR__ . '/..' . '/sebastian/type/src/type/UnknownType.php',
'SebastianBergmann\\Type\\VoidType' => __DIR__ . '/..' . '/sebastian/type/src/type/VoidType.php',
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
+ 'Smalot\\PdfParser\\Config' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Config.php',
+ 'Smalot\\PdfParser\\Document' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Document.php',
+ 'Smalot\\PdfParser\\Element' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element.php',
+ 'Smalot\\PdfParser\\Element\\ElementArray' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementArray.php',
+ 'Smalot\\PdfParser\\Element\\ElementBoolean' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementBoolean.php',
+ 'Smalot\\PdfParser\\Element\\ElementDate' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementDate.php',
+ 'Smalot\\PdfParser\\Element\\ElementHexa' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementHexa.php',
+ 'Smalot\\PdfParser\\Element\\ElementMissing' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementMissing.php',
+ 'Smalot\\PdfParser\\Element\\ElementName' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementName.php',
+ 'Smalot\\PdfParser\\Element\\ElementNull' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementNull.php',
+ 'Smalot\\PdfParser\\Element\\ElementNumeric' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementNumeric.php',
+ 'Smalot\\PdfParser\\Element\\ElementString' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementString.php',
+ 'Smalot\\PdfParser\\Element\\ElementStruct' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementStruct.php',
+ 'Smalot\\PdfParser\\Element\\ElementXRef' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Element/ElementXRef.php',
+ 'Smalot\\PdfParser\\Encoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\AbstractEncoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/AbstractEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\EncodingLocator' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/EncodingLocator.php',
+ 'Smalot\\PdfParser\\Encoding\\ISOLatin1Encoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/ISOLatin1Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\ISOLatin9Encoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/ISOLatin9Encoding.php',
+ 'Smalot\\PdfParser\\Encoding\\MacRomanEncoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/MacRomanEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\PDFDocEncoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/PDFDocEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\PostScriptGlyphs' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/PostScriptGlyphs.php',
+ 'Smalot\\PdfParser\\Encoding\\StandardEncoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/StandardEncoding.php',
+ 'Smalot\\PdfParser\\Encoding\\WinAnsiEncoding' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Encoding/WinAnsiEncoding.php',
+ 'Smalot\\PdfParser\\Exception\\EmptyPdfException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/EmptyPdfException.php',
+ 'Smalot\\PdfParser\\Exception\\EncodingNotFoundException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/EncodingNotFoundException.php',
+ 'Smalot\\PdfParser\\Exception\\InvalidDictionaryObjectException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/InvalidDictionaryObjectException.php',
+ 'Smalot\\PdfParser\\Exception\\MissingCatalogException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/MissingCatalogException.php',
+ 'Smalot\\PdfParser\\Exception\\MissingPdfHeaderException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/MissingPdfHeaderException.php',
+ 'Smalot\\PdfParser\\Exception\\NotImplementedException' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Exception/NotImplementedException.php',
+ 'Smalot\\PdfParser\\Font' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font.php',
+ 'Smalot\\PdfParser\\Font\\FontCIDFontType0' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontCIDFontType0.php',
+ 'Smalot\\PdfParser\\Font\\FontCIDFontType2' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontCIDFontType2.php',
+ 'Smalot\\PdfParser\\Font\\FontTrueType' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontTrueType.php',
+ 'Smalot\\PdfParser\\Font\\FontType0' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType0.php',
+ 'Smalot\\PdfParser\\Font\\FontType1' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType1.php',
+ 'Smalot\\PdfParser\\Font\\FontType3' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Font/FontType3.php',
+ 'Smalot\\PdfParser\\Header' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Header.php',
+ 'Smalot\\PdfParser\\PDFObject' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/PDFObject.php',
+ 'Smalot\\PdfParser\\Page' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Page.php',
+ 'Smalot\\PdfParser\\Pages' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Pages.php',
+ 'Smalot\\PdfParser\\Parser' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/Parser.php',
+ 'Smalot\\PdfParser\\RawData\\FilterHelper' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/RawData/FilterHelper.php',
+ 'Smalot\\PdfParser\\RawData\\RawDataParser' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/RawData/RawDataParser.php',
+ 'Smalot\\PdfParser\\XObject\\Form' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/XObject/Form.php',
+ 'Smalot\\PdfParser\\XObject\\Image' => __DIR__ . '/..' . '/smalot/pdfparser/src/Smalot/PdfParser/XObject/Image.php',
'SocialiteProviders\\Manager\\Config' => __DIR__ . '/..' . '/socialiteproviders/manager/src/Config.php',
'SocialiteProviders\\Manager\\ConfigTrait' => __DIR__ . '/..' . '/socialiteproviders/manager/src/ConfigTrait.php',
'SocialiteProviders\\Manager\\Contracts\\ConfigInterface' => __DIR__ . '/..' . '/socialiteproviders/manager/src/Contracts/ConfigInterface.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 670e46b..97a9efe 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -5464,17 +5464,17 @@
},
{
"name": "phpoffice/phpspreadsheet",
- "version": "4.1.0",
- "version_normalized": "4.1.0.0",
+ "version": "5.2.0",
+ "version_normalized": "5.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
- "reference": "6ff18c3a8df3a945492f75ce455d77f7ad55dd5c"
+ "reference": "3b8994b3aac4b61018bc04fc8c441f4fd68c18eb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/6ff18c3a8df3a945492f75ce455d77f7ad55dd5c",
- "reference": "6ff18c3a8df3a945492f75ce455d77f7ad55dd5c",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3b8994b3aac4b61018bc04fc8c441f4fd68c18eb",
+ "reference": "3b8994b3aac4b61018bc04fc8c441f4fd68c18eb",
"shasum": ""
},
"require": {
@@ -5504,23 +5504,24 @@
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
- "mitoteam/jpgraph": "^10.3",
+ "mitoteam/jpgraph": "^10.5",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
- "phpstan/phpstan": "^1.1",
- "phpstan/phpstan-phpunit": "^1.0",
+ "phpstan/phpstan": "^1.1 || ^2.0",
+ "phpstan/phpstan-deprecation-rules": "^1.0 || ^2.0",
+ "phpstan/phpstan-phpunit": "^1.0 || ^2.0",
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
- "ext-intl": "PHP Internationalization Functions",
+ "ext-intl": "PHP Internationalization Functions, regquired for NumberFormat Wizard",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
- "time": "2025-03-02T06:52:24+00:00",
+ "time": "2025-10-26T15:54:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -5566,7 +5567,7 @@
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
- "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/4.1.0"
+ "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/5.2.0"
},
"install-path": "../phpoffice/phpspreadsheet"
},
@@ -8107,6 +8108,60 @@
],
"install-path": "../sebastian/version"
},
+ {
+ "name": "smalot/pdfparser",
+ "version": "v2.12.1",
+ "version_normalized": "2.12.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/smalot/pdfparser.git",
+ "reference": "98d31ba34ef5b5a98897ef4b6c3925d502ea53b1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/smalot/pdfparser/zipball/98d31ba34ef5b5a98897ef4b6c3925d502ea53b1",
+ "reference": "98d31ba34ef5b5a98897ef4b6c3925d502ea53b1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-iconv": "*",
+ "ext-zlib": "*",
+ "php": ">=7.1",
+ "symfony/polyfill-mbstring": "^1.18"
+ },
+ "time": "2025-07-31T06:19:56+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Smalot\\PdfParser\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Sebastien MALOT",
+ "email": "sebastien@malot.fr"
+ }
+ ],
+ "description": "Pdf parser library. Can read and extract information from pdf file.",
+ "homepage": "https://www.pdfparser.org",
+ "keywords": [
+ "extract",
+ "parse",
+ "parser",
+ "pdf",
+ "text"
+ ],
+ "support": {
+ "issues": "https://github.com/smalot/pdfparser/issues",
+ "source": "https://github.com/smalot/pdfparser/tree/v2.12.1"
+ },
+ "install-path": "../smalot/pdfparser"
+ },
{
"name": "socialiteproviders/manager",
"version": "v4.8.1",
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 5833429..5ad65f2 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'loshmis/vanguard',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => 'baf3f6da32fd5bc669ac7360970be21407d1d384',
+ 'reference' => 'e75be99e43b28088315b19f86eee2e6869c7c844',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -688,7 +688,7 @@
'loshmis/vanguard' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => 'baf3f6da32fd5bc669ac7360970be21407d1d384',
+ 'reference' => 'e75be99e43b28088315b19f86eee2e6869c7c844',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -890,9 +890,9 @@
'dev_requirement' => false,
),
'phpoffice/phpspreadsheet' => array(
- 'pretty_version' => '4.1.0',
- 'version' => '4.1.0.0',
- 'reference' => '6ff18c3a8df3a945492f75ce455d77f7ad55dd5c',
+ 'pretty_version' => '5.2.0',
+ 'version' => '5.2.0.0',
+ 'reference' => '3b8994b3aac4b61018bc04fc8c441f4fd68c18eb',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
'aliases' => array(),
@@ -1295,6 +1295,15 @@
'aliases' => array(),
'dev_requirement' => true,
),
+ 'smalot/pdfparser' => array(
+ 'pretty_version' => 'v2.12.1',
+ 'version' => '2.12.1.0',
+ 'reference' => '98d31ba34ef5b5a98897ef4b6c3925d502ea53b1',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../smalot/pdfparser',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
'socialiteproviders/manager' => array(
'pretty_version' => 'v4.8.1',
'version' => '4.8.1.0',
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
index d515d34..8748439 100644
--- a/vendor/composer/platform_check.php
+++ b/vendor/composer/platform_check.php
@@ -23,8 +23,7 @@ if ($issues) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
- trigger_error(
- 'Composer detected issues in your platform: ' . implode(' ', $issues),
- E_USER_ERROR
+ throw new \RuntimeException(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}
diff --git a/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
index 1a5bc4e..4e36a8d 100644
--- a/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
+++ b/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
@@ -3,9 +3,9 @@
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).
+and this project adheres to [Semantic Versioning](https://semver.org). Thia is always true of the master branch. Some earlier branches remain supported and security fixes are applied to them; if the security fix represents a breaking change, it may have to be applied as a minor or patch version.
-## TBD - 4.2.0
+## TBD - 5.3.0
### Added
@@ -31,12 +31,182 @@ and this project adheres to [Semantic Versioning](https://semver.org).
- Nothing yet.
+## 2025-10-25 - 5.2.0
+
+### Added
+
+- This release should be usable with Php8.5 Release Candidates without deprecation messages.
+- Option to display numbers with less precision. [Issue #4626](https://github.com/PHPOffice/PhpSpreadsheet/issues/4626) [PR #4640](https://github.com/PHPOffice/PhpSpreadsheet/pull/4640)
+- Offer Tcpdf Interface which throws exception rather than die. [PR #4666](https://github.com/PHPOffice/PhpSpreadsheet/pull/4666)
+- Xls Reader ListWorksheetDimensions method. [PR #4689](https://github.com/PHPOffice/PhpSpreadsheet/pull/4689)
+
+### Deprecated
+
+- Worksheet::getHashInt serves no useful purpose. No replacement.
+- Spreadsheet::getId serves no useful purpose. No replacement.
+
+### Fixed
+
+- Performance improvement when working with large amounts of cells. [Issue #4607](https://github.com/PHPOffice/PhpSpreadsheet/issues/4607) [PR #4609](https://github.com/PHPOffice/PhpSpreadsheet/pull/4609)
+- Minor improvements to Calculation coverage. [PR #4624](https://github.com/PHPOffice/PhpSpreadsheet/pull/4624)
+- Conditional formatting in extLst. [Issue #4629](https://github.com/PHPOffice/PhpSpreadsheet/issues/4629) [PR #4633](https://github.com/PHPOffice/PhpSpreadsheet/pull/4633)
+- Php8.5 deprecates use of null as array index. [PR #4634](https://github.com/PHPOffice/PhpSpreadsheet/pull/4634)
+- Wrapped cells and default row height. [Issue #4584](https://github.com/PHPOffice/PhpSpreadsheet/issues/4584) [PR #4645](https://github.com/PHPOffice/PhpSpreadsheet/pull/4645)
+- For Php8.5, replace one of our two uses of `__wakeup` with `__unserialize`, and eliminate the other. [PR #4639](https://github.com/PHPOffice/PhpSpreadsheet/pull/4639)
+- Use prefix _xlfn for BASE function. [Issue #4638](https://github.com/PHPOffice/PhpSpreadsheet/issues/4638) [PR #4641](https://github.com/PHPOffice/PhpSpreadsheet/pull/4641)
+- Warning messages with corrupt Xls file. [Issue #4647](https://github.com/PHPOffice/PhpSpreadsheet/issues/4647) [PR #4648](https://github.com/PHPOffice/PhpSpreadsheet/pull/4648)
+- Additional support for union and intersection. [PR #4596](https://github.com/PHPOffice/PhpSpreadsheet/pull/4596)
+- Missing array keys x,o,v for Xml Reader. [Issue #4668](https://github.com/PHPOffice/PhpSpreadsheet/issues/4668) [PR #4669](https://github.com/PHPOffice/PhpSpreadsheet/pull/4669)
+- Missing array key x for Xlsx Reader VML. [Issue #4505](https://github.com/PHPOffice/PhpSpreadsheet/issues/4505) [PR #4676](https://github.com/PHPOffice/PhpSpreadsheet/pull/4676)
+- Better support for Style Alignment Read Order. [Issue #850](https://github.com/PHPOffice/PhpSpreadsheet/issues/850) [PR #4655](https://github.com/PHPOffice/PhpSpreadsheet/pull/4655)
+- More sophisticated workbook password algorithms (Xlsx only). [Issue #4673](https://github.com/PHPOffice/PhpSpreadsheet/issues/4673) [PR #4675](https://github.com/PHPOffice/PhpSpreadsheet/pull/4675)
+- Xls Writer fix DIMENSIONS record. [Issue #4682](https://github.com/PHPOffice/PhpSpreadsheet/issues/4682) [PR #4687](https://github.com/PHPOffice/PhpSpreadsheet/pull/4687)
+- Xls Reader listWorksheetInfo process MULRK records. [PR #4689](https://github.com/PHPOffice/PhpSpreadsheet/pull/4689)
+- Make Reader Xls Escher generic. [PR #4690](https://github.com/PHPOffice/PhpSpreadsheet/pull/4690)
+
+## 2025-09-03 - 5.1.0
+
+### Added
+
+- Add Conditional Formatting with IconSet (Xlsx only). [Issue #4560](https://github.com/PHPOffice/PhpSpreadsheet/issues/4560) [PR #4574](https://github.com/PHPOffice/PhpSpreadsheet/pull/4574)
+- Copy cell adjusting formula. [Issue #1203](https://github.com/PHPOffice/PhpSpreadsheet/issues/1203) [PR #4577](https://github.com/PHPOffice/PhpSpreadsheet/pull/4577)
+- splitRange and ProtectedRange. [Issue #1457](https://github.com/PHPOffice/PhpSpreadsheet/issues/1457) [PR #4580](https://github.com/PHPOffice/PhpSpreadsheet/pull/4580)
+- Option to create Blank Sheet if LoadSheetsOnly doesn't find any. [PR #4618](https://github.com/PHPOffice/PhpSpreadsheet/pull/4618)
+
+### Fixed
+
+- Google-only formulas exported from Google Sheets. [Issue #1637](https://github.com/PHPOffice/PhpSpreadsheet/issues/1637) [PR #4579](https://github.com/PHPOffice/PhpSpreadsheet/pull/4579)
+- Maximum column width. [PR #4581](https://github.com/PHPOffice/PhpSpreadsheet/pull/4581)
+- PrintArea after row/column delete. [Issue #2912](https://github.com/PHPOffice/PhpSpreadsheet/issues/2912) [PR #4598](https://github.com/PHPOffice/PhpSpreadsheet/pull/4598)
+- Remove deprecated imagedestroy call. [PR #4625](https://github.com/PHPOffice/PhpSpreadsheet/pull/4625)
+- Excel 2007 problem with newlines. [Issue #4619](https://github.com/PHPOffice/PhpSpreadsheet/issues/4619) [PR #4620](https://github.com/PHPOffice/PhpSpreadsheet/pull/4620)
+- Compatibility changes for Php 8.5. [PR #4601](https://github.com/PHPOffice/PhpSpreadsheet/pull/4601) [PR #4611](https://github.com/PHPOffice/PhpSpreadsheet/pull/4611)
+
+## 2025-08-10 - 5.0.0
+
+### Breaking Changes
+
+- Images will be loaded from an external source (e.g. http://example.com/img.png) only if the reader is explicitly set to allow it via `$reader->setAllowExternalImages(true)`. We do not believe that loading of external images is a widely used feature.
+- Deletion of items deprecated in Release 4. See "removed" below.
+- Move some properties from Base Reader to Html Reader. [PR #4551](https://github.com/PHPOffice/PhpSpreadsheet/pull/4551)
+- DefaultValueBinder will treat integers with more than 15 digits as strings. [Issue #4522](https://github.com/PHPOffice/PhpSpreadsheet/issues/4522) [PR #4527](https://github.com/PHPOffice/PhpSpreadsheet/pull/4527)
+
+### Removed
+
+- Theme public constants COLOR_SCHEME_2013_PLUS_NAME (use COLOR_SCHEME_2013_2022_NAME) and COLOR_SCHEME_2013_PLUS (use COLOR_SCHEME_2013_2022).
+
+### Fixed
+
+- Additional floating-point precision changes. [Issue #1324](https://github.com/PHPOffice/PhpSpreadsheet/issues/1324) [PR #4575](https://github.com/PHPOffice/PhpSpreadsheet/pull/4575)
+- Header/Footer images expand location. [Issue #484](https://github.com/PHPOffice/PhpSpreadsheet/issues/484) [Issue #1318](https://github.com/PHPOffice/PhpSpreadsheet/issues/1318) [PR #4572](https://github.com/PHPOffice/PhpSpreadsheet/pull/4572)
+- Create uninitialized cell if used in calculation. [Issue #4558](https://github.com/PHPOffice/PhpSpreadsheet/issues/4558) [Issue #4530](https://github.com/PHPOffice/PhpSpreadsheet/issues/4530) [PR #4565](https://github.com/PHPOffice/PhpSpreadsheet/pull/4565)
+- Shared/Date::isDateTime handle cells which calculate as arrays. [Issue #4557](https://github.com/PHPOffice/PhpSpreadsheet/issues/4557) [PR #4562](https://github.com/PHPOffice/PhpSpreadsheet/pull/4562)
+- Xlsx Writer eliminate xml:space from non-text nodes. [Issue #4542](https://github.com/PHPOffice/PhpSpreadsheet/issues/4542) [PR #4556](https://github.com/PHPOffice/PhpSpreadsheet/pull/4556)
+
+## 2025-07-23 - 4.5.0
+
+### Added
+
+- Add to all readers the option to allow or forbid fetching external images. This is unconditionally allowed now. The default will be set to "allow", so no code changes are necessary. However, we are giving consideration to changing the default. [PR #4543](https://github.com/PHPOffice/PhpSpreadsheet/pull/4543)
+- Address Excel Inappropriate Number Format Substitution. [PR #4532](https://github.com/PHPOffice/PhpSpreadsheet/pull/4532)
+
+### Fixed
+
+- Html Writer Conditional Formatting Inline Css. [Issue #4539](https://github.com/PHPOffice/PhpSpreadsheet/issues/4539) [PR #4541](https://github.com/PHPOffice/PhpSpreadsheet/pull/4541)
+- Do not use htmlspecialchars when formatting XML. [Issue #4537](https://github.com/PHPOffice/PhpSpreadsheet/issues/4537) [PR #4540](https://github.com/PHPOffice/PhpSpreadsheet/pull/4540)
+- Writer Html/Pdf support RTL alignment of tables. [Issue #1104](https://github.com/PHPOffice/PhpSpreadsheet/issues/1104) [PR #4535](https://github.com/PHPOffice/PhpSpreadsheet/pull/4535)
+- Xlsx Reader use dynamic arrays if spreadsheet did so. [PR #4533](https://github.com/PHPOffice/PhpSpreadsheet/pull/4533)
+- Ods Reader Nested table-row. [Issue #4528](https://github.com/PHPOffice/PhpSpreadsheet/issues/4528) [Issue #2507](https://github.com/PHPOffice/PhpSpreadsheet/issues/2507) [PR #4531](https://github.com/PHPOffice/PhpSpreadsheet/pull/4531)
+- Recognize application/x-empty mimetype. [Issue #4521](https://github.com/PHPOffice/PhpSpreadsheet/issues/4521) [PR #4524](https://github.com/PHPOffice/PhpSpreadsheet/pull/4524)
+- Micro-optimization in getSheetByName. [PR #4499](https://github.com/PHPOffice/PhpSpreadsheet/pull/4499)
+- Bug in resizeMatricesExtend. [Issue #4451](https://github.com/PHPOffice/PhpSpreadsheet/issues/4451) [PR #4474](https://github.com/PHPOffice/PhpSpreadsheet/pull/4474)
+- Allow Replace of Dummy Function with Custom Function. [PR #4544](https://github.com/PHPOffice/PhpSpreadsheet/pull/4544)
+- Preserve 0x0a in Strings if Desired. [Issue #347](https://github.com/PHPOffice/PhpSpreadsheet/issues/347) [PR #4536](https://github.com/PHPOffice/PhpSpreadsheet/pull/4536)
+
+## 2025-06-22 - 4.4.0
+
+### Added
+
+- VSTACK and HSTACK. [Issue #4485](https://github.com/PHPOffice/PhpSpreadsheet/issues/4485) [PR #4492](https://github.com/PHPOffice/PhpSpreadsheet/pull/4492)
+- TOCOL and TOROW. [PR #4493](https://github.com/PHPOffice/PhpSpreadsheet/pull/4493)
+- Support Current Office Theme. [PR #4500](https://github.com/PHPOffice/PhpSpreadsheet/pull/4500)
+
+### Deprecated
+
+- Theme constants COLOR_SCHEME_2013_PLUS_NAME (use COLOR_SCHEME_2013_2022_NAME) and COLOR_SCHEME_2013_PLUS (use COLOR_SCHEME_2013_2022).
+
+### Fixed
+
+- Various Writers RichText TextElement Should Inherit Cell Style. [Issue #1154](https://github.com/PHPOffice/PhpSpreadsheet/issues/1154) [PR #4487](https://github.com/PHPOffice/PhpSpreadsheet/pull/4487)
+- Minor Changes to FILTER function. [PR #4491](https://github.com/PHPOffice/PhpSpreadsheet/pull/4491)
+- Allow Xlsx Reader/Writer to support Font Charset. [Issue #2760](https://github.com/PHPOffice/PhpSpreadsheet/issues/2760) [PR #4501](https://github.com/PHPOffice/PhpSpreadsheet/pull/4501)
+- AutoColor for LibreOffice Dark Mode [Discussion 4502](https://github.com/PHPOffice/PhpSpreadsheet/discussions/4502) [PR #4503](https://github.com/PHPOffice/PhpSpreadsheet/pull/4503)
+- Xlsx Style Writer Minor Refactoring. [PR #4508](https://github.com/PHPOffice/PhpSpreadsheet/pull/4508)
+- Allow Xlsx Reader to Specify ParseHuge. [Issue #4260](https://github.com/PHPOffice/PhpSpreadsheet/issues/4260) [PR #4515](https://github.com/PHPOffice/PhpSpreadsheet/pull/4515)
+
+## 2025-05-26 - 4.3.1
+
+### Fixed
+
+- Regression in Date::stringToExcel. [Issue #4488](https://github.com/PHPOffice/PhpSpreadsheet/issues/4488) [PR #4489](https://github.com/PHPOffice/PhpSpreadsheet/pull/4489)
+
+## 2025-05-25 - 4.3.0
+
+### Added
+
+- Xml Reader recognize indents. [Issue #4448](https://github.com/PHPOffice/PhpSpreadsheet/issues/4448) [PR #4449](https://github.com/PHPOffice/PhpSpreadsheet/pull/4449)
+
+### Changed
+
+- Phpstan Level 10.
+
+### Fixed
+
+- Micro-optimization for excelToDateTimeObject. [Issue #4438](https://github.com/PHPOffice/PhpSpreadsheet/issues/4438) [PR #4442](https://github.com/PHPOffice/PhpSpreadsheet/pull/4442)
+- Removing Columns/Rows Containing Merged Cells. [Issue #282](https://github.com/PHPOffice/PhpSpreadsheet/issues/282) [PR #4465](https://github.com/PHPOffice/PhpSpreadsheet/pull/4465)
+- Print Area and Row Break. [Issue #1275](https://github.com/PHPOffice/PhpSpreadsheet/issues/1275) [PR #4450](https://github.com/PHPOffice/PhpSpreadsheet/pull/4450)
+- Copy Styles after insertNewColumnBefore. [Issue #1425](https://github.com/PHPOffice/PhpSpreadsheet/issues/1425) [PR #4468](https://github.com/PHPOffice/PhpSpreadsheet/pull/4468)
+- Xls Writer Treat Hyperlink Starting with # as Internal. [Issue #56](https://github.com/PHPOffice/PhpSpreadsheet/issues/56) [PR #4453](https://github.com/PHPOffice/PhpSpreadsheet/pull/4453)
+- More Precision for Float to String Casts. [Issue #3899](https://github.com/PHPOffice/PhpSpreadsheet/issues/3899) [PR #4479](https://github.com/PHPOffice/PhpSpreadsheet/pull/4479)
+- Hyperlink Styles. [Issue #1632](https://github.com/PHPOffice/PhpSpreadsheet/issues/1632) [PR #4478](https://github.com/PHPOffice/PhpSpreadsheet/pull/4478)
+- ODS Handling of Ceiling and Floor. [Issue #477](https://github.com/PHPOffice/PhpSpreadsheet/issues/407) [PR #4466](https://github.com/PHPOffice/PhpSpreadsheet/pull/4466)
+- Xlsx Reader Do Not Process Printer Settings for Dataonly. [Issue #4477](https://github.com/PHPOffice/PhpSpreadsheet/issues/4477) [PR #4480](https://github.com/PHPOffice/PhpSpreadsheet/pull/4480)
+
+## 2025-04-16 - 4.2.0
+
+### Added
+
+- Add ability to add custom functions to Calculation. [PR #4390](https://github.com/PHPOffice/PhpSpreadsheet/pull/4390)
+- Add FormulaRange to IgnoredErrors. [PR #4393](https://github.com/PHPOffice/PhpSpreadsheet/pull/4393)
+- TextGrid improvements. [PR #4418](https://github.com/PHPOffice/PhpSpreadsheet/pull/4418)
+- Permit read to class which extends Spreadsheet. [Discussion #4402](https://github.com/PHPOffice/PhpSpreadsheet/discussions/4402) [PR #4404](https://github.com/PHPOffice/PhpSpreadsheet/pull/4404)
+- Conditional and table formatting support for html writer [PR #4412](https://github.com/PHPOffice/PhpSpreadsheet/pull/4412)
+
+### Changed
+
+- Phpstan Version 2. [PR #4384](https://github.com/PHPOffice/PhpSpreadsheet/pull/4384)
+- Start migration to Phpstan level 9. [PR #4396](https://github.com/PHPOffice/PhpSpreadsheet/pull/4396)
+- Calculation locale logic moved to separate class. [PR #4398](https://github.com/PHPOffice/PhpSpreadsheet/pull/4398)
+- TREND_POLYNOMIAL_* and TREND_BEST_FIT do not work, and are changed to throw Exceptions if attempted. (TREND_BEST_FIT_NO_POLY works.) An attempt to use an unknown trend type will now also throw an exception. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)
+- Month parameter of DATE function will now return VALUE if an ordinal string (e.g. '3rd') is used, but will accept bool or null. [PR #4420](https://github.com/PHPOffice/PhpSpreadsheet/pull/4420)
+
+### Fixed
+
+- Ignore fractional part of Drawing Shadow Alpha. [Issue #4415](https://github.com/PHPOffice/PhpSpreadsheet/issues/4415) [PR #4417](https://github.com/PHPOffice/PhpSpreadsheet/pull/4417)
+- BIN2DEC, OCT2DEC, and HEX2DEC return numbers rather than strings. [Issue #4383](https://github.com/PHPOffice/PhpSpreadsheet/issues/4383) [PR #4389](https://github.com/PHPOffice/PhpSpreadsheet/pull/4389)
+- Fix TREND_BEST_FIT_NO_POLY. [Issue #4400](https://github.com/PHPOffice/PhpSpreadsheet/issues/4400) [PR #4339](https://github.com/PHPOffice/PhpSpreadsheet/pull/4339)
+- Ods Reader No DataType for Null Value. [Issue #4435](https://github.com/PHPOffice/PhpSpreadsheet/issues/4435) [PR #4436](https://github.com/PHPOffice/PhpSpreadsheet/pull/4436)
+- Column widths not preserved when using read filter. [Issue #4416](https://github.com/PHPOffice/PhpSpreadsheet/issues/4416) [PR #4423](https://github.com/PHPOffice/PhpSpreadsheet/pull/4423)
+- Fix typo in Style exportArray quotePrefix. [Issue #4422](https://github.com/PHPOffice/PhpSpreadsheet/issues/4422) [PR #4424](https://github.com/PHPOffice/PhpSpreadsheet/pull/4424)
+- Tweak Spreadsheet clone. [PR #4419](https://github.com/PHPOffice/PhpSpreadsheet/pull/4419)
+- Better handling of Chart DisplayBlanksAs. [Issue #4411](https://github.com/PHPOffice/PhpSpreadsheet/issues/4411) [PR #4414](https://github.com/PHPOffice/PhpSpreadsheet/pull/4414)
+
## 2025-03-02 - 4.1.0
### Added
- Support Justify Last Line. [Issue #4374](https://github.com/PHPOffice/PhpSpreadsheet/issues/4374) [PR #4373](https://github.com/PHPOffice/PhpSpreadsheet/pull/4373)
-- Allow Spreadsheet clone. [PR #437-](https://github.com/PHPOffice/PhpSpreadsheet/pull/4370)
+- Allow Spreadsheet clone. [PR #4370](https://github.com/PHPOffice/PhpSpreadsheet/pull/4370)
### Changed
diff --git a/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md b/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
index 88a0339..6cbf9fb 100644
--- a/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
+++ b/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
@@ -43,7 +43,7 @@ This makes it easier to see exactly what is being tested when reviewing the PR.
4. By default, Github removes markdown headings in the Release Notes. You can either edit to restore these, or, probably preferably, change the default comment character on your system - `git config core.commentChar ";"`.
> **Note:** Tagged releases are made from the `master` branch. Only in an emergency should a tagged release be made from the `release` branch. (i.e. cherry-picked hot-fixes.) However, there are 4 branches which have been updated to apply security patches, and those may be tagged if future security updates are needed.
-- release1291
-- release210
+- release1291 (no further updates aside from security patches, including code changes needed for Php 8.5 compatibility)
+- release210 (no further updates aside from security patches, including code changes needed for Php 8.5 compatibility)
- release222
- release390
diff --git a/vendor/phpoffice/phpspreadsheet/README.md b/vendor/phpoffice/phpspreadsheet/README.md
index 84b4b7b..8286e3a 100644
--- a/vendor/phpoffice/phpspreadsheet/README.md
+++ b/vendor/phpoffice/phpspreadsheet/README.md
@@ -1,8 +1,7 @@
# PhpSpreadsheet
[](https://github.com/PHPOffice/PhpSpreadsheet/actions)
-[](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
-[](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
+[](https://coveralls.io/github/PHPOffice/PhpSpreadsheet?branch=master)
[](https://packagist.org/packages/phpoffice/phpspreadsheet)
[](https://packagist.org/packages/phpoffice/phpspreadsheet)
[](https://packagist.org/packages/phpoffice/phpspreadsheet)
@@ -11,6 +10,17 @@
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
+This is the master branch, and is maintained for security and bug fixes.
+
+## PHP Version Support
+
+LTS: For maintained branches, support for PHP versions will only be maintained for a period of six months beyond the
+[end of life](https://www.php.net/supported-versions) of that PHP version.
+
+Currently the required PHP minimum version is PHP __8.1__, and we [will support that version](https://www.php.net/supported-versions.php) until 30th June 2026.
+
+See the `composer.json` for other requirements.
+
## Installation
See the [install instructions](https://phpspreadsheet.readthedocs.io/en/latest/#installation).
diff --git a/vendor/phpoffice/phpspreadsheet/composer.json b/vendor/phpoffice/phpspreadsheet/composer.json
index 1635f4f..d26157e 100644
--- a/vendor/phpoffice/phpspreadsheet/composer.json
+++ b/vendor/phpoffice/phpspreadsheet/composer.json
@@ -46,7 +46,7 @@
],
"scripts": {
"check": [
- "php ./bin/check-phpdoc-types",
+ "php bin/check-phpdoc-types.php",
"phpcs samples/ src/ tests/ --report=checkstyle",
"phpcs samples/ src/ tests/ --standard=PHPCompatibility --runtime-set testVersion 8.0- --exclude=PHPCompatibility.Variables.ForbiddenThisUseContexts -n",
"php-cs-fixer fix --ansi --dry-run --diff",
@@ -92,17 +92,18 @@
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
- "mitoteam/jpgraph": "^10.3",
+ "mitoteam/jpgraph": "^10.5",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
- "phpstan/phpstan": "^1.1",
- "phpstan/phpstan-phpunit": "^1.0",
+ "phpstan/phpstan": "^1.1 || ^2.0",
+ "phpstan/phpstan-deprecation-rules": "^1.0 || ^2.0",
+ "phpstan/phpstan-phpunit": "^1.0 || ^2.0",
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
- "ext-intl": "PHP Internationalization Functions",
+ "ext-intl": "PHP Internationalization Functions, regquired for NumberFormat Wizard",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
index 7b78b6f..038b716 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
@@ -12,21 +12,25 @@ trait ArrayEnabled
private static ArrayArgumentHelper $arrayArgumentHelper;
/**
- * @param array|false $arguments Can be changed to array for Php8.1+
+ * @param mixed[] $arguments
*/
- private static function initialiseHelper($arguments): void
+ private static function initialiseHelper(array $arguments): void
{
if (self::$initializationNeeded === true) {
self::$arrayArgumentHelper = new ArrayArgumentHelper();
self::$initializationNeeded = false;
}
- self::$arrayArgumentHelper->initialise(($arguments === false) ? [] : $arguments);
+ self::$arrayArgumentHelper->initialise($arguments);
}
/**
* Handles array argument processing when the function accepts a single argument that can be an array argument.
* Example use for:
* DAYOFMONTH() or FACT().
+ *
+ * @param mixed[] $values
+ *
+ * @return mixed[]
*/
protected static function evaluateSingleArgumentArray(callable $method, array $values): array
{
@@ -43,6 +47,8 @@ trait ArrayEnabled
* and any of them can be an array argument.
* Example use for:
* ROUND() or DATE().
+ *
+ * @return mixed[]
*/
protected static function evaluateArrayArguments(callable $method, mixed ...$arguments): array
{
@@ -58,6 +64,8 @@ trait ArrayEnabled
* Example use for:
* NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need
* to be treated as a such rather than as an array arguments.
+ *
+ * @return mixed[]
*/
protected static function evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments): array
{
@@ -80,6 +88,8 @@ trait ArrayEnabled
* Example use for:
* Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset
* rather than as an array argument.
+ *
+ * @return mixed[]
*/
protected static function evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments): array
{
@@ -105,6 +115,8 @@ trait ArrayEnabled
* Example use for:
* HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database
* rather than as an array argument.
+ *
+ * @return mixed[]
*/
protected static function evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments): array
{
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
index e4bc156..1f69794 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
@@ -14,13 +14,15 @@ class BinaryComparison
/**
* 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
+ * @param mixed $str1 First string value for the comparison, expect ?string
+ * @param mixed $str2 Second string value for the comparison, expect ?string
*/
- private static function strcmpLowercaseFirst(?string $str1, ?string $str2): int
+ private static function strcmpLowercaseFirst(mixed $str1, mixed $str2): int
{
- $inversedStr1 = StringHelper::strCaseReverse($str1 ?? '');
- $inversedStr2 = StringHelper::strCaseReverse($str2 ?? '');
+ $str1 = StringHelper::convertToString($str1);
+ $str2 = StringHelper::convertToString($str2);
+ $inversedStr1 = StringHelper::strCaseReverse($str1);
+ $inversedStr2 = StringHelper::strCaseReverse($str2);
return strcmp($inversedStr1, $inversedStr2);
}
@@ -28,12 +30,15 @@ class BinaryComparison
/**
* 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
+ * @param mixed $str1 First string value for the comparison, expect ?string
+ * @param mixed $str2 Second string value for the comparison, expect ?string
*/
- private static function strcmpAllowNull(?string $str1, ?string $str2): int
+ private static function strcmpAllowNull(mixed $str1, mixed $str2): int
{
- return strcmp($str1 ?? '', $str2 ?? '');
+ $str1 = StringHelper::convertToString($str1);
+ $str2 = StringHelper::convertToString($str2);
+
+ return strcmp($str1, $str2);
}
public static function compare(mixed $operand1, mixed $operand2, string $operator): bool
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
index 28b4645..abdd4c8 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
@@ -15,15 +15,16 @@ use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\DefinedName;
use PhpOffice\PhpSpreadsheet\NamedRange;
use PhpOffice\PhpSpreadsheet\ReferenceHelper;
-use PhpOffice\PhpSpreadsheet\Shared;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use ReflectionClassConstant;
use ReflectionMethod;
use ReflectionParameter;
use Throwable;
+use TypeError;
-class Calculation
+class Calculation extends CalculationLocale
{
/** Constants */
/** Regular Expressions */
@@ -34,9 +35,7 @@ class Calculation
// Opening bracket
const CALCULATION_REGEXP_OPENBRACE = '\(';
// Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it)
- const CALCULATION_REGEXP_FUNCTION = '@?(?:_xlfn\.)?(?:_xlws\.)?([\p{L}][\p{L}\p{N}\.]*)[\s]*\(';
- // Strip xlfn and xlws prefixes from function name
- const CALCULATION_REGEXP_STRIP_XLFN_XLWS = '/(_xlfn[.])?(_xlws[.])?(?=[\p{L}][\p{L}\p{N}\.]*[\s]*[(])/';
+ const CALCULATION_REGEXP_FUNCTION = '@?(?:_xlfn\.)?(?:_xlws\.)?((?:__xludf\.)?[\p{L}][\p{L}\p{N}\.]*)[\s]*\(';
// Cell reference (cell or range of cells, with or without a sheet reference)
const CALCULATION_REGEXP_CELLREF = '((([^\s,!&%^\/\*\+<>=:`-]*)|(\'(?:[^\']|\'[^!])+?\')|(\"(?:[^\"]|\"[^!])+?\"))!)?\$?\b([a-z]{1,3})\$?(\d{1,7})(?![\w.])';
// Used only to detect spill operator #
@@ -61,12 +60,6 @@ class Calculation
const RETURN_ARRAY_AS_VALUE = 'value';
const RETURN_ARRAY_AS_ARRAY = 'array';
- const FORMULA_OPEN_FUNCTION_BRACE = '(';
- const FORMULA_CLOSE_FUNCTION_BRACE = ')';
- const FORMULA_OPEN_MATRIX_BRACE = '{';
- const FORMULA_CLOSE_MATRIX_BRACE = '}';
- const FORMULA_STRING_QUOTE = '"';
-
/** Preferable to use instance variable instanceArrayReturnType rather than this static property. */
private static string $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE;
@@ -85,6 +78,8 @@ class Calculation
/**
* Calculation cache.
+ *
+ * @var mixed[]
*/
private array $calculationCache = [];
@@ -138,6 +133,7 @@ class Calculation
*/
private CyclicReferenceStack $cyclicReferenceStack;
+ /** @var mixed[] */
private array $cellStack = [];
/**
@@ -154,51 +150,11 @@ class Calculation
*/
public int $cyclicFormulaCount = 1;
- /**
- * The current locale setting.
- */
- private static string $localeLanguage = 'en_us'; // US English (default locale)
-
- /**
- * List of available locale settings
- * Note that this is read for the locale subdirectory only when requested.
- *
- * @var string[]
- */
- private static array $validLocaleLanguages = [
- 'en', // English (default language)
- ];
-
- /**
- * Locale-specific argument separator for function arguments.
- */
- private static string $localeArgumentSeparator = ',';
-
- private static array $localeFunctions = [];
-
- /**
- * Locale-specific translations for Excel constants (True, False and Null).
- *
- * @var array
- */
- private static array $localeBoolean = [
- 'TRUE' => 'TRUE',
- 'FALSE' => 'FALSE',
- 'NULL' => 'NULL',
- ];
-
- public static function getLocaleBoolean(string $index): string
- {
- return self::$localeBoolean[$index];
- }
-
/**
* Excel constant string translations to their PHP equivalents
* Constant conversion from text name/value to actual (datatyped) value.
- *
- * @var array
*/
- private static array $excelConstants = [
+ private const EXCEL_CONSTANTS = [
'TRUE' => true,
'FALSE' => false,
'NULL' => null,
@@ -206,2668 +162,18 @@ class Calculation
public static function keyInExcelConstants(string $key): bool
{
- return array_key_exists($key, self::$excelConstants);
+ return array_key_exists($key, self::EXCEL_CONSTANTS);
}
public static function getExcelConstants(string $key): bool|null
{
- return self::$excelConstants[$key];
+ return self::EXCEL_CONSTANTS[$key];
}
- /**
- * Array of functions usable on Spreadsheet.
- * In theory, this could be const rather than static;
- * however, Phpstan breaks trying to analyze it when attempted.
- */
- private static array $phpSpreadsheetFunctions = [
- 'ABS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Absolute::class, 'evaluate'],
- 'argumentCount' => '1',
- ],
- 'ACCRINT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\AccruedInterest::class, 'periodic'],
- 'argumentCount' => '4-8',
- ],
- 'ACCRINTM' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\AccruedInterest::class, 'atMaturity'],
- 'argumentCount' => '3-5',
- ],
- 'ACOS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosine::class, 'acos'],
- 'argumentCount' => '1',
- ],
- 'ACOSH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosine::class, 'acosh'],
- 'argumentCount' => '1',
- ],
- 'ACOT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cotangent::class, 'acot'],
- 'argumentCount' => '1',
- ],
- 'ACOTH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cotangent::class, 'acoth'],
- 'argumentCount' => '1',
- ],
- 'ADDRESS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Address::class, 'cell'],
- 'argumentCount' => '2-5',
- ],
- 'AGGREGATE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3+',
- ],
- 'AMORDEGRC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Amortization::class, 'AMORDEGRC'],
- 'argumentCount' => '6,7',
- ],
- 'AMORLINC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Amortization::class, 'AMORLINC'],
- 'argumentCount' => '6,7',
- ],
- 'ANCHORARRAY' => [
- 'category' => Category::CATEGORY_MICROSOFT_INTERNAL,
- 'functionCall' => [Internal\ExcelArrayPseudoFunctions::class, 'anchorArray'],
- 'argumentCount' => '1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'AND' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Operations::class, 'logicalAnd'],
- 'argumentCount' => '1+',
- ],
- 'ARABIC' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Arabic::class, 'evaluate'],
- 'argumentCount' => '1',
- ],
- 'AREAS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'ARRAYTOTEXT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'fromArray'],
- 'argumentCount' => '1,2',
- ],
- 'ASC' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'ASIN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Sine::class, 'asin'],
- 'argumentCount' => '1',
- ],
- 'ASINH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Sine::class, 'asinh'],
- 'argumentCount' => '1',
- ],
- 'ATAN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Tangent::class, 'atan'],
- 'argumentCount' => '1',
- ],
- 'ATAN2' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Tangent::class, 'atan2'],
- 'argumentCount' => '2',
- ],
- 'ATANH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Tangent::class, 'atanh'],
- 'argumentCount' => '1',
- ],
- 'AVEDEV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'averageDeviations'],
- 'argumentCount' => '1+',
- ],
- 'AVERAGE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'average'],
- 'argumentCount' => '1+',
- ],
- 'AVERAGEA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'averageA'],
- 'argumentCount' => '1+',
- ],
- 'AVERAGEIF' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'AVERAGEIF'],
- 'argumentCount' => '2,3',
- ],
- 'AVERAGEIFS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'AVERAGEIFS'],
- 'argumentCount' => '3+',
- ],
- 'BAHTTEXT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'BASE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Base::class, 'evaluate'],
- 'argumentCount' => '2,3',
- ],
- 'BESSELI' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BesselI::class, 'BESSELI'],
- 'argumentCount' => '2',
- ],
- 'BESSELJ' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BesselJ::class, 'BESSELJ'],
- 'argumentCount' => '2',
- ],
- 'BESSELK' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BesselK::class, 'BESSELK'],
- 'argumentCount' => '2',
- ],
- 'BESSELY' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BesselY::class, 'BESSELY'],
- 'argumentCount' => '2',
- ],
- 'BETADIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Beta::class, 'distribution'],
- 'argumentCount' => '3-5',
- ],
- 'BETA.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '4-6',
- ],
- 'BETAINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Beta::class, 'inverse'],
- 'argumentCount' => '3-5',
- ],
- 'BETA.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Beta::class, 'inverse'],
- 'argumentCount' => '3-5',
- ],
- 'BIN2DEC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertBinary::class, 'toDecimal'],
- 'argumentCount' => '1',
- ],
- 'BIN2HEX' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertBinary::class, 'toHex'],
- 'argumentCount' => '1,2',
- ],
- 'BIN2OCT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertBinary::class, 'toOctal'],
- 'argumentCount' => '1,2',
- ],
- 'BINOMDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'BINOM.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'BINOM.DIST.RANGE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'range'],
- 'argumentCount' => '3,4',
- ],
- 'BINOM.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'BITAND' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BitWise::class, 'BITAND'],
- 'argumentCount' => '2',
- ],
- 'BITOR' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BitWise::class, 'BITOR'],
- 'argumentCount' => '2',
- ],
- 'BITXOR' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BitWise::class, 'BITXOR'],
- 'argumentCount' => '2',
- ],
- 'BITLSHIFT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BitWise::class, 'BITLSHIFT'],
- 'argumentCount' => '2',
- ],
- 'BITRSHIFT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\BitWise::class, 'BITRSHIFT'],
- 'argumentCount' => '2',
- ],
- 'BYCOL' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'BYROW' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'CEILING' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Ceiling::class, 'ceiling'],
- 'argumentCount' => '1-2', // 2 for Excel, 1-2 for Ods/Gnumeric
- ],
- 'CEILING.MATH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Ceiling::class, 'math'],
- 'argumentCount' => '1-3',
- ],
- 'CEILING.PRECISE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Ceiling::class, 'precise'],
- 'argumentCount' => '1,2',
- ],
- 'CELL' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1,2',
- ],
- 'CHAR' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CharacterConvert::class, 'character'],
- 'argumentCount' => '1',
- ],
- 'CHIDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionRightTail'],
- 'argumentCount' => '2',
- ],
- 'CHISQ.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionLeftTail'],
- 'argumentCount' => '3',
- ],
- 'CHISQ.DIST.RT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionRightTail'],
- 'argumentCount' => '2',
- ],
- 'CHIINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseRightTail'],
- 'argumentCount' => '2',
- ],
- 'CHISQ.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseLeftTail'],
- 'argumentCount' => '2',
- ],
- 'CHISQ.INV.RT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseRightTail'],
- 'argumentCount' => '2',
- ],
- 'CHITEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'test'],
- 'argumentCount' => '2',
- ],
- 'CHISQ.TEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'test'],
- 'argumentCount' => '2',
- ],
- 'CHOOSE' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Selection::class, 'CHOOSE'],
- 'argumentCount' => '2+',
- ],
- 'CHOOSECOLS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ChooseRowsEtc::class, 'chooseCols'],
- 'argumentCount' => '2+',
- ],
- 'CHOOSEROWS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ChooseRowsEtc::class, 'chooseRows'],
- 'argumentCount' => '2+',
- ],
- 'CLEAN' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Trim::class, 'nonPrintable'],
- 'argumentCount' => '1',
- ],
- 'CODE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CharacterConvert::class, 'code'],
- 'argumentCount' => '1',
- ],
- 'COLUMN' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\RowColumnInformation::class, 'COLUMN'],
- 'argumentCount' => '-1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'COLUMNS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\RowColumnInformation::class, 'COLUMNS'],
- 'argumentCount' => '1',
- ],
- 'COMBIN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Combinations::class, 'withoutRepetition'],
- 'argumentCount' => '2',
- ],
- 'COMBINA' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Combinations::class, 'withRepetition'],
- 'argumentCount' => '2',
- ],
- 'COMPLEX' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Complex::class, 'COMPLEX'],
- 'argumentCount' => '2,3',
- ],
- 'CONCAT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Concatenate::class, 'CONCATENATE'],
- 'argumentCount' => '1+',
- ],
- 'CONCATENATE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Concatenate::class, 'actualCONCATENATE'],
- 'argumentCount' => '1+',
- ],
- 'CONFIDENCE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Confidence::class, 'CONFIDENCE'],
- 'argumentCount' => '3',
- ],
- 'CONFIDENCE.NORM' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Confidence::class, 'CONFIDENCE'],
- 'argumentCount' => '3',
- ],
- 'CONFIDENCE.T' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'CONVERT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertUOM::class, 'CONVERT'],
- 'argumentCount' => '3',
- ],
- 'CORREL' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'CORREL'],
- 'argumentCount' => '2',
- ],
- 'COS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosine::class, 'cos'],
- 'argumentCount' => '1',
- ],
- 'COSH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosine::class, 'cosh'],
- 'argumentCount' => '1',
- ],
- 'COT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cotangent::class, 'cot'],
- 'argumentCount' => '1',
- ],
- 'COTH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cotangent::class, 'coth'],
- 'argumentCount' => '1',
- ],
- 'COUNT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Counts::class, 'COUNT'],
- 'argumentCount' => '1+',
- ],
- 'COUNTA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Counts::class, 'COUNTA'],
- 'argumentCount' => '1+',
- ],
- 'COUNTBLANK' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Counts::class, 'COUNTBLANK'],
- 'argumentCount' => '1',
- ],
- 'COUNTIF' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'COUNTIF'],
- 'argumentCount' => '2',
- ],
- 'COUNTIFS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'COUNTIFS'],
- 'argumentCount' => '2+',
- ],
- 'COUPDAYBS' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPDAYBS'],
- 'argumentCount' => '3,4',
- ],
- 'COUPDAYS' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPDAYS'],
- 'argumentCount' => '3,4',
- ],
- 'COUPDAYSNC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPDAYSNC'],
- 'argumentCount' => '3,4',
- ],
- 'COUPNCD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPNCD'],
- 'argumentCount' => '3,4',
- ],
- 'COUPNUM' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPNUM'],
- 'argumentCount' => '3,4',
- ],
- 'COUPPCD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Coupons::class, 'COUPPCD'],
- 'argumentCount' => '3,4',
- ],
- 'COVAR' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'COVAR'],
- 'argumentCount' => '2',
- ],
- 'COVARIANCE.P' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'COVAR'],
- 'argumentCount' => '2',
- ],
- 'COVARIANCE.S' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'CRITBINOM' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'CSC' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosecant::class, 'csc'],
- 'argumentCount' => '1',
- ],
- 'CSCH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Cosecant::class, 'csch'],
- 'argumentCount' => '1',
- ],
- 'CUBEKPIMEMBER' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBEMEMBER' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBEMEMBERPROPERTY' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBERANKEDMEMBER' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBESET' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBESETCOUNT' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUBEVALUE' => [
- 'category' => Category::CATEGORY_CUBE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'CUMIPMT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Cumulative::class, 'interest'],
- 'argumentCount' => '6',
- ],
- 'CUMPRINC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Cumulative::class, 'principal'],
- 'argumentCount' => '6',
- ],
- 'DATE' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Date::class, 'fromYMD'],
- 'argumentCount' => '3',
- ],
- 'DATEDIF' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Difference::class, 'interval'],
- 'argumentCount' => '2,3',
- ],
- 'DATESTRING' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'DATEVALUE' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\DateValue::class, 'fromString'],
- 'argumentCount' => '1',
- ],
- 'DAVERAGE' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DAverage::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DAY' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\DateParts::class, 'day'],
- 'argumentCount' => '1',
- ],
- 'DAYS' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Days::class, 'between'],
- 'argumentCount' => '2',
- ],
- 'DAYS360' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Days360::class, 'between'],
- 'argumentCount' => '2,3',
- ],
- 'DB' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Depreciation::class, 'DB'],
- 'argumentCount' => '4,5',
- ],
- 'DBCS' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'DCOUNT' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DCount::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DCOUNTA' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DCountA::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DDB' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Depreciation::class, 'DDB'],
- 'argumentCount' => '4,5',
- ],
- 'DEC2BIN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertDecimal::class, 'toBinary'],
- 'argumentCount' => '1,2',
- ],
- 'DEC2HEX' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertDecimal::class, 'toHex'],
- 'argumentCount' => '1,2',
- ],
- 'DEC2OCT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertDecimal::class, 'toOctal'],
- 'argumentCount' => '1,2',
- ],
- 'DECIMAL' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'DEGREES' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Angle::class, 'toDegrees'],
- 'argumentCount' => '1',
- ],
- 'DELTA' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Compare::class, 'DELTA'],
- 'argumentCount' => '1,2',
- ],
- 'DEVSQ' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Deviations::class, 'sumSquares'],
- 'argumentCount' => '1+',
- ],
- 'DGET' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DGet::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DISC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Rates::class, 'discount'],
- 'argumentCount' => '4,5',
- ],
- 'DMAX' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DMax::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DMIN' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DMin::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DOLLAR' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'DOLLAR'],
- 'argumentCount' => '1,2',
- ],
- 'DOLLARDE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Dollar::class, 'decimal'],
- 'argumentCount' => '2',
- ],
- 'DOLLARFR' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Dollar::class, 'fractional'],
- 'argumentCount' => '2',
- ],
- 'DPRODUCT' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DProduct::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DROP' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ChooseRowsEtc::class, 'drop'],
- 'argumentCount' => '2-3',
- ],
- 'DSTDEV' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DStDev::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DSTDEVP' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DStDevP::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DSUM' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DSum::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DURATION' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '5,6',
- ],
- 'DVAR' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DVar::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'DVARP' => [
- 'category' => Category::CATEGORY_DATABASE,
- 'functionCall' => [Database\DVarP::class, 'evaluate'],
- 'argumentCount' => '3',
- ],
- 'ECMA.CEILING' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1,2',
- ],
- 'EDATE' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Month::class, 'adjust'],
- 'argumentCount' => '2',
- ],
- 'EFFECT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\InterestRate::class, 'effective'],
- 'argumentCount' => '2',
- ],
- 'ENCODEURL' => [
- 'category' => Category::CATEGORY_WEB,
- 'functionCall' => [Web\Service::class, 'urlEncode'],
- 'argumentCount' => '1',
- ],
- 'EOMONTH' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Month::class, 'lastDay'],
- 'argumentCount' => '2',
- ],
- 'ERF' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Erf::class, 'ERF'],
- 'argumentCount' => '1,2',
- ],
- 'ERF.PRECISE' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Erf::class, 'ERFPRECISE'],
- 'argumentCount' => '1',
- ],
- 'ERFC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ErfC::class, 'ERFC'],
- 'argumentCount' => '1',
- ],
- 'ERFC.PRECISE' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ErfC::class, 'ERFC'],
- 'argumentCount' => '1',
- ],
- 'ERROR.TYPE' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [ExcelError::class, 'type'],
- 'argumentCount' => '1',
- ],
- 'EVEN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'even'],
- 'argumentCount' => '1',
- ],
- 'EXACT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'exact'],
- 'argumentCount' => '2',
- ],
- 'EXP' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Exp::class, 'evaluate'],
- 'argumentCount' => '1',
- ],
- 'EXPAND' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ChooseRowsEtc::class, 'expand'],
- 'argumentCount' => '2-4',
- ],
- 'EXPONDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Exponential::class, 'distribution'],
- 'argumentCount' => '3',
- ],
- 'EXPON.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Exponential::class, 'distribution'],
- 'argumentCount' => '3',
- ],
- 'FACT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Factorial::class, 'fact'],
- 'argumentCount' => '1',
- ],
- 'FACTDOUBLE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Factorial::class, 'factDouble'],
- 'argumentCount' => '1',
- ],
- 'FALSE' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Boolean::class, 'FALSE'],
- 'argumentCount' => '0',
- ],
- 'FDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'F.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\F::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'F.DIST.RT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'FILTER' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Filter::class, 'filter'],
- 'argumentCount' => '2-3',
- ],
- 'FILTERXML' => [
- 'category' => Category::CATEGORY_WEB,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'FIND' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Search::class, 'sensitive'],
- 'argumentCount' => '2,3',
- ],
- 'FINDB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Search::class, 'sensitive'],
- 'argumentCount' => '2,3',
- ],
- 'FINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'F.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'F.INV.RT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'FISHER' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Fisher::class, 'distribution'],
- 'argumentCount' => '1',
- ],
- 'FISHERINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Fisher::class, 'inverse'],
- 'argumentCount' => '1',
- ],
- 'FIXED' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'FIXEDFORMAT'],
- 'argumentCount' => '1-3',
- ],
- 'FLOOR' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Floor::class, 'floor'],
- 'argumentCount' => '1-2', // Excel requries 2, Ods/Gnumeric 1-2
- ],
- 'FLOOR.MATH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Floor::class, 'math'],
- 'argumentCount' => '1-3',
- ],
- 'FLOOR.PRECISE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Floor::class, 'precise'],
- 'argumentCount' => '1-2',
- ],
- 'FORECAST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'FORECAST'],
- 'argumentCount' => '3',
- ],
- 'FORECAST.ETS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3-6',
- ],
- 'FORECAST.ETS.CONFINT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3-6',
- ],
- 'FORECAST.ETS.SEASONALITY' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2-4',
- ],
- 'FORECAST.ETS.STAT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3-6',
- ],
- 'FORECAST.LINEAR' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'FORECAST'],
- 'argumentCount' => '3',
- ],
- 'FORMULATEXT' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Formula::class, 'text'],
- 'argumentCount' => '1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'FREQUENCY' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'FTEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'F.TEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'FV' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'futureValue'],
- 'argumentCount' => '3-5',
- ],
- 'FVSCHEDULE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Single::class, 'futureValue'],
- 'argumentCount' => '2',
- ],
- 'GAMMA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'gamma'],
- 'argumentCount' => '1',
- ],
- 'GAMMADIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'GAMMA.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'GAMMAINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'GAMMA.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'GAMMALN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'ln'],
- 'argumentCount' => '1',
- ],
- 'GAMMALN.PRECISE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Gamma::class, 'ln'],
- 'argumentCount' => '1',
- ],
- 'GAUSS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'gauss'],
- 'argumentCount' => '1',
- ],
- 'GCD' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Gcd::class, 'evaluate'],
- 'argumentCount' => '1+',
- ],
- 'GEOMEAN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages\Mean::class, 'geometric'],
- 'argumentCount' => '1+',
- ],
- 'GESTEP' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Compare::class, 'GESTEP'],
- 'argumentCount' => '1,2',
- ],
- 'GETPIVOTDATA' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2+',
- ],
- 'GROUPBY' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3-7',
- ],
- 'GROWTH' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'GROWTH'],
- 'argumentCount' => '1-4',
- ],
- 'HARMEAN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages\Mean::class, 'harmonic'],
- 'argumentCount' => '1+',
- ],
- 'HEX2BIN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertHex::class, 'toBinary'],
- 'argumentCount' => '1,2',
- ],
- 'HEX2DEC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertHex::class, 'toDecimal'],
- 'argumentCount' => '1',
- ],
- 'HEX2OCT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertHex::class, 'toOctal'],
- 'argumentCount' => '1,2',
- ],
- 'HLOOKUP' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\HLookup::class, 'lookup'],
- 'argumentCount' => '3,4',
- ],
- 'HOUR' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\TimeParts::class, 'hour'],
- 'argumentCount' => '1',
- ],
- 'HSTACK' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1+',
- ],
- 'HYPERLINK' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Hyperlink::class, 'set'],
- 'argumentCount' => '1,2',
- 'passCellReference' => true,
- ],
- 'HYPGEOMDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\HyperGeometric::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'HYPGEOM.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '5',
- ],
- 'IF' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Conditional::class, 'statementIf'],
- 'argumentCount' => '2-3',
- ],
- 'IFERROR' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Conditional::class, 'IFERROR'],
- 'argumentCount' => '2',
- ],
- 'IFNA' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Conditional::class, 'IFNA'],
- 'argumentCount' => '2',
- ],
- 'IFS' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Conditional::class, 'IFS'],
- 'argumentCount' => '2+',
- ],
- 'IMABS' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMABS'],
- 'argumentCount' => '1',
- ],
- 'IMAGINARY' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Complex::class, 'IMAGINARY'],
- 'argumentCount' => '1',
- ],
- 'IMARGUMENT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMARGUMENT'],
- 'argumentCount' => '1',
- ],
- 'IMCONJUGATE' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCONJUGATE'],
- 'argumentCount' => '1',
- ],
- 'IMCOS' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOS'],
- 'argumentCount' => '1',
- ],
- 'IMCOSH' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOSH'],
- 'argumentCount' => '1',
- ],
- 'IMCOT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOT'],
- 'argumentCount' => '1',
- ],
- 'IMCSC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCSC'],
- 'argumentCount' => '1',
- ],
- 'IMCSCH' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCSCH'],
- 'argumentCount' => '1',
- ],
- 'IMDIV' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexOperations::class, 'IMDIV'],
- 'argumentCount' => '2',
- ],
- 'IMEXP' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMEXP'],
- 'argumentCount' => '1',
- ],
- 'IMLN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLN'],
- 'argumentCount' => '1',
- ],
- 'IMLOG10' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLOG10'],
- 'argumentCount' => '1',
- ],
- 'IMLOG2' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLOG2'],
- 'argumentCount' => '1',
- ],
- 'IMPOWER' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMPOWER'],
- 'argumentCount' => '2',
- ],
- 'IMPRODUCT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexOperations::class, 'IMPRODUCT'],
- 'argumentCount' => '1+',
- ],
- 'IMREAL' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\Complex::class, 'IMREAL'],
- 'argumentCount' => '1',
- ],
- 'IMSEC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSEC'],
- 'argumentCount' => '1',
- ],
- 'IMSECH' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSECH'],
- 'argumentCount' => '1',
- ],
- 'IMSIN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSIN'],
- 'argumentCount' => '1',
- ],
- 'IMSINH' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSINH'],
- 'argumentCount' => '1',
- ],
- 'IMSQRT' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSQRT'],
- 'argumentCount' => '1',
- ],
- 'IMSUB' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexOperations::class, 'IMSUB'],
- 'argumentCount' => '2',
- ],
- 'IMSUM' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexOperations::class, 'IMSUM'],
- 'argumentCount' => '1+',
- ],
- 'IMTAN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ComplexFunctions::class, 'IMTAN'],
- 'argumentCount' => '1',
- ],
- 'INDEX' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Matrix::class, 'index'],
- 'argumentCount' => '2-4',
- ],
- 'INDIRECT' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Indirect::class, 'INDIRECT'],
- 'argumentCount' => '1,2',
- 'passCellReference' => true,
- ],
- 'INFO' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'INT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\IntClass::class, 'evaluate'],
- 'argumentCount' => '1',
- ],
- 'INTERCEPT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'INTERCEPT'],
- 'argumentCount' => '2',
- ],
- 'INTRATE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Rates::class, 'interest'],
- 'argumentCount' => '4,5',
- ],
- 'IPMT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'payment'],
- 'argumentCount' => '4-6',
- ],
- 'IRR' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'rate'],
- 'argumentCount' => '1,2',
- ],
- 'ISBLANK' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isBlank'],
- 'argumentCount' => '1',
- ],
- 'ISERR' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\ErrorValue::class, 'isErr'],
- 'argumentCount' => '1',
- ],
- 'ISERROR' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\ErrorValue::class, 'isError'],
- 'argumentCount' => '1',
- ],
- 'ISEVEN' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isEven'],
- 'argumentCount' => '1',
- ],
- 'ISFORMULA' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isFormula'],
- 'argumentCount' => '1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'ISLOGICAL' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isLogical'],
- 'argumentCount' => '1',
- ],
- 'ISNA' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\ErrorValue::class, 'isNa'],
- 'argumentCount' => '1',
- ],
- 'ISNONTEXT' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isNonText'],
- 'argumentCount' => '1',
- ],
- 'ISNUMBER' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isNumber'],
- 'argumentCount' => '1',
- ],
- 'ISO.CEILING' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1,2',
- ],
- 'ISODD' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isOdd'],
- 'argumentCount' => '1',
- ],
- 'ISOMITTED' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'ISOWEEKNUM' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Week::class, 'isoWeekNumber'],
- 'argumentCount' => '1',
- ],
- 'ISPMT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'schedulePayment'],
- 'argumentCount' => '4',
- ],
- 'ISREF' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isRef'],
- 'argumentCount' => '1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'ISTEXT' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'isText'],
- 'argumentCount' => '1',
- ],
- 'ISTHAIDIGIT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'JIS' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'KURT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Deviations::class, 'kurtosis'],
- 'argumentCount' => '1+',
- ],
- 'LAMBDA' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'LARGE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Size::class, 'large'],
- 'argumentCount' => '2',
- ],
- 'LCM' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Lcm::class, 'evaluate'],
- 'argumentCount' => '1+',
- ],
- 'LEFT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'left'],
- 'argumentCount' => '1,2',
- ],
- 'LEFTB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'left'],
- 'argumentCount' => '1,2',
- ],
- 'LEN' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'length'],
- 'argumentCount' => '1',
- ],
- 'LENB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'length'],
- 'argumentCount' => '1',
- ],
- 'LET' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'LINEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'LINEST'],
- 'argumentCount' => '1-4',
- ],
- 'LN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Logarithms::class, 'natural'],
- 'argumentCount' => '1',
- ],
- 'LOG' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Logarithms::class, 'withBase'],
- 'argumentCount' => '1,2',
- ],
- 'LOG10' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Logarithms::class, 'base10'],
- 'argumentCount' => '1',
- ],
- 'LOGEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'LOGEST'],
- 'argumentCount' => '1-4',
- ],
- 'LOGINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\LogNormal::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'LOGNORMDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\LogNormal::class, 'cumulative'],
- 'argumentCount' => '3',
- ],
- 'LOGNORM.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\LogNormal::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'LOGNORM.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\LogNormal::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'LOOKUP' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Lookup::class, 'lookup'],
- 'argumentCount' => '2,3',
- ],
- 'LOWER' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CaseConvert::class, 'lower'],
- 'argumentCount' => '1',
- ],
- 'MAKEARRAY' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'MAP' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'MATCH' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ExcelMatch::class, 'MATCH'],
- 'argumentCount' => '2,3',
- ],
- 'MAX' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Maximum::class, 'max'],
- 'argumentCount' => '1+',
- ],
- 'MAXA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Maximum::class, 'maxA'],
- 'argumentCount' => '1+',
- ],
- 'MAXIFS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'MAXIFS'],
- 'argumentCount' => '3+',
- ],
- 'MDETERM' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\MatrixFunctions::class, 'determinant'],
- 'argumentCount' => '1',
- ],
- 'MDURATION' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '5,6',
- ],
- 'MEDIAN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'median'],
- 'argumentCount' => '1+',
- ],
- 'MEDIANIF' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2+',
- ],
- 'MID' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'mid'],
- 'argumentCount' => '3',
- ],
- 'MIDB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'mid'],
- 'argumentCount' => '3',
- ],
- 'MIN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Minimum::class, 'min'],
- 'argumentCount' => '1+',
- ],
- 'MINA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Minimum::class, 'minA'],
- 'argumentCount' => '1+',
- ],
- 'MINIFS' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Conditional::class, 'MINIFS'],
- 'argumentCount' => '3+',
- ],
- 'MINUTE' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\TimeParts::class, 'minute'],
- 'argumentCount' => '1',
- ],
- 'MINVERSE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\MatrixFunctions::class, 'inverse'],
- 'argumentCount' => '1',
- ],
- 'MIRR' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'modifiedRate'],
- 'argumentCount' => '3',
- ],
- 'MMULT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\MatrixFunctions::class, 'multiply'],
- 'argumentCount' => '2',
- ],
- 'MOD' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Operations::class, 'mod'],
- 'argumentCount' => '2',
- ],
- 'MODE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'mode'],
- 'argumentCount' => '1+',
- ],
- 'MODE.MULT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1+',
- ],
- 'MODE.SNGL' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages::class, 'mode'],
- 'argumentCount' => '1+',
- ],
- 'MONTH' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\DateParts::class, 'month'],
- 'argumentCount' => '1',
- ],
- 'MROUND' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'multiple'],
- 'argumentCount' => '2',
- ],
- 'MULTINOMIAL' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Factorial::class, 'multinomial'],
- 'argumentCount' => '1+',
- ],
- 'MUNIT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\MatrixFunctions::class, 'identity'],
- 'argumentCount' => '1',
- ],
- 'N' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'asNumber'],
- 'argumentCount' => '1',
- ],
- 'NA' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [ExcelError::class, 'NA'],
- 'argumentCount' => '0',
- ],
- 'NEGBINOMDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Binomial::class, 'negative'],
- 'argumentCount' => '3',
- ],
- 'NEGBINOM.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '4',
- ],
- 'NETWORKDAYS' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\NetworkDays::class, 'count'],
- 'argumentCount' => '2-3',
- ],
- 'NETWORKDAYS.INTL' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2-4',
- ],
- 'NOMINAL' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\InterestRate::class, 'nominal'],
- 'argumentCount' => '2',
- ],
- 'NORMDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Normal::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'NORM.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Normal::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'NORMINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Normal::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'NORM.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Normal::class, 'inverse'],
- 'argumentCount' => '3',
- ],
- 'NORMSDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'cumulative'],
- 'argumentCount' => '1',
- ],
- 'NORM.S.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'distribution'],
- 'argumentCount' => '1,2',
- ],
- 'NORMSINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'inverse'],
- 'argumentCount' => '1',
- ],
- 'NORM.S.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'inverse'],
- 'argumentCount' => '1',
- ],
- 'NOT' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Operations::class, 'NOT'],
- 'argumentCount' => '1',
- ],
- 'NOW' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Current::class, 'now'],
- 'argumentCount' => '0',
- ],
- 'NPER' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'periods'],
- 'argumentCount' => '3-5',
- ],
- 'NPV' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'presentValue'],
- 'argumentCount' => '2+',
- ],
- 'NUMBERSTRING' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'NUMBERVALUE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'NUMBERVALUE'],
- 'argumentCount' => '1+',
- ],
- 'OCT2BIN' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertOctal::class, 'toBinary'],
- 'argumentCount' => '1,2',
- ],
- 'OCT2DEC' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertOctal::class, 'toDecimal'],
- 'argumentCount' => '1',
- ],
- 'OCT2HEX' => [
- 'category' => Category::CATEGORY_ENGINEERING,
- 'functionCall' => [Engineering\ConvertOctal::class, 'toHex'],
- 'argumentCount' => '1,2',
- ],
- 'ODD' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'odd'],
- 'argumentCount' => '1',
- ],
- 'ODDFPRICE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '8,9',
- ],
- 'ODDFYIELD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '8,9',
- ],
- 'ODDLPRICE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '7,8',
- ],
- 'ODDLYIELD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '7,8',
- ],
- 'OFFSET' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Offset::class, 'OFFSET'],
- 'argumentCount' => '3-5',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'OR' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Operations::class, 'logicalOr'],
- 'argumentCount' => '1+',
- ],
- 'PDURATION' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Single::class, 'periods'],
- 'argumentCount' => '3',
- ],
- 'PEARSON' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'CORREL'],
- 'argumentCount' => '2',
- ],
- 'PERCENTILE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'PERCENTILE'],
- 'argumentCount' => '2',
- ],
- 'PERCENTILE.EXC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'PERCENTILE.INC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'PERCENTILE'],
- 'argumentCount' => '2',
- ],
- 'PERCENTRANK' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'PERCENTRANK'],
- 'argumentCount' => '2,3',
- ],
- 'PERCENTRANK.EXC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2,3',
- ],
- 'PERCENTRANK.INC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'PERCENTRANK'],
- 'argumentCount' => '2,3',
- ],
- 'PERMUT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Permutations::class, 'PERMUT'],
- 'argumentCount' => '2',
- ],
- 'PERMUTATIONA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Permutations::class, 'PERMUTATIONA'],
- 'argumentCount' => '2',
- ],
- 'PHONETIC' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'PHI' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1',
- ],
- 'PI' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'pi',
- 'argumentCount' => '0',
- ],
- 'PMT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Payments::class, 'annuity'],
- 'argumentCount' => '3-5',
- ],
- 'POISSON' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Poisson::class, 'distribution'],
- 'argumentCount' => '3',
- ],
- 'POISSON.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Poisson::class, 'distribution'],
- 'argumentCount' => '3',
- ],
- 'POWER' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Operations::class, 'power'],
- 'argumentCount' => '2',
- ],
- 'PPMT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Payments::class, 'interestPayment'],
- 'argumentCount' => '4-6',
- ],
- 'PRICE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Price::class, 'price'],
- 'argumentCount' => '6,7',
- ],
- 'PRICEDISC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Price::class, 'priceDiscounted'],
- 'argumentCount' => '4,5',
- ],
- 'PRICEMAT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Price::class, 'priceAtMaturity'],
- 'argumentCount' => '5,6',
- ],
- 'PROB' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3,4',
- ],
- 'PRODUCT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Operations::class, 'product'],
- 'argumentCount' => '1+',
- ],
- 'PROPER' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CaseConvert::class, 'proper'],
- 'argumentCount' => '1',
- ],
- 'PV' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'presentValue'],
- 'argumentCount' => '3-5',
- ],
- 'QUARTILE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'QUARTILE'],
- 'argumentCount' => '2',
- ],
- 'QUARTILE.EXC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'QUARTILE.INC' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'QUARTILE'],
- 'argumentCount' => '2',
- ],
- 'QUOTIENT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Operations::class, 'quotient'],
- 'argumentCount' => '2',
- ],
- 'RADIANS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Angle::class, 'toRadians'],
- 'argumentCount' => '1',
- ],
- 'RAND' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Random::class, 'rand'],
- 'argumentCount' => '0',
- ],
- 'RANDARRAY' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Random::class, 'randArray'],
- 'argumentCount' => '0-5',
- ],
- 'RANDBETWEEN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Random::class, 'randBetween'],
- 'argumentCount' => '2',
- ],
- 'RANK' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'RANK'],
- 'argumentCount' => '2,3',
- ],
- 'RANK.AVG' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2,3',
- ],
- 'RANK.EQ' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Percentiles::class, 'RANK'],
- 'argumentCount' => '2,3',
- ],
- 'RATE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'rate'],
- 'argumentCount' => '3-6',
- ],
- 'RECEIVED' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Price::class, 'received'],
- 'argumentCount' => '4-5',
- ],
- 'REDUCE' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'REPLACE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Replace::class, 'replace'],
- 'argumentCount' => '4',
- ],
- 'REPLACEB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Replace::class, 'replace'],
- 'argumentCount' => '4',
- ],
- 'REPT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Concatenate::class, 'builtinREPT'],
- 'argumentCount' => '2',
- ],
- 'RIGHT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'right'],
- 'argumentCount' => '1,2',
- ],
- 'RIGHTB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'right'],
- 'argumentCount' => '1,2',
- ],
- 'ROMAN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Roman::class, 'evaluate'],
- 'argumentCount' => '1,2',
- ],
- 'ROUND' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'round'],
- 'argumentCount' => '2',
- ],
- 'ROUNDBAHTDOWN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'ROUNDBAHTUP' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'ROUNDDOWN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'down'],
- 'argumentCount' => '2',
- ],
- 'ROUNDUP' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Round::class, 'up'],
- 'argumentCount' => '2',
- ],
- 'ROW' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\RowColumnInformation::class, 'ROW'],
- 'argumentCount' => '-1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'ROWS' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\RowColumnInformation::class, 'ROWS'],
- 'argumentCount' => '1',
- ],
- 'RRI' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Single::class, 'interestRate'],
- 'argumentCount' => '3',
- ],
- 'RSQ' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'RSQ'],
- 'argumentCount' => '2',
- ],
- 'RTD' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1+',
- ],
- 'SEARCH' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Search::class, 'insensitive'],
- 'argumentCount' => '2,3',
- ],
- 'SCAN' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '*',
- ],
- 'SEARCHB' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Search::class, 'insensitive'],
- 'argumentCount' => '2,3',
- ],
- 'SEC' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Secant::class, 'sec'],
- 'argumentCount' => '1',
- ],
- 'SECH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Secant::class, 'sech'],
- 'argumentCount' => '1',
- ],
- 'SECOND' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\TimeParts::class, 'second'],
- 'argumentCount' => '1',
- ],
- 'SEQUENCE' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\MatrixFunctions::class, 'sequence'],
- 'argumentCount' => '1-4',
- ],
- 'SERIESSUM' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\SeriesSum::class, 'evaluate'],
- 'argumentCount' => '4',
- ],
- 'SHEET' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '0,1',
- ],
- 'SHEETS' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '0,1',
- ],
- 'SIGN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Sign::class, 'evaluate'],
- 'argumentCount' => '1',
- ],
- 'SIN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Sine::class, 'sin'],
- 'argumentCount' => '1',
- ],
- 'SINGLE' => [
- 'category' => Category::CATEGORY_MICROSOFT_INTERNAL,
- 'functionCall' => [Internal\ExcelArrayPseudoFunctions::class, 'single'],
- 'argumentCount' => '1',
- 'passCellReference' => true,
- 'passByReference' => [true],
- ],
- 'SINH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Sine::class, 'sinh'],
- 'argumentCount' => '1',
- ],
- 'SKEW' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Deviations::class, 'skew'],
- 'argumentCount' => '1+',
- ],
- 'SKEW.P' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1+',
- ],
- 'SLN' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Depreciation::class, 'SLN'],
- 'argumentCount' => '3',
- ],
- 'SLOPE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'SLOPE'],
- 'argumentCount' => '2',
- ],
- 'SMALL' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Size::class, 'small'],
- 'argumentCount' => '2',
- ],
- 'SORT' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Sort::class, 'sort'],
- 'argumentCount' => '1-4',
- ],
- 'SORTBY' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Sort::class, 'sortBy'],
- 'argumentCount' => '2+',
- ],
- 'SQRT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Sqrt::class, 'sqrt'],
- 'argumentCount' => '1',
- ],
- 'SQRTPI' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Sqrt::class, 'pi'],
- 'argumentCount' => '1',
- ],
- 'STANDARDIZE' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Standardize::class, 'execute'],
- 'argumentCount' => '3',
- ],
- 'STDEV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEV'],
- 'argumentCount' => '1+',
- ],
- 'STDEV.S' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEV'],
- 'argumentCount' => '1+',
- ],
- 'STDEV.P' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVP'],
- 'argumentCount' => '1+',
- ],
- 'STDEVA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVA'],
- 'argumentCount' => '1+',
- ],
- 'STDEVP' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVP'],
- 'argumentCount' => '1+',
- ],
- 'STDEVPA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVPA'],
- 'argumentCount' => '1+',
- ],
- 'STEYX' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'STEYX'],
- 'argumentCount' => '2',
- ],
- 'SUBSTITUTE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Replace::class, 'substitute'],
- 'argumentCount' => '3,4',
- ],
- 'SUBTOTAL' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Subtotal::class, 'evaluate'],
- 'argumentCount' => '2+',
- 'passCellReference' => true,
- ],
- 'SUM' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Sum::class, 'sumErroringStrings'],
- 'argumentCount' => '1+',
- ],
- 'SUMIF' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Statistical\Conditional::class, 'SUMIF'],
- 'argumentCount' => '2,3',
- ],
- 'SUMIFS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Statistical\Conditional::class, 'SUMIFS'],
- 'argumentCount' => '3+',
- ],
- 'SUMPRODUCT' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Sum::class, 'product'],
- 'argumentCount' => '1+',
- ],
- 'SUMSQ' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\SumSquares::class, 'sumSquare'],
- 'argumentCount' => '1+',
- ],
- 'SUMX2MY2' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\SumSquares::class, 'sumXSquaredMinusYSquared'],
- 'argumentCount' => '2',
- ],
- 'SUMX2PY2' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\SumSquares::class, 'sumXSquaredPlusYSquared'],
- 'argumentCount' => '2',
- ],
- 'SUMXMY2' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\SumSquares::class, 'sumXMinusYSquared'],
- 'argumentCount' => '2',
- ],
- 'SWITCH' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Conditional::class, 'statementSwitch'],
- 'argumentCount' => '3+',
- ],
- 'SYD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Depreciation::class, 'SYD'],
- 'argumentCount' => '4',
- ],
- 'T' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'test'],
- 'argumentCount' => '1',
- ],
- 'TAKE' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\ChooseRowsEtc::class, 'take'],
- 'argumentCount' => '2-3',
- ],
- 'TAN' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Tangent::class, 'tan'],
- 'argumentCount' => '1',
- ],
- 'TANH' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trig\Tangent::class, 'tanh'],
- 'argumentCount' => '1',
- ],
- 'TBILLEQ' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\TreasuryBill::class, 'bondEquivalentYield'],
- 'argumentCount' => '3',
- ],
- 'TBILLPRICE' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\TreasuryBill::class, 'price'],
- 'argumentCount' => '3',
- ],
- 'TBILLYIELD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\TreasuryBill::class, 'yield'],
- 'argumentCount' => '3',
- ],
- 'TDIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StudentT::class, 'distribution'],
- 'argumentCount' => '3',
- ],
- 'T.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3',
- ],
- 'T.DIST.2T' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'T.DIST.RT' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'TEXT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'TEXTFORMAT'],
- 'argumentCount' => '2',
- ],
- 'TEXTAFTER' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'after'],
- 'argumentCount' => '2-6',
- ],
- 'TEXTBEFORE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Extract::class, 'before'],
- 'argumentCount' => '2-6',
- ],
- 'TEXTJOIN' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Concatenate::class, 'TEXTJOIN'],
- 'argumentCount' => '3+',
- ],
- 'TEXTSPLIT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Text::class, 'split'],
- 'argumentCount' => '2-6',
- ],
- 'THAIDAYOFWEEK' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAIDIGIT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAIMONTHOFYEAR' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAINUMSOUND' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAINUMSTRING' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAISTRINGLENGTH' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'THAIYEAR' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '?',
- ],
- 'TIME' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Time::class, 'fromHMS'],
- 'argumentCount' => '3',
- ],
- 'TIMEVALUE' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\TimeValue::class, 'fromString'],
- 'argumentCount' => '1',
- ],
- 'TINV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StudentT::class, 'inverse'],
- 'argumentCount' => '2',
- ],
- 'T.INV' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StudentT::class, 'inverse'],
- 'argumentCount' => '2',
- ],
- 'T.INV.2T' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2',
- ],
- 'TODAY' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Current::class, 'today'],
- 'argumentCount' => '0',
- ],
- 'TOCOL' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1-3',
- ],
- 'TOROW' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1-3',
- ],
- 'TRANSPOSE' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Matrix::class, 'transpose'],
- 'argumentCount' => '1',
- ],
- 'TREND' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Trends::class, 'TREND'],
- 'argumentCount' => '1-4',
- ],
- 'TRIM' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Trim::class, 'spaces'],
- 'argumentCount' => '1',
- ],
- 'TRIMMEAN' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Averages\Mean::class, 'trim'],
- 'argumentCount' => '2',
- ],
- 'TRUE' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Boolean::class, 'TRUE'],
- 'argumentCount' => '0',
- ],
- 'TRUNC' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [MathTrig\Trunc::class, 'evaluate'],
- 'argumentCount' => '1,2',
- ],
- 'TTEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '4',
- ],
- 'T.TEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '4',
- ],
- 'TYPE' => [
- 'category' => Category::CATEGORY_INFORMATION,
- 'functionCall' => [Information\Value::class, 'type'],
- 'argumentCount' => '1',
- ],
- 'UNICHAR' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CharacterConvert::class, 'character'],
- 'argumentCount' => '1',
- ],
- 'UNICODE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CharacterConvert::class, 'code'],
- 'argumentCount' => '1',
- ],
- 'UNIQUE' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\Unique::class, 'unique'],
- 'argumentCount' => '1+',
- ],
- 'UPPER' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\CaseConvert::class, 'upper'],
- 'argumentCount' => '1',
- ],
- 'USDOLLAR' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Dollar::class, 'format'],
- 'argumentCount' => '2',
- ],
- 'VALUE' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'VALUE'],
- 'argumentCount' => '1',
- ],
- 'VALUETOTEXT' => [
- 'category' => Category::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => [TextData\Format::class, 'valueToText'],
- 'argumentCount' => '1,2',
- ],
- 'VAR' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VAR'],
- 'argumentCount' => '1+',
- ],
- 'VAR.P' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VARP'],
- 'argumentCount' => '1+',
- ],
- 'VAR.S' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VAR'],
- 'argumentCount' => '1+',
- ],
- 'VARA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VARA'],
- 'argumentCount' => '1+',
- ],
- 'VARP' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VARP'],
- 'argumentCount' => '1+',
- ],
- 'VARPA' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Variances::class, 'VARPA'],
- 'argumentCount' => '1+',
- ],
- 'VDB' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '5-7',
- ],
- 'VLOOKUP' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [LookupRef\VLookup::class, 'lookup'],
- 'argumentCount' => '3,4',
- ],
- 'VSTACK' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '1+',
- ],
- 'WEBSERVICE' => [
- 'category' => Category::CATEGORY_WEB,
- 'functionCall' => [Web\Service::class, 'webService'],
- 'argumentCount' => '1',
- ],
- 'WEEKDAY' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Week::class, 'day'],
- 'argumentCount' => '1,2',
- ],
- 'WEEKNUM' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\Week::class, 'number'],
- 'argumentCount' => '1,2',
- ],
- 'WEIBULL' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Weibull::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'WEIBULL.DIST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\Weibull::class, 'distribution'],
- 'argumentCount' => '4',
- ],
- 'WORKDAY' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\WorkDay::class, 'date'],
- 'argumentCount' => '2-3',
- ],
- 'WORKDAY.INTL' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2-4',
- ],
- 'WRAPCOLS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2-3',
- ],
- 'WRAPROWS' => [
- 'category' => Category::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2-3',
- ],
- 'XIRR' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Variable\NonPeriodic::class, 'rate'],
- 'argumentCount' => '2,3',
- ],
- 'XLOOKUP' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '3-6',
- ],
- 'XNPV' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\CashFlow\Variable\NonPeriodic::class, 'presentValue'],
- 'argumentCount' => '3',
- ],
- 'XMATCH' => [
- 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '2,3',
- ],
- 'XOR' => [
- 'category' => Category::CATEGORY_LOGICAL,
- 'functionCall' => [Logical\Operations::class, 'logicalXor'],
- 'argumentCount' => '1+',
- ],
- 'YEAR' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\DateParts::class, 'year'],
- 'argumentCount' => '1',
- ],
- 'YEARFRAC' => [
- 'category' => Category::CATEGORY_DATE_AND_TIME,
- 'functionCall' => [DateTimeExcel\YearFrac::class, 'fraction'],
- 'argumentCount' => '2,3',
- ],
- 'YIELD' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Functions::class, 'DUMMY'],
- 'argumentCount' => '6,7',
- ],
- 'YIELDDISC' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Yields::class, 'yieldDiscounted'],
- 'argumentCount' => '4,5',
- ],
- 'YIELDMAT' => [
- 'category' => Category::CATEGORY_FINANCIAL,
- 'functionCall' => [Financial\Securities\Yields::class, 'yieldAtMaturity'],
- 'argumentCount' => '5,6',
- ],
- 'ZTEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'zTest'],
- 'argumentCount' => '2-3',
- ],
- 'Z.TEST' => [
- 'category' => Category::CATEGORY_STATISTICAL,
- 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'zTest'],
- 'argumentCount' => '2-3',
- ],
- ];
-
/**
* Internal functions used for special control purposes.
+ *
+ * @var array|string>>
*/
private static array $controlFunctions = [
'MKMATRIX' => [
@@ -2892,18 +198,6 @@ class Calculation
$this->branchPruner = new BranchPruner($this->branchPruningEnabled);
}
- private static function loadLocales(): void
- {
- $localeFileDirectory = __DIR__ . '/locale/';
- $localeFileNames = glob($localeFileDirectory . '*', GLOB_ONLYDIR) ?: [];
- foreach ($localeFileNames as $filename) {
- $filename = substr($filename, strlen($localeFileDirectory));
- if ($filename != 'en') {
- self::$validLocaleLanguages[] = $filename;
- }
- }
- }
-
/**
* Get an instance of this class.
*
@@ -2913,10 +207,7 @@ class Calculation
public static function getInstance(?Spreadsheet $spreadsheet = null): self
{
if ($spreadsheet !== null) {
- $instance = $spreadsheet->getCalculationEngine();
- if (isset($instance)) {
- return $instance;
- }
+ return $spreadsheet->getCalculationEngine();
}
if (!self::$instance) {
@@ -2926,6 +217,20 @@ class Calculation
return self::$instance;
}
+ /**
+ * Intended for use only via a destructor.
+ *
+ * @internal
+ */
+ public static function getInstanceOrNull(?Spreadsheet $spreadsheet = null): ?self
+ {
+ if ($spreadsheet !== null) {
+ return $spreadsheet->getCalculationEngineOrNull();
+ }
+
+ return null;
+ }
+
/**
* Flush the calculation cache for any existing instance of this class
* but only if a Calculation instance exists.
@@ -2952,26 +257,6 @@ class Calculation
throw new Exception('Cloning the calculation engine is not allowed!');
}
- /**
- * Return the locale-specific translation of TRUE.
- *
- * @return string locale-specific translation of TRUE
- */
- public static function getTRUE(): string
- {
- return self::$localeBoolean['TRUE'];
- }
-
- /**
- * Return the locale-specific translation of FALSE.
- *
- * @return string locale-specific translation of FALSE
- */
- public static function getFALSE(): string
- {
- return self::$localeBoolean['FALSE'];
- }
-
/**
* Set the Array Return Type (Array or Value of first element in the array).
*
@@ -3047,10 +332,12 @@ class Calculation
/**
* Enable/disable calculation cache.
*/
- public function setCalculationCacheEnabled(bool $calculationCacheEnabled): void
+ public function setCalculationCacheEnabled(bool $calculationCacheEnabled): self
{
$this->calculationCacheEnabled = $calculationCacheEnabled;
$this->clearCalculationCache();
+
+ return $this;
}
/**
@@ -3098,13 +385,17 @@ class Calculation
}
}
- /**
- * Enable/disable calculation cache.
- */
- public function setBranchPruningEnabled(mixed $enabled): void
+ public function getBranchPruningEnabled(): bool
{
- $this->branchPruningEnabled = $enabled;
+ return $this->branchPruningEnabled;
+ }
+
+ public function setBranchPruningEnabled(mixed $enabled): self
+ {
+ $this->branchPruningEnabled = (bool) $enabled;
$this->branchPruner = new BranchPruner($this->branchPruningEnabled);
+
+ return $this;
}
public function enableBranchPruning(): void
@@ -3117,331 +408,6 @@ class Calculation
$this->setBranchPruningEnabled(false);
}
- /**
- * Get the currently defined locale code.
- */
- public function getLocale(): string
- {
- return self::$localeLanguage;
- }
-
- private function getLocaleFile(string $localeDir, string $locale, string $language, string $file): string
- {
- $localeFileName = $localeDir . str_replace('_', DIRECTORY_SEPARATOR, $locale)
- . DIRECTORY_SEPARATOR . $file;
- if (!file_exists($localeFileName)) {
- // If there isn't a locale specific file, look for a language specific file
- $localeFileName = $localeDir . $language . DIRECTORY_SEPARATOR . $file;
- if (!file_exists($localeFileName)) {
- throw new Exception('Locale file not found');
- }
- }
-
- return $localeFileName;
- }
-
- /** @var array> */
- private static array $falseTrueArray = [];
-
- /** @return array> */
- public function getFalseTrueArray(): array
- {
- if (!empty(self::$falseTrueArray)) {
- return self::$falseTrueArray;
- }
- if (count(self::$validLocaleLanguages) == 1) {
- self::loadLocales();
- }
- $falseTrueArray = [['FALSE'], ['TRUE']];
- foreach (self::$validLocaleLanguages as $language) {
- if (str_starts_with($language, 'en')) {
- continue;
- }
- $locale = $language;
- if (str_contains($locale, '_')) {
- [$language] = explode('_', $locale);
- }
- $localeDir = implode(DIRECTORY_SEPARATOR, [__DIR__, 'locale', null]);
-
- try {
- $functionNamesFile = $this->getLocaleFile($localeDir, $locale, $language, 'functions');
- } catch (Exception $e) {
- continue;
- }
- // Retrieve the list of locale or language specific function names
- $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
- foreach ($localeFunctions as $localeFunction) {
- [$localeFunction] = explode('##', $localeFunction); // Strip out comments
- if (str_contains($localeFunction, '=')) {
- [$fName, $lfName] = array_map('trim', explode('=', $localeFunction));
- if ($fName === 'FALSE') {
- $falseTrueArray[0][] = $lfName;
- } elseif ($fName === 'TRUE') {
- $falseTrueArray[1][] = $lfName;
- }
- }
- }
- }
- self::$falseTrueArray = $falseTrueArray;
-
- return $falseTrueArray;
- }
-
- /**
- * Set the locale code.
- *
- * @param string $locale The locale to use for formula translation, eg: 'en_us'
- */
- public function setLocale(string $locale): bool
- {
- // Identify our locale and language
- $language = $locale = strtolower($locale);
- if (str_contains($locale, '_')) {
- [$language] = explode('_', $locale);
- }
- if (count(self::$validLocaleLanguages) == 1) {
- self::loadLocales();
- }
-
- // Test whether we have any language data for this language (any locale)
- if (in_array($language, self::$validLocaleLanguages, true)) {
- // initialise language/locale settings
- self::$localeFunctions = [];
- self::$localeArgumentSeparator = ',';
- self::$localeBoolean = ['TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL'];
-
- // Default is US English, if user isn't requesting US english, then read the necessary data from the locale files
- if ($locale !== 'en_us') {
- $localeDir = implode(DIRECTORY_SEPARATOR, [__DIR__, 'locale', null]);
-
- // Search for a file with a list of function names for locale
- try {
- $functionNamesFile = $this->getLocaleFile($localeDir, $locale, $language, 'functions');
- } catch (Exception $e) {
- return false;
- }
-
- // Retrieve the list of locale or language specific function names
- $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
- foreach ($localeFunctions as $localeFunction) {
- [$localeFunction] = explode('##', $localeFunction); // Strip out comments
- if (str_contains($localeFunction, '=')) {
- [$fName, $lfName] = array_map('trim', explode('=', $localeFunction));
- if ((str_starts_with($fName, '*') || isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
- self::$localeFunctions[$fName] = $lfName;
- }
- }
- }
- // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions
- if (isset(self::$localeFunctions['TRUE'])) {
- self::$localeBoolean['TRUE'] = self::$localeFunctions['TRUE'];
- }
- if (isset(self::$localeFunctions['FALSE'])) {
- self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE'];
- }
-
- try {
- $configFile = $this->getLocaleFile($localeDir, $locale, $language, 'config');
- } catch (Exception) {
- return false;
- }
-
- $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
- foreach ($localeSettings as $localeSetting) {
- [$localeSetting] = explode('##', $localeSetting); // Strip out comments
- if (str_contains($localeSetting, '=')) {
- [$settingName, $settingValue] = array_map('trim', explode('=', $localeSetting));
- $settingName = strtoupper($settingName);
- if ($settingValue !== '') {
- switch ($settingName) {
- case 'ARGUMENTSEPARATOR':
- self::$localeArgumentSeparator = $settingValue;
-
- break;
- }
- }
- }
- }
- }
-
- self::$functionReplaceFromExcel = self::$functionReplaceToExcel
- = self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null;
- self::$localeLanguage = $locale;
-
- return true;
- }
-
- return false;
- }
-
- public static function translateSeparator(
- string $fromSeparator,
- string $toSeparator,
- string $formula,
- int &$inBracesLevel,
- string $openBrace = self::FORMULA_OPEN_FUNCTION_BRACE,
- string $closeBrace = self::FORMULA_CLOSE_FUNCTION_BRACE
- ): string {
- $strlen = mb_strlen($formula);
- for ($i = 0; $i < $strlen; ++$i) {
- $chr = mb_substr($formula, $i, 1);
- switch ($chr) {
- case $openBrace:
- ++$inBracesLevel;
-
- break;
- case $closeBrace:
- --$inBracesLevel;
-
- break;
- case $fromSeparator:
- if ($inBracesLevel > 0) {
- $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1);
- }
- }
- }
-
- return $formula;
- }
-
- private static function translateFormulaBlock(
- array $from,
- array $to,
- string $formula,
- int &$inFunctionBracesLevel,
- int &$inMatrixBracesLevel,
- string $fromSeparator,
- string $toSeparator
- ): string {
- // Function Names
- $formula = (string) preg_replace($from, $to, $formula);
-
- // Temporarily adjust matrix separators so that they won't be confused with function arguments
- $formula = self::translateSeparator(';', '|', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
- $formula = self::translateSeparator(',', '!', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
- // Function Argument Separators
- $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inFunctionBracesLevel);
- // Restore matrix separators
- $formula = self::translateSeparator('|', ';', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
- $formula = self::translateSeparator('!', ',', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
-
- return $formula;
- }
-
- private static function translateFormula(array $from, array $to, string $formula, string $fromSeparator, string $toSeparator): string
- {
- // Convert any Excel function names and constant names to the required language;
- // and adjust function argument separators
- if (self::$localeLanguage !== 'en_us') {
- $inFunctionBracesLevel = 0;
- $inMatrixBracesLevel = 0;
- // If there is the possibility of separators within a quoted string, then we treat them as literals
- if (str_contains($formula, self::FORMULA_STRING_QUOTE)) {
- // So instead we skip replacing in any quoted strings by only replacing in every other array element
- // after we've exploded the formula
- $temp = explode(self::FORMULA_STRING_QUOTE, $formula);
- $notWithinQuotes = false;
- foreach ($temp as &$value) {
- // Only adjust in alternating array entries
- $notWithinQuotes = $notWithinQuotes === false;
- if ($notWithinQuotes === true) {
- $value = self::translateFormulaBlock($from, $to, $value, $inFunctionBracesLevel, $inMatrixBracesLevel, $fromSeparator, $toSeparator);
- }
- }
- unset($value);
- // Then rebuild the formula string
- $formula = implode(self::FORMULA_STRING_QUOTE, $temp);
- } else {
- // If there's no quoted strings, then we do a simple count/replace
- $formula = self::translateFormulaBlock($from, $to, $formula, $inFunctionBracesLevel, $inMatrixBracesLevel, $fromSeparator, $toSeparator);
- }
- }
-
- return $formula;
- }
-
- private static ?array $functionReplaceFromExcel;
-
- private static ?array $functionReplaceToLocale;
-
- public function translateFormulaToLocale(string $formula): string
- {
- $formula = preg_replace(self::CALCULATION_REGEXP_STRIP_XLFN_XLWS, '', $formula) ?? '';
- // Build list of function names and constants for translation
- if (self::$functionReplaceFromExcel === null) {
- self::$functionReplaceFromExcel = [];
- foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
- self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/ui';
- }
- foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
- self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui';
- }
- }
-
- if (self::$functionReplaceToLocale === null) {
- self::$functionReplaceToLocale = [];
- foreach (self::$localeFunctions as $localeFunctionName) {
- self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2';
- }
- foreach (self::$localeBoolean as $localeBoolean) {
- self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2';
- }
- }
-
- return self::translateFormula(
- self::$functionReplaceFromExcel,
- self::$functionReplaceToLocale,
- $formula,
- ',',
- self::$localeArgumentSeparator
- );
- }
-
- private static ?array $functionReplaceFromLocale;
-
- private static ?array $functionReplaceToExcel;
-
- public function translateFormulaToEnglish(string $formula): string
- {
- if (self::$functionReplaceFromLocale === null) {
- self::$functionReplaceFromLocale = [];
- foreach (self::$localeFunctions as $localeFunctionName) {
- self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/ui';
- }
- foreach (self::$localeBoolean as $excelBoolean) {
- self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui';
- }
- }
-
- if (self::$functionReplaceToExcel === null) {
- self::$functionReplaceToExcel = [];
- foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
- self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2';
- }
- foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
- self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2';
- }
- }
-
- return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ',');
- }
-
- public static function localeFunc(string $function): string
- {
- if (self::$localeLanguage !== 'en_us') {
- $functionName = trim($function, '(');
- if (isset(self::$localeFunctions[$functionName])) {
- $brace = ($functionName != $function);
- $function = self::$localeFunctions[$functionName];
- if ($brace) {
- $function .= '(';
- }
- }
- }
-
- return $function;
- }
-
/**
* Wrap string values in quotes.
*/
@@ -3527,14 +493,14 @@ class Calculation
try {
$value = $cell->getValue();
- if ($cell->getDataType() === DataType::TYPE_FORMULA) {
+ if (is_string($value) && $cell->getDataType() === DataType::TYPE_FORMULA) {
$value = preg_replace_callback(
self::CALCULATION_REGEXP_CELLREF_SPILL,
fn (array $matches) => 'ANCHORARRAY(' . substr($matches[0], 0, -1) . ')',
$value
);
}
- $result = self::unwrapResult($this->_calculateFormulaValue($value, $cell->getCoordinate(), $cell));
+ $result = self::unwrapResult($this->_calculateFormulaValue($value, $cell->getCoordinate(), $cell)); //* @phpstan-ignore-line
if ($this->spreadsheet === null) {
throw new Exception('null spreadsheet in calculateCellValue');
}
@@ -3543,6 +509,7 @@ class Calculation
if ($cellAddress === null) {
throw new Exception('null cellAddress in calculateCellValue');
}
+ /** @var array{sheet: string, cell: string} $cellAddress */
$testSheet = $this->spreadsheet->getSheetByName($cellAddress['sheet']);
if ($testSheet === null) {
throw new Exception('worksheet not found in calculateCellValue');
@@ -3553,8 +520,10 @@ class Calculation
$cellAddress = array_pop($this->cellStack);
}
if ($this->spreadsheet !== null && is_array($cellAddress) && array_key_exists('sheet', $cellAddress)) {
- $testSheet = $this->spreadsheet->getSheetByName($cellAddress['sheet']);
+ $sheetName = $cellAddress['sheet'] ?? null;
+ $testSheet = is_string($sheetName) ? $this->spreadsheet->getSheetByName($sheetName) : null;
if ($testSheet !== null && array_key_exists('cell', $cellAddress)) {
+ /** @var array{cell: string} $cellAddress */
$testSheet->getCell($cellAddress['cell']);
}
}
@@ -3583,6 +552,8 @@ class Calculation
* Validate and parse a formula string.
*
* @param string $formula Formula to parse
+ *
+ * @return array|bool
*/
public function parseFormula(string $formula): array|bool
{
@@ -3750,22 +721,35 @@ class Calculation
* Ensure that paired matrix operands are both matrices and of the same size.
*
* @param mixed $operand1 First matrix operand
+ *
+ * @param-out mixed[] $operand1
+ *
* @param mixed $operand2 Second matrix operand
+ *
+ * @param-out mixed[] $operand2
+ *
* @param int $resize Flag indicating whether the matrices should be resized to match
* and (if so), whether the smaller dimension should grow or the
* larger should shrink.
* 0 = no resize
* 1 = shrink to fit
* 2 = extend to fit
+ *
+ * @return mixed[]
*/
public static function checkMatrixOperands(mixed &$operand1, mixed &$operand2, int $resize = 1): array
{
// Examine each of the two operands, and turn them into an array if they aren't one already
// Note that this function should only be called if one or both of the operand is already an array
if (!is_array($operand1)) {
- [$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand2);
- $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
- $resize = 0;
+ if (is_array($operand2)) {
+ [$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand2);
+ $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
+ $resize = 0;
+ } else {
+ $operand1 = [$operand1];
+ $operand2 = [$operand2];
+ }
} elseif (!is_array($operand2)) {
[$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand1);
$operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
@@ -3785,6 +769,8 @@ class Calculation
self::resizeMatricesExtend($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
} elseif ($resize == 1) {
// Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
+ /** @var mixed[][] $operand1 */
+ /** @var mixed[][] $operand2 */
self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
}
[$matrix1Rows, $matrix1Columns] = self::getMatrixDimensions($operand1);
@@ -3796,7 +782,7 @@ class Calculation
/**
* Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
*
- * @param array $matrix matrix operand
+ * @param mixed[] $matrix matrix operand
*
* @return int[] An array comprising the number of rows, and number of columns
*/
@@ -3821,8 +807,8 @@ class Calculation
/**
* Ensure that paired matrix operands are both matrices of the same size.
*
- * @param array $matrix1 First matrix operand
- * @param array $matrix2 Second matrix operand
+ * @param mixed[][] $matrix1 First matrix operand
+ * @param mixed[][] $matrix2 Second matrix operand
* @param int $matrix1Rows Row size of first matrix operand
* @param int $matrix1Columns Column size of first matrix operand
* @param int $matrix2Rows Row size of second matrix operand
@@ -3864,8 +850,8 @@ class Calculation
/**
* Ensure that paired matrix operands are both matrices of the same size.
*
- * @param array $matrix1 First matrix operand
- * @param array $matrix2 Second matrix operand
+ * @param mixed[] $matrix1 First matrix operand
+ * @param mixed[] $matrix2 Second matrix operand
* @param int $matrix1Rows Row size of first matrix operand
* @param int $matrix1Columns Column size of first matrix operand
* @param int $matrix2Rows Row size of second matrix operand
@@ -3876,15 +862,16 @@ class Calculation
if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
if ($matrix2Columns < $matrix1Columns) {
for ($i = 0; $i < $matrix2Rows; ++$i) {
- $x = $matrix2[$i][$matrix2Columns - 1];
+ /** @var mixed[][] $matrix2 */
+ $x = ($matrix2Columns === 1) ? $matrix2[$i][0] : null;
for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
$matrix2[$i][$j] = $x;
}
}
}
if ($matrix2Rows < $matrix1Rows) {
- $x = $matrix2[$matrix2Rows - 1];
- for ($i = 0; $i < $matrix1Rows; ++$i) {
+ $x = ($matrix2Rows === 1) ? $matrix2[0] : array_fill(0, $matrix2Columns, null);
+ for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
$matrix2[$i] = $x;
}
}
@@ -3893,15 +880,16 @@ class Calculation
if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
if ($matrix1Columns < $matrix2Columns) {
for ($i = 0; $i < $matrix1Rows; ++$i) {
- $x = $matrix1[$i][$matrix1Columns - 1];
+ /** @var mixed[][] $matrix1 */
+ $x = ($matrix1Columns === 1) ? $matrix1[$i][0] : null;
for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
$matrix1[$i][$j] = $x;
}
}
}
if ($matrix1Rows < $matrix2Rows) {
- $x = $matrix1[$matrix1Rows - 1];
- for ($i = 0; $i < $matrix2Rows; ++$i) {
+ $x = ($matrix1Rows === 1) ? $matrix1[0] : array_fill(0, $matrix2Columns, null);
+ for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
$matrix1[$i] = $x;
}
}
@@ -3970,6 +958,7 @@ class Calculation
} elseif (is_array($value)) {
$typeString = 'a matrix';
} else {
+ /** @var string $value */
if ($value == '') {
return 'an empty string';
} elseif ($value[0] == '#') {
@@ -3978,20 +967,20 @@ class Calculation
$typeString = 'a string';
}
- return $typeString . ' with a value of ' . $this->showValue($value);
+ return $typeString . ' with a value of ' . StringHelper::convertToString($this->showValue($value));
}
return null;
}
+ private const MATRIX_REPLACE_FROM = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
+ private const MATRIX_REPLACE_TO = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
+
/**
* @return false|string False indicates an error
*/
private function convertMatrixReferences(string $formula): false|string
{
- static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
- static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
-
// Convert any Excel matrix references to the MKMATRIX() function
if (str_contains($formula, self::FORMULA_OPEN_MATRIX_BRACE)) {
// If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
@@ -4008,7 +997,7 @@ class Calculation
if ($notWithinQuotes === true) {
$openCount += substr_count($value, self::FORMULA_OPEN_MATRIX_BRACE);
$closeCount += substr_count($value, self::FORMULA_CLOSE_MATRIX_BRACE);
- $value = str_replace($matrixReplaceFrom, $matrixReplaceTo, $value);
+ $value = str_replace(self::MATRIX_REPLACE_FROM, self::MATRIX_REPLACE_TO, $value);
}
}
unset($value);
@@ -4018,7 +1007,7 @@ class Calculation
// If there's no quoted strings, then we do a simple count/replace
$openCount = substr_count($formula, self::FORMULA_OPEN_MATRIX_BRACE);
$closeCount = substr_count($formula, self::FORMULA_CLOSE_MATRIX_BRACE);
- $formula = str_replace($matrixReplaceFrom, $matrixReplaceTo, $formula);
+ $formula = str_replace(self::MATRIX_REPLACE_FROM, self::MATRIX_REPLACE_TO, $formula);
}
// Trap for mismatched braces and trigger an appropriate error
if ($openCount < $closeCount) {
@@ -4039,32 +1028,18 @@ class Calculation
return $formula;
}
- /**
- * Binary Operators.
- * These operators always work on two values.
- * Array key is the operator, the value indicates whether this is a left or right associative operator.
- */
- private static array $operatorAssociativity = [
- '^' => 0, // Exponentiation
- '*' => 0, '/' => 0, // Multiplication and Division
- '+' => 0, '-' => 0, // Addition and Subtraction
- '&' => 0, // Concatenation
- '∪' => 0, '∩' => 0, ':' => 0, // Union, Intersect and Range
- '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
- ];
-
/**
* Comparison (Boolean) Operators.
* These operators work on two values, but always return a boolean result.
*/
- private static array $comparisonOperators = ['>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true];
+ private const COMPARISON_OPERATORS = ['>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true];
/**
* Operator Precedence.
* This list includes all valid operators, whether binary (including boolean) or unary (such as %).
* Array key is the operator, the value is its precedence.
*/
- private static array $operatorPrecedence = [
+ private const OPERATOR_PRECEDENCE = [
':' => 9, // Range
'∩' => 8, // Intersect
'∪' => 7, // Union
@@ -4077,8 +1052,6 @@ class Calculation
'>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
];
- // Convert infix to postfix notation
-
/**
* @return array|false
*/
@@ -4087,6 +1060,7 @@ class Calculation
if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
return false;
}
+ $phpSpreadsheetFunctions = &self::getFunctionsAddress();
// If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet),
// so we store the parent worksheet so that we can re-attach it when necessary
@@ -4121,9 +1095,13 @@ class Calculation
$this->branchPruner->initialiseForLoop();
$opCharacter = $formula[$index]; // Get the first character of the value at the current index position
+ if ($opCharacter === "\xe2") { // intersection or union
+ $opCharacter .= $formula[++$index];
+ $opCharacter .= $formula[++$index];
+ }
// Check for two-character operators (e.g. >=, <=, <>)
- if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && isset($formula[$index + 1], self::$comparisonOperators[$formula[$index + 1]])) {
+ if ((isset(self::COMPARISON_OPERATORS[$opCharacter])) && (strlen($formula) > $index) && isset($formula[$index + 1], self::COMPARISON_OPERATORS[$formula[$index + 1]])) {
$opCharacter .= $formula[++$index];
}
// Find out if we're currently at the beginning of a number, variable, cell/row/column reference,
@@ -4141,16 +1119,11 @@ class Calculation
++$index;
} elseif ($opCharacter === '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded?
++$index; // Drop the redundant plus symbol
- } elseif ((($opCharacter === '~') || ($opCharacter === '∩') || ($opCharacter === '∪')) && (!$isOperandOrFunction)) {
+ } elseif ((($opCharacter === '~') /*|| ($opCharacter === '∩') || ($opCharacter === '∪')*/) && (!$isOperandOrFunction)) {
// We have to explicitly deny a tilde, union or intersect because they are legal
return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression
} elseif ((isset(self::CALCULATION_OPERATORS[$opCharacter]) || $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack?
- while (
- $stack->count() > 0
- && ($o2 = $stack->last())
- && isset(self::CALCULATION_OPERATORS[$o2['value']])
- && @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])
- ) {
+ while (self::swapOperands($stack, $opCharacter)) {
$output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
}
@@ -4170,7 +1143,7 @@ class Calculation
// call or a parenthesis
$this->branchPruner->decrementDepth();
- if (is_array($d) && preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $d['value'], $matches)) {
+ if (is_array($d) && preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', StringHelper::convertToString($d['value']), $matches)) {
// Did this parenthesis just close a function?
try {
$this->branchPruner->closingBrace($d['value']);
@@ -4185,8 +1158,8 @@ class Calculation
$output[] = $stack->pop(); // Pop the function and push onto the output
if (isset(self::$controlFunctions[$functionName])) {
$expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount'];
- } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) {
- $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount'];
+ } elseif (isset($phpSpreadsheetFunctions[$functionName])) {
+ $expectedArgumentCount = $phpSpreadsheetFunctions[$functionName]['argumentCount'];
} else { // did we somehow push a non-function on the stack? this should never happen
return $this->raiseFormulaError('Formula Error: Internal error, non-function on stack');
}
@@ -4205,7 +1178,7 @@ class Calculation
$expectedArgumentCountString = $expectedArgumentCount;
}
}
- } elseif ($expectedArgumentCount != '*') {
+ } elseif (is_string($expectedArgumentCount) && $expectedArgumentCount !== '*') {
if (1 !== preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch)) {
$argMatch = ['', '', '', ''];
}
@@ -4234,6 +1207,7 @@ class Calculation
}
}
if ($argumentCountError) {
+ /** @var int $argumentCount */
return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, " . $expectedArgumentCountString . ' expected');
}
}
@@ -4255,15 +1229,26 @@ class Calculation
}
// make sure there was a function
$d = $stack->last(2);
- if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $d['value'] ?? '', $matches)) {
+ /** @var string */
+ $temp = $d['value'] ?? '';
+ if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $temp, $matches)) {
// Can we inject a dummy function at this point so that the braces at least have some context
// because at least the braces are paired up (at this stage in the formula)
// MS Excel allows this if the content is cell references; but doesn't allow actual values,
// but at this point, we can't differentiate (so allow both)
return $this->raiseFormulaError('Formula Error: Unexpected ,');
+ /* The following code may be a better choice, but, with
+ the other changes for this PR, I can no longer come up
+ with a test case that gets here
+ $stack->push('Binary Operator', '∪');
+
+ ++$index;
+ $expectingOperator = false;
+
+ continue;*/
}
- /** @var array $d */
+ /** @var array $d */
$d = $stack->pop();
++$d['value']; // increment the argument count
@@ -4287,7 +1272,7 @@ class Calculation
if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $val, $matches)) {
$val = (string) preg_replace('/\s/u', '', $val);
- if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function
+ if (isset($phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function
$valToUpper = strtoupper($val);
} else {
$valToUpper = 'NAME.ERROR(';
@@ -4323,6 +1308,7 @@ class Calculation
// Do we have chained range operators?
$rangeStartCellRef = $output[count($output) - 2]['value'] ?? '';
}
+ /** @var string $rangeStartCellRef */
preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/miu', $rangeStartCellRef, $rangeStartMatches);
if (array_key_exists(2, $rangeStartMatches)) {
if ($rangeStartMatches[2] > '') {
@@ -4337,6 +1323,7 @@ class Calculation
// Do we have chained range operators?
$rangeStartCellRef = $output[count($output) - 2]['value'] ?? '';
}
+ /** @var string $rangeStartCellRef */
preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/miu', $rangeStartCellRef, $rangeStartMatches);
if (isset($rangeStartMatches[2]) && $rangeStartMatches[2] !== $matches[2]) {
return $this->raiseFormulaError('3D Range references are not yet supported');
@@ -4439,15 +1426,15 @@ class Calculation
}
} elseif ($opCharacter === self::FORMULA_STRING_QUOTE) {
// UnEscape any quotes within the string
- $val = self::wrapResult(str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($val)));
- } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) {
+ $val = self::wrapResult(str_replace('""', self::FORMULA_STRING_QUOTE, StringHelper::convertToString(self::unwrapResult($val))));
+ } elseif (isset(self::EXCEL_CONSTANTS[trim(strtoupper($val))])) {
$stackItemType = 'Constant';
$excelConstant = trim(strtoupper($val));
- $val = self::$excelConstants[$excelConstant];
+ $val = self::EXCEL_CONSTANTS[$excelConstant];
$stackItemReference = $excelConstant;
} elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) {
$stackItemType = 'Constant';
- $val = self::$excelConstants[$localeConstant];
+ $val = self::EXCEL_CONSTANTS[$localeConstant];
$stackItemReference = $localeConstant;
} elseif (
preg_match('/^' . self::CALCULATION_REGEXP_ROW_RANGE . '/miu', substr($formula, $index), $rowRangeReference)
@@ -4547,12 +1534,7 @@ class Calculation
&& ($output[$countOutputMinus1]['type'] === Operands\StructuredReference::NAME || $output[$countOutputMinus1]['type'] === 'Value')
)
) {
- while (
- $stack->count() > 0
- && ($o2 = $stack->last())
- && isset(self::CALCULATION_OPERATORS[$o2['value']])
- && @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])
- ) {
+ while (self::swapOperands($stack, $opCharacter)) {
$output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
}
$stack->push('Binary Operator', '∩'); // Put an Intersect Operator on the stack
@@ -4572,6 +1554,7 @@ class Calculation
return $output;
}
+ /** @param mixed[] $operandData */
private static function dataTestReference(array &$operandData): mixed
{
$operand = $operandData['value'];
@@ -4601,13 +1584,16 @@ class Calculation
private static int $matchIndex10 = 10;
/**
+ * @param array|false $tokens
+ *
* @return array|false|string
*/
- private function processTokenStack(mixed $tokens, ?string $cellID = null, ?Cell $cell = null)
+ private function processTokenStack(false|array $tokens, ?string $cellID = null, ?Cell $cell = null)
{
if ($tokens === false) {
return false;
}
+ $phpSpreadsheetFunctions = &self::getFunctionsAddress();
// If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection),
// so we store the parent cell collection so that we can re-attach it when necessary
@@ -4622,14 +1608,17 @@ class Calculation
$branchStore = [];
// Loop through each token in turn
foreach ($tokens as $tokenIdx => $tokenData) {
+ /** @var mixed[] $tokenData */
$this->processingAnchorArray = false;
- if ($tokenData['type'] === 'Cell Reference' && isset($tokens[$tokenIdx + 1]) && $tokens[$tokenIdx + 1]['type'] === 'Operand Count for Function ANCHORARRAY()') {
+ if ($tokenData['type'] === 'Cell Reference' && isset($tokens[$tokenIdx + 1]) && $tokens[$tokenIdx + 1]['type'] === 'Operand Count for Function ANCHORARRAY()') { //* @phpstan-ignore-line
$this->processingAnchorArray = true;
}
$token = $tokenData['value'];
// Branch pruning: skip useless resolutions
+ /** @var ?string */
$storeKey = $tokenData['storeKey'] ?? null;
if ($this->branchPruningEnabled && isset($tokenData['onlyIf'])) {
+ /** @var string */
$onlyIfStoreKey = $tokenData['onlyIf'];
$storeValue = $branchStore[$onlyIfStoreKey] ?? null;
$storeValueAsBool = ($storeValue === null)
@@ -4644,7 +1633,9 @@ class Calculation
&& (!$storeValueAsBool || Information\ErrorValue::isError($storeValue) || ($storeValue === 'Pruned branch'))
) {
// If branching value is not true, we don't need to compute
+ /** @var string $onlyIfStoreKey */
if (!isset($fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey])) {
+ /** @var string $token */
$stack->push('Value', 'Pruned branch (only if ' . $onlyIfStoreKey . ') ' . $token);
$fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey] = true;
}
@@ -4662,6 +1653,7 @@ class Calculation
}
if ($this->branchPruningEnabled && isset($tokenData['onlyIfNot'])) {
+ /** @var string */
$onlyIfNotStoreKey = $tokenData['onlyIfNot'];
$storeValue = $branchStore[$onlyIfNotStoreKey] ?? null;
$storeValueAsBool = ($storeValue === null)
@@ -4677,6 +1669,7 @@ class Calculation
) {
// If branching value is true, we don't need to compute
if (!isset($fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey])) {
+ /** @var string $token */
$stack->push('Value', 'Pruned branch (only if not ' . $onlyIfNotStoreKey . ') ' . $token);
$fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey] = true;
}
@@ -4719,7 +1712,7 @@ class Calculation
return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
}
}
- } elseif (!is_numeric($token) && !is_object($token) && isset(self::BINARY_OPERATORS[$token])) {
+ } elseif (!is_numeric($token) && !is_object($token) && isset($token, self::BINARY_OPERATORS[$token])) { //* @phpstan-ignore-line
// if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
// We must have two operands, error if we don't
$operand2Data = $stack->pop();
@@ -4758,27 +1751,43 @@ class Calculation
break;
// Binary Operators
case ':': // Range
+ if ($operand1Data['type'] === 'Error') {
+ $stack->push($operand1Data['type'], $operand1Data['value'], null);
+
+ break;
+ }
+ if ($operand2Data['type'] === 'Error') {
+ $stack->push($operand2Data['type'], $operand2Data['value'], null);
+
+ break;
+ }
if ($operand1Data['type'] === 'Defined Name') {
+ /** @var array{reference: string} $operand1Data */
if (preg_match('/$' . self::CALCULATION_REGEXP_DEFINEDNAME . '^/mui', $operand1Data['reference']) !== false && $this->spreadsheet !== null) {
+ /** @var string[] $operand1Data */
$definedName = $this->spreadsheet->getNamedRange($operand1Data['reference']);
if ($definedName !== null) {
$operand1Data['reference'] = $operand1Data['value'] = str_replace('$', '', $definedName->getValue());
}
}
}
+ /** @var array{reference?: ?string} $operand1Data */
if (str_contains($operand1Data['reference'] ?? '', '!')) {
[$sheet1, $operand1Data['reference']] = Worksheet::extractSheetTitle($operand1Data['reference'], true, true);
} else {
$sheet1 = ($pCellWorksheet !== null) ? $pCellWorksheet->getTitle() : '';
}
- $sheet1 ??= '';
+ //$sheet1 ??= ''; // phpstan level 10 says this is unneeded
- [$sheet2, $operand2Data['reference']] = Worksheet::extractSheetTitle($operand2Data['reference'], true, true);
+ /** @var string */
+ $op2ref = $operand2Data['reference'];
+ [$sheet2, $operand2Data['reference']] = Worksheet::extractSheetTitle($op2ref, true, true);
if (empty($sheet2)) {
$sheet2 = $sheet1;
}
if ($sheet1 === $sheet2) {
+ /** @var array{reference: ?string, value: string|string[]} $operand1Data */
if ($operand1Data['reference'] === null && $cell !== null) {
if (is_array($operand1Data['value'])) {
$operand1Data['reference'] = $cell->getCoordinate();
@@ -4790,6 +1799,7 @@ class Calculation
$operand1Data['reference'] = $operand1Data['value'] . $cell->getRow();
}
}
+ /** @var array{reference: ?string, value: string|string[]} $operand2Data */
if ($operand2Data['reference'] === null && $cell !== null) {
if (is_array($operand2Data['value'])) {
$operand2Data['reference'] = $cell->getCoordinate();
@@ -4864,15 +1874,19 @@ class Calculation
for ($row = 0; $row < $rows; ++$row) {
for ($column = 0; $column < $columns; ++$column) {
+ /** @var mixed[][] $operand1 */
$op1x = self::boolToString($operand1[$row][$column]);
+ /** @var mixed[][] $operand2 */
$op2x = self::boolToString($operand2[$row][$column]);
if (Information\ErrorValue::isError($op1x)) {
// no need to do anything
} elseif (Information\ErrorValue::isError($op2x)) {
$operand1[$row][$column] = $op2x;
} else {
+ /** @var string $op1x */
+ /** @var string $op2x */
$operand1[$row][$column]
- = Shared\StringHelper::substring(
+ = StringHelper::substring(
$op1x . $op2x,
0,
DataType::MAX_STRING_LENGTH
@@ -4887,8 +1901,8 @@ class Calculation
} elseif (Information\ErrorValue::isError($operand2)) {
$result = $operand2;
} else {
- $result = str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($operand1) . self::unwrapResult($operand2));
- $result = Shared\StringHelper::substring(
+ $result = str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($operand1) . self::unwrapResult($operand2)); //* @phpstan-ignore-line
+ $result = StringHelper::substring(
$result,
0,
DataType::MAX_STRING_LENGTH
@@ -4905,6 +1919,8 @@ class Calculation
break;
case '∩': // Intersect
+ /** @var mixed[][] $operand1 */
+ /** @var mixed[][] $operand2 */
$rowIntersect = array_intersect_key($operand1, $operand2);
$cellIntersect = $oCol = $oRow = [];
foreach (array_keys($rowIntersect) as $row) {
@@ -4924,6 +1940,14 @@ class Calculation
$stack->push('Value', $cellIntersect, $cellRef);
}
+ break;
+ case '∪': // union
+ /** @var mixed[][] $operand1 */
+ /** @var mixed[][] $operand2 */
+ $cellUnion = array_merge($operand1, $operand2);
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellUnion));
+ $stack->push('Value', $cellUnion, 'A1');
+
break;
}
} elseif (($token === '~') || ($token === '%')) {
@@ -4945,8 +1969,11 @@ class Calculation
[$rows, $columns] = self::checkMatrixOperands($result, $operand2, 0);
for ($row = 0; $row < $rows; ++$row) {
for ($column = 0; $column < $columns; ++$column) {
+ /** @var mixed[][] $result */
if (self::isNumericOrBool($result[$row][$column])) {
- $result[$row][$column] *= $multiplier;
+ /** @var float|int|numeric-string */
+ $temp = $result[$row][$column];
+ $result[$row][$column] = $temp * $multiplier;
} else {
$result[$row][$column] = self::makeError($result[$row][$column]);
}
@@ -4961,7 +1988,7 @@ class Calculation
} else {
$this->executeNumericBinaryOperation($multiplier, $arg, '*', $stack);
}
- } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token ?? '', $matches)) {
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', StringHelper::convertToString($token ?? ''), $matches)) {
$cellRef = null;
/* Phpstan says matches[8/9/10] is never set,
@@ -5014,6 +2041,9 @@ class Calculation
$this->debugLog->writeDebugLog('Evaluating Cell %s in worksheet %s', $cellRef, $matches[2]);
if ($pCellParent !== null && $this->spreadsheet !== null) {
$cellSheet = $this->spreadsheet->getSheetByName($matches[2]);
+ if ($cellSheet && !$cellSheet->cellExists($cellRef)) {
+ $cellSheet->setCellValue($cellRef, null);
+ }
if ($cellSheet && $cellSheet->cellExists($cellRef)) {
$cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
$cell->attach($pCellParent);
@@ -5052,27 +2082,27 @@ class Calculation
if (isset($storeKey)) {
$branchStore[$storeKey] = $cellValue;
}
- } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $token ?? '', $matches)) {
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', StringHelper::convertToString($token ?? ''), $matches)) {
// if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
if ($cell !== null && $pCellParent !== null) {
$cell->attach($pCellParent);
}
$functionName = $matches[1];
- /** @var array $argCount */
+ /** @var array $argCount */
$argCount = $stack->pop();
$argCount = $argCount['value'];
if ($functionName !== 'MKMATRIX') {
$this->debugLog->writeDebugLog('Evaluating Function %s() with %s argument%s', self::localeFunc($functionName), (($argCount == 0) ? 'no' : $argCount), (($argCount == 1) ? '' : 's'));
}
- if ((isset(self::$phpSpreadsheetFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function
+ if ((isset($phpSpreadsheetFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function
$passByReference = false;
$passCellReference = false;
$functionCall = null;
- if (isset(self::$phpSpreadsheetFunctions[$functionName])) {
- $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall'];
- $passByReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference']);
- $passCellReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passCellReference']);
+ if (isset($phpSpreadsheetFunctions[$functionName])) {
+ $functionCall = $phpSpreadsheetFunctions[$functionName]['functionCall'];
+ $passByReference = isset($phpSpreadsheetFunctions[$functionName]['passByReference']);
+ $passCellReference = isset($phpSpreadsheetFunctions[$functionName]['passCellReference']);
} elseif (isset(self::$controlFunctions[$functionName])) {
$functionCall = self::$controlFunctions[$functionName]['functionCall'];
$passByReference = isset(self::$controlFunctions[$functionName]['passByReference']);
@@ -5087,10 +2117,10 @@ class Calculation
$a = $argCount - $i - 1;
if (
($passByReference)
- && (isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a]))
- && (self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])
+ && (isset($phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) //* @phpstan-ignore-line
+ && ($phpSpreadsheetFunctions[$functionName]['passByReference'][$a])
) {
- /** @var array $arg */
+ /** @var mixed[] $arg */
if ($arg['reference'] === null) {
$nextArg = $cellID;
if ($functionName === 'ISREF' && ($arg['type'] ?? '') === 'Value') {
@@ -5102,6 +2132,13 @@ class Calculation
$nextArg = '';
}
}
+ } elseif (($arg['type'] ?? '') === 'Error') {
+ $argValue = $arg['value'];
+ if (is_scalar($argValue)) {
+ $nextArg = $argValue;
+ } elseif (empty($argValue)) {
+ $nextArg = '';
+ }
}
$args[] = $nextArg;
if ($functionName !== 'MKMATRIX') {
@@ -5114,7 +2151,7 @@ class Calculation
}
}
} else {
- /** @var array $arg */
+ /** @var mixed[] $arg */
if ($arg['type'] === 'Empty Argument' && in_array($functionName, ['MIN', 'MINA', 'MAX', 'MAXA', 'IF'], true)) {
$emptyArguments[] = false;
$args[] = $arg['value'] = 0;
@@ -5134,7 +2171,9 @@ class Calculation
krsort($emptyArguments);
if ($argCount > 0 && is_array($functionCall)) {
- $args = $this->addDefaultArgumentValues($functionCall, $args, $emptyArguments);
+ /** @var string[] */
+ $functionCallCopy = $functionCall;
+ $args = $this->addDefaultArgumentValues($functionCallCopy, $args, $emptyArguments);
}
if (($passByReference) && ($argCount == 0)) {
@@ -5153,6 +2192,7 @@ class Calculation
if ($pCellWorksheet !== null && $originalCoordinate !== null) {
$pCellWorksheet->getCell($originalCoordinate);
}
+ /** @var array|string $functionCall */
$args = $this->addCellReference($args, $passCellReference, $functionCall, $cell);
if (!is_array($functionCall)) {
@@ -5162,8 +2202,15 @@ class Calculation
unset($arg);
}
- $result = call_user_func_array($functionCall, $args);
-
+ /** @var callable $functionCall */
+ try {
+ $result = call_user_func_array($functionCall, $args);
+ } catch (TypeError $e) {
+ if (!$this->suppressFormulaErrors) {
+ throw $e;
+ }
+ $result = false;
+ }
if ($functionName !== 'MKMATRIX') {
$this->debugLog->writeDebugLog('Evaluation Result for %s() function call is %s', self::localeFunc($functionName), $this->showTypeDetails($result));
}
@@ -5174,14 +2221,16 @@ class Calculation
}
} else {
// if the token is a number, boolean, string or an Excel error, push it onto the stack
- if (isset(self::$excelConstants[strtoupper($token ?? '')])) {
- $excelConstant = strtoupper($token);
- $stack->push('Constant Value', self::$excelConstants[$excelConstant]);
+ /** @var ?string $token */
+ if (isset(self::EXCEL_CONSTANTS[strtoupper($token ?? '')])) {
+ $excelConstant = strtoupper("$token");
+ $stack->push('Constant Value', self::EXCEL_CONSTANTS[$excelConstant]);
if (isset($storeKey)) {
- $branchStore[$storeKey] = self::$excelConstants[$excelConstant];
+ $branchStore[$storeKey] = self::EXCEL_CONSTANTS[$excelConstant];
}
- $this->debugLog->writeDebugLog('Evaluating Constant %s as %s', $excelConstant, $this->showTypeDetails(self::$excelConstants[$excelConstant]));
- } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == self::FORMULA_STRING_QUOTE) || ($token[0] == '#')) {
+ $this->debugLog->writeDebugLog('Evaluating Constant %s as %s', $excelConstant, $this->showTypeDetails(self::EXCEL_CONSTANTS[$excelConstant]));
+ } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == self::FORMULA_STRING_QUOTE) || ($token[0] == '#')) { //* @phpstan-ignore-line
+ /** @var array{type: string, reference: ?string} $tokenData */
$stack->push($tokenData['type'], $token, $tokenData['reference']);
if (isset($storeKey)) {
$branchStore[$storeKey] = $token;
@@ -5220,11 +2269,13 @@ class Calculation
}
}
if ($namedRange === null) {
- return $this->raiseFormulaError("undefined name '$definedName'");
+ $result = ExcelError::NAME();
+ $stack->push('Error', $result, null);
+ $this->debugLog->writeDebugLog("Error $result");
+ } else {
+ $result = $this->evaluateDefinedName($cell, $namedRange, $pCellWorksheet, $stack, $specifiedWorksheet !== '');
}
- $result = $this->evaluateDefinedName($cell, $namedRange, $pCellWorksheet, $stack, $specifiedWorksheet !== '');
-
if (isset($storeKey)) {
$branchStore[$storeKey] = $result;
}
@@ -5237,14 +2288,14 @@ class Calculation
if ($stack->count() != 1) {
return $this->raiseFormulaError('internal error');
}
- /** @var array $output */
+ /** @var array|false|string> */
$output = $stack->pop();
$output = $output['value'];
return $output;
}
- private function validateBinaryOperand(mixed &$operand, mixed &$stack): bool
+ private function validateBinaryOperand(mixed &$operand, Stack &$stack): bool
{
if (is_array($operand)) {
if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
@@ -5258,7 +2309,7 @@ class Calculation
// We only need special validations for the operand if it is a string
// Start by stripping off the quotation marks we use to identify true excel string values internally
if ($operand > '' && $operand[0] == self::FORMULA_STRING_QUOTE) {
- $operand = self::unwrapResult($operand);
+ $operand = StringHelper::convertToString(self::unwrapResult($operand));
}
// If the string is a numeric value, we treat it as a numeric, so no further testing
if (!is_numeric($operand)) {
@@ -5282,28 +2333,29 @@ class Calculation
return true;
}
+ /** @return mixed[] */
private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
{
$result = [];
- if (!is_array($operand2)) {
+ if (!is_array($operand2) && is_array($operand1)) {
// Operand 1 is an array, Operand 2 is a scalar
foreach ($operand1 as $x => $operandData) {
$this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operandData), $operation, $this->showValue($operand2));
$this->executeBinaryComparisonOperation($operandData, $operand2, $operation, $stack);
- /** @var array $r */
+ /** @var array $r */
$r = $stack->pop();
$result[$x] = $r['value'];
}
- } elseif (!is_array($operand1)) {
+ } elseif (is_array($operand2) && !is_array($operand1)) {
// Operand 1 is a scalar, Operand 2 is an array
foreach ($operand2 as $x => $operandData) {
$this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operand1), $operation, $this->showValue($operandData));
$this->executeBinaryComparisonOperation($operand1, $operandData, $operation, $stack);
- /** @var array $r */
+ /** @var array $r */
$r = $stack->pop();
$result[$x] = $r['value'];
}
- } else {
+ } elseif (is_array($operand2) && is_array($operand1)) {
// Operand 1 and Operand 2 are both arrays
if (!$recursingArrays) {
self::checkMatrixOperands($operand1, $operand2, 2);
@@ -5311,10 +2363,12 @@ class Calculation
foreach ($operand1 as $x => $operandData) {
$this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operandData), $operation, $this->showValue($operand2[$x]));
$this->executeBinaryComparisonOperation($operandData, $operand2[$x], $operation, $stack, true);
- /** @var array $r */
+ /** @var array $r */
$r = $stack->pop();
$result[$x] = $r['value'];
}
+ } else {
+ throw new Exception('Neither operand is an arra');
}
// Log the result details
$this->debugLog->writeDebugLog('Comparison Evaluation Result is %s', $this->showTypeDetails($result));
@@ -5324,6 +2378,7 @@ class Calculation
return $result;
}
+ /** @return bool|mixed[] */
private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
{
// If we're dealing with matrix operations, we want a matrix result
@@ -5373,43 +2428,49 @@ class Calculation
for ($row = 0; $row < $rows; ++$row) {
for ($column = 0; $column < $columns; ++$column) {
- if ($operand1[$row][$column] === null) {
+ /** @var mixed[][] $operand1 */
+ if (($operand1[$row][$column] ?? null) === null) {
$operand1[$row][$column] = 0;
} elseif (!self::isNumericOrBool($operand1[$row][$column])) {
$operand1[$row][$column] = self::makeError($operand1[$row][$column]);
continue;
}
- if ($operand2[$row][$column] === null) {
+ /** @var mixed[][] $operand2 */
+ if (($operand2[$row][$column] ?? null) === null) {
$operand2[$row][$column] = 0;
} elseif (!self::isNumericOrBool($operand2[$row][$column])) {
$operand1[$row][$column] = self::makeError($operand2[$row][$column]);
continue;
}
+ /** @var float|int */
+ $operand1Val = $operand1[$row][$column];
+ /** @var float|int */
+ $operand2Val = $operand2[$row][$column];
switch ($operation) {
case '+':
- $operand1[$row][$column] += $operand2[$row][$column];
+ $operand1[$row][$column] = $operand1Val + $operand2Val;
break;
case '-':
- $operand1[$row][$column] -= $operand2[$row][$column];
+ $operand1[$row][$column] = $operand1Val - $operand2Val;
break;
case '*':
- $operand1[$row][$column] *= $operand2[$row][$column];
+ $operand1[$row][$column] = $operand1Val * $operand2Val;
break;
case '/':
- if ($operand2[$row][$column] == 0) {
+ if ($operand2Val == 0) {
$operand1[$row][$column] = ExcelError::DIV0();
} else {
- $operand1[$row][$column] /= $operand2[$row][$column];
+ $operand1[$row][$column] = $operand1Val / $operand2Val;
}
break;
case '^':
- $operand1[$row][$column] = $operand1[$row][$column] ** $operand2[$row][$column];
+ $operand1[$row][$column] = $operand1Val ** $operand2Val;
break;
@@ -5421,6 +2482,8 @@ class Calculation
$result = $operand1;
} else {
// If we're dealing with non-matrix operations, execute the necessary operation
+ /** @var float|int $operand1 */
+ /** @var float|int $operand2 */
switch ($operation) {
// Addition
case '+':
@@ -5478,6 +2541,8 @@ class Calculation
$this->formulaError = $errorMessage;
$this->cyclicReferenceStack->clear();
$suppress = $this->suppressFormulaErrors;
+ $suppressed = $suppress ? ' $suppressed' : '';
+ $this->debugLog->writeDebugLog("Raise Error$suppressed $errorMessage");
if (!$suppress) {
throw new Exception($errorMessage, $code, $exception);
}
@@ -5492,11 +2557,12 @@ class Calculation
* @param ?Worksheet $worksheet Worksheet
* @param bool $resetLog Flag indicating whether calculation log should be reset or not
*
- * @return array Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ * @return mixed[] Array of values in range if range contains more than one element. Otherwise, a single value is returned.
*/
- public function extractCellRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): array
+ public function extractCellRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true, bool $createCell = false): array
{
// Return value
+ /** @var mixed[][] */
$returnValue = [];
if ($worksheet !== null) {
@@ -5515,6 +2581,9 @@ class Calculation
if (!isset($aReferences[1])) {
// Single cell in range
sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
+ if ($createCell && $worksheet !== null && !$worksheet->cellExists($aReferences[0])) {
+ $worksheet->setCellValue($aReferences[0], null);
+ }
if ($worksheet !== null && $worksheet->cellExists($aReferences[0])) {
$temp = $worksheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
if ($this->getInstanceArrayReturnType() === self::RETURN_ARRAY_AS_ARRAY) {
@@ -5531,6 +2600,9 @@ class Calculation
foreach ($aReferences as $reference) {
// Extract range
sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
+ if ($createCell && $worksheet !== null && !$worksheet->cellExists($reference)) {
+ $worksheet->setCellValue($reference, null);
+ }
if ($worksheet !== null && $worksheet->cellExists($reference)) {
$temp = $worksheet->getCell($reference)->getCalculatedValue($resetLog);
if ($this->getInstanceArrayReturnType() === self::RETURN_ARRAY_AS_ARRAY) {
@@ -5556,7 +2628,7 @@ class Calculation
* @param null|Worksheet $worksheet Worksheet
* @param bool $resetLog Flag indicating whether calculation log should be reset or not
*
- * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ * @return mixed[]|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
*/
public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
{
@@ -5590,6 +2662,7 @@ class Calculation
if (!isset($aReferences[1])) {
// Single cell (or single column or row) in range
[$currentCol, $currentRow] = Coordinate::coordinateFromString($aReferences[0]);
+ /** @var mixed[][] $returnValue */
if ($worksheet !== null && $worksheet->cellExists($aReferences[0])) {
$returnValue[$currentRow][$currentCol] = $worksheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
} else {
@@ -5620,26 +2693,22 @@ class Calculation
public function isImplemented(string $function): bool
{
$function = strtoupper($function);
- $notImplemented = !isset(self::$phpSpreadsheetFunctions[$function]) || (is_array(self::$phpSpreadsheetFunctions[$function]['functionCall']) && self::$phpSpreadsheetFunctions[$function]['functionCall'][1] === 'DUMMY');
+ $phpSpreadsheetFunctions = &self::getFunctionsAddress();
+ $notImplemented = !isset($phpSpreadsheetFunctions[$function]) || (is_array($phpSpreadsheetFunctions[$function]['functionCall']) && $phpSpreadsheetFunctions[$function]['functionCall'][1] === 'DUMMY');
return !$notImplemented;
}
- /**
- * Get a list of all implemented functions as an array of function objects.
- */
- public static function getFunctions(): array
- {
- return self::$phpSpreadsheetFunctions;
- }
-
/**
* Get a list of implemented Excel function names.
+ *
+ * @return string[]
*/
public function getImplementedFunctionNames(): array
{
$returnValue = [];
- foreach (self::$phpSpreadsheetFunctions as $functionName => $function) {
+ $phpSpreadsheetFunctions = &self::getFunctionsAddress();
+ foreach ($phpSpreadsheetFunctions as $functionName => $function) {
if ($this->isImplemented($functionName)) {
$returnValue[] = $functionName;
}
@@ -5648,6 +2717,13 @@ class Calculation
return $returnValue;
}
+ /**
+ * @param string[] $functionCall
+ * @param mixed[] $args
+ * @param mixed[] $emptyArguments
+ *
+ * @return mixed[]
+ */
private function addDefaultArgumentValues(array $functionCall, array $args, array $emptyArguments): array
{
$reflector = new ReflectionMethod($functionCall[0], $functionCall[1]);
@@ -5698,6 +2774,11 @@ class Calculation
/**
* Add cell reference if needed while making sure that it is the last argument.
+ *
+ * @param mixed[] $args
+ * @param string|string[] $functionCall
+ *
+ * @return mixed[]
*/
private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array
{
@@ -5732,6 +2813,14 @@ class Calculation
$definedNameValue = $namedRange->getValue();
$definedNameType = $namedRange->isFormula() ? 'Formula' : 'Range';
+ if ($definedNameType === 'Range') {
+ if (preg_match('/^(.*!)?(.*)$/', $definedNameValue, $matches) === 1) {
+ $matches2 = trim($matches[2]);
+ $matches2 = preg_replace('/ +/', ' ∩ ', $matches2) ?? $matches2;
+ $matches2 = preg_replace('/,/', ' ∪ ', $matches2) ?? $matches2;
+ $definedNameValue = $matches[1] . $matches2;
+ }
+ }
$definedNameWorksheet = $namedRange->getWorksheet();
if ($definedNameValue[0] !== '=') {
@@ -5769,14 +2858,22 @@ class Calculation
$this->debugLog->writeDebugLog('Evaluation Result for Named %s %s is %s', $definedNameType, $namedRange->getName(), $this->showTypeDetails($result));
}
- $stack->push('Defined Name', $result, $namedRange->getName());
+ $y = $namedRange->getWorksheet()?->getTitle();
+ $x = $namedRange->getLocalOnly();
+ if ($x && $y !== null) {
+ $stack->push('Defined Name', $result, "'$y'!" . $namedRange->getName());
+ } else {
+ $stack->push('Defined Name', $result, $namedRange->getName());
+ }
return $result;
}
- public function setSuppressFormulaErrors(bool $suppressFormulaErrors): void
+ public function setSuppressFormulaErrors(bool $suppressFormulaErrors): self
{
$this->suppressFormulaErrors = $suppressFormulaErrors;
+
+ return $this;
}
public function getSuppressFormulaErrors(): bool
@@ -5802,6 +2899,27 @@ class Calculation
private static function makeError(mixed $operand = ''): string
{
- return Information\ErrorValue::isError($operand) ? $operand : ExcelError::VALUE();
+ return (is_string($operand) && Information\ErrorValue::isError($operand)) ? $operand : ExcelError::VALUE();
+ }
+
+ private static function swapOperands(Stack $stack, string $opCharacter): bool
+ {
+ $retVal = false;
+ if ($stack->count() > 0) {
+ $o2 = $stack->last();
+ if ($o2) {
+ /** @var array{value: string} $o2 */
+ if (isset(self::CALCULATION_OPERATORS[$o2['value']])) {
+ $retVal = (self::OPERATOR_PRECEDENCE[$opCharacter] ?? 0) <= self::OPERATOR_PRECEDENCE[$o2['value']];
+ }
+ }
+ }
+
+ return $retVal;
+ }
+
+ public function getSpreadsheet(): ?Spreadsheet
+ {
+ return $this->spreadsheet;
}
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DAverage.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DAverage.php
index e54f1bb..a85134e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DAverage.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DAverage.php
@@ -19,12 +19,12 @@ class DAverage extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCount.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCount.php
index fff7ab0..75b21dd 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCount.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCount.php
@@ -20,12 +20,12 @@ class DCount extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCountA.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCountA.php
index f1a68c1..23676bf 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCountA.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCountA.php
@@ -19,12 +19,12 @@ class DCountA extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DGet.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DGet.php
index dd0f006..719beaa 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DGet.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DGet.php
@@ -19,12 +19,12 @@ class DGet extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
@@ -42,6 +42,7 @@ class DGet extends DatabaseAbstract
return ExcelError::NAN();
}
+ /** @var array */
$row = array_pop($columnData);
return array_pop($row);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
index 23b95a7..a194288 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
@@ -20,12 +20,12 @@ class DMax extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMin.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMin.php
index 541803d..f94e09f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMin.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMin.php
@@ -20,12 +20,12 @@ class DMin extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DProduct.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DProduct.php
index b60aa0d..e7122d6 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DProduct.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DProduct.php
@@ -19,12 +19,12 @@ class DProduct extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php
index dc35405..a03ee2a 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php
@@ -20,12 +20,12 @@ class DStDev extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDevP.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDevP.php
index a05d596..54f1142 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDevP.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDevP.php
@@ -20,12 +20,12 @@ class DStDevP extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DSum.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DSum.php
index f9f926b..7396a0f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DSum.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DSum.php
@@ -19,12 +19,12 @@ class DSum extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVar.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVar.php
index 33b5b56..e056e9e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVar.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVar.php
@@ -20,12 +20,12 @@ class DVar extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVarP.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVarP.php
index 942a4a1..3bd571f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVarP.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVarP.php
@@ -20,12 +20,12 @@ class DVarP extends DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php
index 7f0b57d..052b9f5 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php
@@ -5,9 +5,26 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Database;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Internal\WildcardMatch;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
abstract class DatabaseAbstract
{
+ /**
+ * @param mixed[] $database The range of cells that makes up the list or database.
+ * A database is a list of related data in which rows of related
+ * information are records, and columns of data are fields. The
+ * first row of the list contains labels for each column.
+ * @param null|array|int|string $field Indicates which column is used in the function. Enter the
+ * column label enclosed between double quotation marks, such as
+ * "Age" or "Yield," or a number (without quotation marks) that
+ * represents the position of the column within the list: 1 for
+ * the first column, 2 for the second column, and so on.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * You can use any range for the criteria argument, as long as it
+ * includes at least one column label and at least one cell below
+ * the column label in which you specify a condition for the
+ * column.
+ */
abstract public static function evaluate(array $database, array|null|int|string $field, array $criteria): null|float|int|string;
/**
@@ -27,12 +44,16 @@ abstract class DatabaseAbstract
*/
protected static function fieldExtract(array $database, mixed $field): ?int
{
- $field = strtoupper(Functions::flattenSingleValue($field) ?? '');
+ /** @var ?string */
+ $single = Functions::flattenSingleValue($field);
+ $field = strtoupper($single ?? '');
if ($field === '') {
return null;
}
- $fieldNames = array_map('strtoupper', array_shift($database));
+ /** @var callable */
+ $callable = 'strtoupper';
+ $fieldNames = array_map($callable, array_shift($database)); //* @phpstan-ignore-line
if (is_numeric($field)) {
$field = (int) $field - 1;
if ($field < 0 || $field >= count($fieldNames)) {
@@ -56,7 +77,7 @@ abstract class DatabaseAbstract
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[][] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
@@ -66,16 +87,25 @@ abstract class DatabaseAbstract
*/
protected static function filter(array $database, array $criteria): array
{
+ /** @var mixed[] */
$fieldNames = array_shift($database);
$criteriaNames = array_shift($criteria);
// Convert the criteria into a set of AND/OR conditions with [:placeholders]
+ /** @var string[] $criteriaNames */
$query = self::buildQuery($criteriaNames, $criteria);
// Loop through each row of the database
+ /** @var mixed[][] $criteriaNames */
return self::executeQuery($database, $query, $criteriaNames, $fieldNames);
}
+ /**
+ * @param mixed[] $database The range of cells that makes up the list or database
+ * @param mixed[][] $criteria
+ *
+ * @return mixed[]
+ */
protected static function getFilteredColumn(array $database, ?int $field, array $criteria): array
{
// reduce the database to a set of rows that match all the criteria
@@ -84,16 +114,21 @@ abstract class DatabaseAbstract
// extract an array of values for the requested column
$columnData = [];
+ /** @var mixed[] $row */
foreach ($database as $rowKey => $row) {
$keys = array_keys($row);
- $key = $keys[$field] ?? null;
+ $key = ($field === null) ? null : ($keys[$field] ?? null);
$columnKey = $key ?? 'A';
- $columnData[$rowKey][$columnKey] = $row[$key] ?? $defaultReturnColumnValue;
+ $columnData[$rowKey][$columnKey] = ($key === null) ? $defaultReturnColumnValue : ($row[$key] ?? $defaultReturnColumnValue);
}
return $columnData;
}
+ /**
+ * @param string[] $criteriaNames
+ * @param mixed[][] $criteria
+ */
private static function buildQuery(array $criteriaNames, array $criteria): string
{
$baseQuery = [];
@@ -135,12 +170,21 @@ abstract class DatabaseAbstract
return $condition;
}
+ /**
+ * @param mixed[] $database
+ * @param mixed[][] $criteria
+ * @param array $fields
+ *
+ * @return mixed[]
+ */
private static function executeQuery(array $database, string $query, array $criteria, array $fields): array
{
foreach ($database as $dataRow => $dataValues) {
// Substitute actual values from the database row for our [:placeholders]
$conditions = $query;
foreach ($criteria as $criterion) {
+ /** @var string $criterion */
+ /** @var mixed[] $dataValues */
$conditions = self::processCondition($criterion, $fields, $dataValues, $conditions);
}
@@ -156,6 +200,10 @@ abstract class DatabaseAbstract
return $database;
}
+ /**
+ * @param array $fields
+ * @param array $dataValues
+ */
private static function processCondition(string $criterion, array $fields, array $dataValues, string $conditions): string
{
$key = array_search($criterion, $fields, true);
@@ -169,7 +217,10 @@ abstract class DatabaseAbstract
if (is_string($dataValue) && str_contains($dataValue, '"')) {
$dataValue = str_replace('"', '""', $dataValue);
}
- $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
+ if (is_string($dataValue)) {
+ $dataValue = Calculation::wrapResult(strtoupper($dataValue));
+ }
+ $dataValue = StringHelper::convertToString($dataValue);
}
return str_replace('[:' . $criterion . ']', $dataValue, $conditions);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
index dd3bfc2..9a6faf3 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
@@ -28,7 +28,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 array|float|int|string $year The value of the year argument can include one to four digits.
+ * @param array|float|int|string $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
@@ -39,7 +39,7 @@ class Date
* 2008.
* If year is less than 0 or is 10000 or greater, Excel returns the
* #NUM! error value.
- * @param array|float|int|string $month A positive or negative integer representing the month of the year
+ * @param array|float|int|string $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)
@@ -48,7 +48,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 array|float|int|string $day A positive or negative integer representing the day of the month
+ * @param array|float|int|string $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
@@ -59,12 +59,12 @@ class Date
* example, DATE(2008,1,-15) returns the serial number representing
* December 16, 2007.
*
- * @return array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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(array|float|int|string $year, array|float|int|string $month, array|float|int|string $day): float|int|DateTime|string|array
+ public static function fromYMD(array|float|int|string $year, null|array|bool|float|int|string $month, array|float|int|string $day): float|int|DateTime|string|array
{
if (is_array($year) || is_array($month) || is_array($day)) {
return self::evaluateArrayArguments([self::class, __FUNCTION__], $year, $month, $day);
@@ -92,7 +92,11 @@ class Date
*/
private static function getYear(mixed $year, int $baseYear): int
{
- $year = ($year !== null) ? StringHelper::testStringAsNumeric((string) $year) : 0;
+ if ($year === null) {
+ $year = 0;
+ } elseif (is_scalar($year)) {
+ $year = StringHelper::testStringAsNumeric((string) $year);
+ }
if (!is_numeric($year)) {
throw new Exception(ExcelError::VALUE());
}
@@ -117,11 +121,15 @@ class Date
*/
private static function getMonth(mixed $month): int
{
- if (($month !== null) && (!is_numeric($month))) {
- $month = SharedDateHelper::monthStringToNumber($month);
+ if (is_string($month)) {
+ if (!is_numeric($month)) {
+ $month = SharedDateHelper::monthStringToNumber($month);
+ }
+ } elseif ($month === null) {
+ $month = 0;
+ } elseif (is_bool($month)) {
+ $month = (int) $month;
}
-
- $month = ($month !== null) ? StringHelper::testStringAsNumeric((string) $month) : 0;
if (!is_numeric($month)) {
throw new Exception(ExcelError::VALUE());
}
@@ -134,11 +142,15 @@ class Date
*/
private static function getDay(mixed $day): int
{
- if (($day !== null) && (!is_numeric($day))) {
+ if (is_string($day) && !is_numeric($day)) {
$day = SharedDateHelper::dayStringToNumber($day);
}
- $day = ($day !== null) ? StringHelper::testStringAsNumeric((string) $day) : 0;
+ if ($day === null) {
+ $day = 0;
+ } elseif (is_scalar($day)) {
+ $day = StringHelper::testStringAsNumeric((string) $day);
+ }
if (!is_numeric($day)) {
throw new Exception(ExcelError::VALUE());
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
index 60e4de1..fc23904 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
@@ -24,7 +24,7 @@ class DateParts
* PHP DateTime object, or a standard date string
* Or can be an array of date values
*
- * @return array|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
*/
@@ -65,7 +65,7 @@ class DateParts
* PHP DateTime object, or a standard date string
* Or can be an array of date values
*
- * @return array|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
*/
@@ -104,7 +104,7 @@ class DateParts
* PHP DateTime object, or a standard date string
* Or can be an array of date values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
index b6411df..d29ed6b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
@@ -25,7 +25,7 @@ class DateValue
* Excel Function:
* DATEVALUE(dateValue)
*
- * @param null|array|bool|float|int|string $dateValue Text that represents a date in a Microsoft Excel date format.
+ * @param null|array|bool|float|int|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
@@ -35,7 +35,7 @@ class DateValue
* #VALUE! error value if date_text is out of this range.
* Or can be an array of date values
*
- * @return array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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
@@ -86,6 +86,7 @@ class DateValue
return self::finalResults($PHPDateArray, $dti, $baseYear);
}
+ /** @param mixed[] $t1 */
private static function t1ToString(array $t1, DateTimeImmutable $dti, bool $yearFound): string
{
if (count($t1) == 2) {
@@ -108,6 +109,8 @@ class DateValue
/**
* Parse date.
+ *
+ * @return mixed[]
*/
private static function setUpArray(string $dateValue, DateTimeImmutable $dti): array
{
@@ -132,6 +135,8 @@ class DateValue
/**
* Final results.
*
+ * @param mixed[] $PHPDateArray
+ *
* @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
@@ -139,6 +144,7 @@ class DateValue
{
$retValue = ExcelError::Value();
if (Helpers::dateParseSucceeded($PHPDateArray)) {
+ /** @var array{year: int, month: int, day: int, hour: int, minute: int, second: int} $PHPDateArray */
// Execute function
Helpers::replaceIfEmpty($PHPDateArray['year'], $dti->format('Y'));
if ($PHPDateArray['year'] < $baseYear) {
@@ -146,12 +152,13 @@ class DateValue
}
Helpers::replaceIfEmpty($PHPDateArray['month'], $dti->format('m'));
Helpers::replaceIfEmpty($PHPDateArray['day'], $dti->format('d'));
+ /** @var array{year: int, month: int, day: int, hour: int, minute: int, second: int} $PHPDateArray */
$PHPDateArray['hour'] = 0;
$PHPDateArray['minute'] = 0;
$PHPDateArray['second'] = 0;
- $month = (int) $PHPDateArray['month'];
- $day = (int) $PHPDateArray['day'];
- $year = (int) $PHPDateArray['year'];
+ $month = self::getInt($PHPDateArray, 'month');
+ $day = self::getInt($PHPDateArray, 'day');
+ $year = self::getInt($PHPDateArray, 'year');
if (!checkdate($month, $day, $year)) {
return ($year === 1900 && $month === 2 && $day === 29) ? Helpers::returnIn3FormatsFloat(60.0) : ExcelError::VALUE();
}
@@ -160,4 +167,10 @@ class DateValue
return $retValue;
}
+
+ /** @param mixed[] $array */
+ private static function getInt(array $array, string $index): int
+ {
+ return (array_key_exists($index, $array) && is_numeric($array[$index])) ? (int) $array[$index] : 0;
+ }
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
index b80e625..a3e5058 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
@@ -20,14 +20,14 @@ class Days
* Excel Function:
* DAYS(endDate, startDate)
*
- * @param array|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
* Or can be an array of date values
- * @param array|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
* Or can be an array of date values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
index c7e03fc..2ccadf5 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
@@ -40,7 +40,7 @@ class Days360
* same month.
* Or can be an array of methods
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
index 199d5d8..748586d 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
@@ -22,9 +22,9 @@ class Difference
* @param mixed $endDate 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 array|string $unit Or can be an array of unit values
+ * @param array|string $unit Or can be an array of unit values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
index 04d58a9..ee1d486 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
@@ -44,7 +44,9 @@ class Helpers
if (!is_numeric($dateValue)) {
$saveReturnDateType = Functions::getReturnDateType();
Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
- $dateValue = DateValue::fromString($dateValue);
+ if (is_string($dateValue)) {
+ $dateValue = DateValue::fromString($dateValue);
+ }
Functions::setReturnDateType($saveReturnDateType);
if (!is_numeric($dateValue)) {
throw new Exception(ExcelError::VALUE());
@@ -75,8 +77,10 @@ class Helpers
/**
* Adjust date by given months.
+ *
+ * @param float|int $dateValue date to be adjusted
*/
- public static function adjustDateByMonths(mixed $dateValue = 0, float $adjustmentMonths = 0): DateTime
+ public static function adjustDateByMonths($dateValue = 0, float $adjustmentMonths = 0): DateTime
{
// Execute function
$PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
@@ -127,6 +131,8 @@ class Helpers
/**
* Return result in one of three formats.
+ *
+ * @param array{year: int, month: int, day: int, hour: int, minute: int, second: int} $dateArray
*/
public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int
{
@@ -264,11 +270,16 @@ class Helpers
}
}
+ /** @return array{year: int, month: int, day: int, hour: int, minute: int, second: int} */
public static function dateParse(string $string): array
{
- return self::forceArray(date_parse($string));
+ /** @var array{year: int, month: int, day: int, hour: int, minute: int, second: int} */
+ $temp = self::forceArray(date_parse($string));
+
+ return $temp;
}
+ /** @param mixed[] $dateArray */
public static function dateParseSucceeded(array $dateArray): bool
{
return $dateArray['error_count'] === 0;
@@ -278,10 +289,19 @@ class Helpers
* Despite documentation, date_parse probably never returns false.
* Just in case, this routine helps guarantee it.
*
- * @param array|false $dateArray
+ * @param array|false $dateArray
+ *
+ * @return mixed[]
*/
private static function forceArray(array|bool $dateArray): array
{
return is_array($dateArray) ? $dateArray : ['error_count' => 1];
}
+
+ public static function floatOrInt(mixed $value): float|int
+ {
+ $result = Functions::scalar($value);
+
+ return is_numeric($result) ? ($result + 0) : 0;
+ }
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
index a90c051..74fd50e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
@@ -24,12 +24,12 @@ class Month
* @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
- * @param array|int $adjustmentMonths The number of months before or after start_date.
+ * @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 array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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
@@ -68,12 +68,12 @@ class Month
* @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
- * @param array|int $adjustmentMonths The number of months before or after start_date.
+ * @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 array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
index 503e30e..2f1d96b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
@@ -29,7 +29,7 @@ class NetworkDays
* Or can be an array of date values
* @param mixed $dateArgs An array of dates (such as holidays) to exclude from the calculation
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
index d1dc271..65c4d79 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
@@ -24,21 +24,21 @@ class Time
* Excel Function:
* TIME(hour,minute,second)
*
- * @param null|array|bool|float|int|string $hour A number from 0 (zero) to 32767 representing the hour.
+ * @param null|array|bool|float|int|string $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 null|array|bool|float|int|string $minute A number from 0 to 32767 representing the minute.
+ * @param null|array|bool|float|int|string $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 null|array|bool|float|int|string $second A number from 0 to 32767 representing the second.
+ * @param null|array|bool|float|int|string $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 array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
index de52269..a7f415d 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
@@ -23,7 +23,7 @@ class TimeParts
* PHP DateTime object, or a standard time string
* Or can be an array of date/time values
*
- * @return array|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
*/
@@ -35,7 +35,7 @@ class TimeParts
try {
Helpers::nullFalseTrueToNumber($timeValue);
- if (!is_numeric($timeValue)) {
+ if (is_string($timeValue) && !is_numeric($timeValue)) {
$timeValue = Helpers::getTimeValue($timeValue);
}
Helpers::validateNotNegative($timeValue);
@@ -64,7 +64,7 @@ class TimeParts
* PHP DateTime object, or a standard time string
* Or can be an array of date/time values
*
- * @return array|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
*/
@@ -76,7 +76,7 @@ class TimeParts
try {
Helpers::nullFalseTrueToNumber($timeValue);
- if (!is_numeric($timeValue)) {
+ if (is_string($timeValue) && !is_numeric($timeValue)) {
$timeValue = Helpers::getTimeValue($timeValue);
}
Helpers::validateNotNegative($timeValue);
@@ -105,7 +105,7 @@ class TimeParts
* PHP DateTime object, or a standard time string
* Or can be an array of date/time values
*
- * @return array|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
*/
@@ -117,7 +117,7 @@ class TimeParts
try {
Helpers::nullFalseTrueToNumber($timeValue);
- if (!is_numeric($timeValue)) {
+ if (is_string($timeValue) && !is_numeric($timeValue)) {
$timeValue = Helpers::getTimeValue($timeValue);
}
Helpers::validateNotNegative($timeValue);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
index 0f3218e..fc1f72c 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
@@ -39,13 +39,13 @@ class TimeValue
* Excel Function:
* TIMEVALUE(timeValue)
*
- * @param null|array|bool|float|int|string $timeValue A text string that represents a time in any one of the Microsoft
+ * @param null|array|bool|float|int|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 array|Datetime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|Datetime|float|int|string 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
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
index e620b4c..080a57b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
@@ -28,7 +28,7 @@ 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
- * @param array|int $method Week begins on Sunday or Monday
+ * @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.
@@ -41,7 +41,7 @@ class Week
* 21 ISO (Jan. 4 is week 1, begins on Monday).
* Or can be an array of methods
*
- * @return array|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
*/
@@ -101,7 +101,7 @@ class Week
* PHP DateTime object, or a standard date string
* Or can be an array of date values
*
- * @return array|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
*/
@@ -137,7 +137,7 @@ class Week
* Excel Function:
* WEEKDAY(dateValue[,style])
*
- * @param null|array|bool|float|int|string $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param null|array|bool|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
@@ -146,7 +146,7 @@ class Week
* 3 Numbers 0 (Monday) through 6 (Sunday).
* Or can be an array of styles
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
index 4e4ed3c..8465864 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
@@ -22,16 +22,16 @@ class WorkDay
* Excel Function:
* WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])
*
- * @param array|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
* Or can be an array of date values
- * @param array|int $endDays The number of nonweekend and nonholiday days before or after
+ * @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.
* 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 array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * @return array|DateTime|float|int|string 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
@@ -72,6 +72,8 @@ class WorkDay
/**
* Use incrementing logic to determine Workday.
+ *
+ * @param array $holidayArray
*/
private static function incrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
{
@@ -103,10 +105,12 @@ class WorkDay
return Helpers::returnIn3FormatsFloat($endDate);
}
+ /** @param array $holidayArray */
private static function incrementingArray(float $startDate, float $endDate, array $holidayArray): float
{
$holidayCountedArray = $holidayDates = [];
foreach ($holidayArray as $holidayDate) {
+ /** @var float $holidayDate */
if (self::getWeekDay($holidayDate, 3) < 5) {
$holidayDates[] = $holidayDate;
}
@@ -131,6 +135,8 @@ class WorkDay
/**
* Use decrementing logic to determine Workday.
+ *
+ * @param array $holidayArray
*/
private static function decrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
{
@@ -162,10 +168,12 @@ class WorkDay
return Helpers::returnIn3FormatsFloat($endDate);
}
+ /** @param array $holidayArray */
private static function decrementingArray(float $startDate, float $endDate, array $holidayArray): float
{
$holidayCountedArray = $holidayDates = [];
foreach ($holidayArray as $holidayDate) {
+ /** @var float $holidayDate */
if (self::getWeekDay($holidayDate, 3) < 5) {
$holidayDates[] = $holidayDate;
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
index 2713754..6b3d0f4 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
@@ -31,7 +31,7 @@ class YearFrac
* @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
* Or can be an array of methods
- * @param array|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
@@ -39,7 +39,7 @@ class YearFrac
* 4 European 30/360
* Or can be an array of methods
*
- * @return array|float|int|string fraction of the year, or a string containing an error
+ * @return array|float|int|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
*/
@@ -62,11 +62,11 @@ class YearFrac
}
return match ($method) {
- 0 => Functions::scalar(Days360::between($startDate, $endDate)) / 360,
+ 0 => Helpers::floatOrInt(Days360::between($startDate, $endDate)) / 360,
1 => self::method1($startDate, $endDate),
- 2 => Functions::scalar(Difference::interval($startDate, $endDate)) / 360,
- 3 => Functions::scalar(Difference::interval($startDate, $endDate)) / 365,
- 4 => Functions::scalar(Days360::between($startDate, $endDate, true)) / 360,
+ 2 => Helpers::floatOrInt(Difference::interval($startDate, $endDate)) / 360,
+ 3 => Helpers::floatOrInt(Difference::interval($startDate, $endDate)) / 365,
+ 4 => Helpers::floatOrInt(Days360::between($startDate, $endDate, true)) / 360,
default => ExcelError::NAN(),
};
}
@@ -91,7 +91,7 @@ class YearFrac
private static function method1(float $startDate, float $endDate): float
{
- $days = Functions::scalar(Difference::interval($startDate, $endDate));
+ $days = Helpers::floatOrInt(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
index aa2019e..9b4e6c0 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
@@ -8,14 +8,18 @@ class ArrayArgumentHelper
{
protected int $indexStart = 0;
+ /** @var mixed[] */
protected array $arguments;
protected int $argumentCount;
+ /** @var int[] */
protected array $rows;
+ /** @var int[] */
protected array $columns;
+ /** @param mixed[] $arguments */
public function initialise(array $arguments): void
{
$keys = array_keys($arguments);
@@ -34,6 +38,7 @@ class ArrayArgumentHelper
}
}
+ /** @return mixed[] */
public function arguments(): array
{
return $this->arguments;
@@ -65,6 +70,7 @@ class ArrayArgumentHelper
return count($rowVectors) === 1 ? array_pop($rowVectors) : null;
}
+ /** @return int[] */
private function getRowVectors(): array
{
$rowVectors = [];
@@ -84,6 +90,7 @@ class ArrayArgumentHelper
return count($columnVectors) === 1 ? array_pop($columnVectors) : null;
}
+ /** @return int[] */
private function getColumnVectors(): array
{
$columnVectors = [];
@@ -96,6 +103,7 @@ class ArrayArgumentHelper
return $columnVectors;
}
+ /** @return int[] */
public function getMatrixPair(): array
{
for ($i = $this->indexStart; $i < ($this->indexStart + $this->argumentCount - 1); ++$i) {
@@ -134,6 +142,11 @@ class ArrayArgumentHelper
return $this->columns[$argument];
}
+ /**
+ * @param mixed[] $arguments
+ *
+ * @return int[]
+ */
private function rows(array $arguments): array
{
return array_map(
@@ -142,6 +155,11 @@ class ArrayArgumentHelper
);
}
+ /**
+ * @param mixed[] $arguments
+ *
+ * @return int[]
+ */
private function columns(array $arguments): array
{
return array_map(
@@ -164,6 +182,13 @@ class ArrayArgumentHelper
return $count;
}
+ /**
+ * @param mixed[] $arguments
+ * @param int[] $rows
+ * @param int[] $columns
+ *
+ * @return mixed[]
+ */
private function flattenSingleCellArrays(array $arguments, array $rows, array $columns): array
{
foreach ($arguments as $index => $argument) {
@@ -178,6 +203,11 @@ class ArrayArgumentHelper
return $arguments;
}
+ /**
+ * @param mixed[] $array
+ *
+ * @return mixed[]
+ */
private function filterArray(array $array): array
{
return array_filter(
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
index fb2c853..687ab1b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
@@ -2,12 +2,14 @@
namespace PhpOffice\PhpSpreadsheet\Calculation\Engine;
+use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class ArrayArgumentProcessor
{
private static ArrayArgumentHelper $arrayArgumentHelper;
+ /** @return mixed[] */
public static function processArguments(
ArrayArgumentHelper $arrayArgumentHelper,
callable $method,
@@ -54,23 +56,30 @@ class ArrayArgumentProcessor
return ['#VALUE!'];
}
+ /**
+ * @param int[] $matrixIndexes
+ *
+ * @return mixed[]
+ */
private static function evaluateVectorMatrixPair(callable $method, array $matrixIndexes, mixed ...$arguments): array
{
- $matrix2 = array_pop($matrixIndexes);
- /** @var array $matrixValues2 */
+ $matrix2 = array_pop($matrixIndexes) ?? throw new Exception('empty array 2');
+ /** @var mixed[][] $matrixValues2 */
$matrixValues2 = $arguments[$matrix2];
- $matrix1 = array_pop($matrixIndexes);
- /** @var array $matrixValues1 */
+ $matrix1 = array_pop($matrixIndexes) ?? throw new Exception('empty array 1');
+ /** @var mixed[][] $matrixValues1 */
$matrixValues1 = $arguments[$matrix1];
- $rows = min(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2]));
- $columns = min(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2]));
+ /** @var non-empty-array */
+ $matrix12 = [$matrix1, $matrix2];
+ $rows = min(array_map(self::$arrayArgumentHelper->rowCount(...), $matrix12));
+ $columns = min(array_map(self::$arrayArgumentHelper->columnCount(...), $matrix12));
if ($rows === 1) {
- $rows = max(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2]));
+ $rows = max(array_map(self::$arrayArgumentHelper->rowCount(...), $matrix12));
}
if ($columns === 1) {
- $columns = max(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2]));
+ $columns = max(array_map(self::$arrayArgumentHelper->columnCount(...), $matrix12));
}
$result = [];
@@ -92,13 +101,18 @@ class ArrayArgumentProcessor
return $result;
}
+ /**
+ * @param array $matrixIndexes
+ *
+ * @return mixed[]
+ */
private static function evaluateMatrixPair(callable $method, array $matrixIndexes, mixed ...$arguments): array
{
$matrix2 = array_pop($matrixIndexes);
- /** @var array $matrixValues2 */
+ /** @var mixed[][] $matrixValues2 */
$matrixValues2 = $arguments[$matrix2];
$matrix1 = array_pop($matrixIndexes);
- /** @var array $matrixValues1 */
+ /** @var mixed[][] $matrixValues1 */
$matrixValues1 = $arguments[$matrix1];
$result = [];
@@ -119,6 +133,7 @@ class ArrayArgumentProcessor
return $result;
}
+ /** @return mixed[] */
private static function evaluateVectorPair(callable $method, int $rowIndex, int $columnIndex, mixed ...$arguments): array
{
$rowVector = Functions::flattenArray($arguments[$rowIndex]);
@@ -141,11 +156,13 @@ class ArrayArgumentProcessor
/**
* Note, offset is from 1 (for the first argument) rather than from 0.
+ *
+ * @return mixed[]
*/
private static function evaluateNthArgumentAsArray(callable $method, int $nthArgument, mixed ...$arguments): array
{
$values = array_slice($arguments, $nthArgument - 1, 1);
- /** @var array $values */
+ /** @var mixed[] $values */
$values = array_pop($values);
$result = [];
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
index e6dbbcb..97e4c95 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
@@ -78,7 +78,7 @@ class BranchPruner
private function initialiseCondition(): void
{
- if (isset($this->conditionMap[$this->pendingStoreKey]) && $this->conditionMap[$this->pendingStoreKey]) {
+ if (isset($this->pendingStoreKey, $this->conditionMap[$this->pendingStoreKey]) && $this->conditionMap[$this->pendingStoreKey]) {
$this->currentCondition = $this->pendingStoreKey;
$stackDepth = count($this->storeKeysStack);
if ($stackDepth > 1) {
@@ -90,7 +90,7 @@ class BranchPruner
private function initialiseThen(): void
{
- if (isset($this->thenMap[$this->pendingStoreKey]) && $this->thenMap[$this->pendingStoreKey]) {
+ if (isset($this->pendingStoreKey, $this->thenMap[$this->pendingStoreKey]) && $this->thenMap[$this->pendingStoreKey]) {
$this->currentOnlyIf = $this->pendingStoreKey;
} elseif (
isset($this->previousStoreKey, $this->thenMap[$this->previousStoreKey])
@@ -102,7 +102,7 @@ class BranchPruner
private function initialiseElse(): void
{
- if (isset($this->elseMap[$this->pendingStoreKey]) && $this->elseMap[$this->pendingStoreKey]) {
+ if (isset($this->pendingStoreKey, $this->elseMap[$this->pendingStoreKey]) && $this->elseMap[$this->pendingStoreKey]) {
$this->currentOnlyIfNot = $this->pendingStoreKey;
} elseif (
isset($this->previousStoreKey, $this->elseMap[$this->previousStoreKey])
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
index f4806b4..c50fad6 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
@@ -21,8 +21,10 @@ class CyclicReferenceStack
/**
* Push a new entry onto the stack.
+ *
+ * @param int|string $value The value to test
*/
- public function push(mixed $value): void
+ public function push($value): void
{
$this->stack[$value] = $value;
}
@@ -38,9 +40,9 @@ class CyclicReferenceStack
/**
* Test to see if a specified entry exists on the stack.
*
- * @param mixed $value The value to test
+ * @param int|string $value The value to test
*/
- public function onStack(mixed $value): bool
+ public function onStack($value): bool
{
return isset($this->stack[$value]);
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
index ee1f2ae..c64c8d2 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
@@ -16,28 +16,18 @@ class FormattedNumber
// preg_quoted string for major currency symbols, with a %s for locale currency
private const CURRENCY_CONVERSION_LIST = '\$€£¥%s';
- private const STRING_CONVERSION_LIST = [
- [self::class, 'convertToNumberIfNumeric'],
- [self::class, 'convertToNumberIfFraction'],
- [self::class, 'convertToNumberIfPercent'],
- [self::class, 'convertToNumberIfCurrency'],
- ];
-
/**
* Identify whether a string contains a formatted numeric value,
* and convert it to a numeric if it is.
*
- * @param string $operand string value to test
+ * @param float|string $operand string value to test
*/
- public static function convertToNumberIfFormatted(string &$operand): bool
+ public static function convertToNumberIfFormatted(float|string &$operand): bool
{
- foreach (self::STRING_CONVERSION_LIST as $conversionMethod) {
- if ($conversionMethod($operand) === true) {
- return true;
- }
- }
-
- return false;
+ return self::convertToNumberIfNumeric($operand)
+ || self::convertToNumberIfFraction($operand)
+ || self::convertToNumberIfPercent($operand)
+ || self::convertToNumberIfCurrency($operand);
}
/**
@@ -68,13 +58,15 @@ class FormattedNumber
*
* @param string $operand string value to test
*/
- public static function convertToNumberIfFraction(string &$operand): bool
+ public static function convertToNumberIfFraction(float|string &$operand): bool
{
- if (preg_match(self::STRING_REGEXP_FRACTION, $operand, $match)) {
+ if (is_string($operand) && preg_match(self::STRING_REGEXP_FRACTION, $operand, $match)) {
$sign = ($match[1] === '-') ? '-' : '+';
$wholePart = ($match[3] === '') ? '' : ($sign . $match[3]);
$fractionFormula = '=' . $wholePart . $sign . $match[4];
- $operand = Calculation::getInstance()->_calculateFormulaValue($fractionFormula);
+ /** @var string */
+ $operandx = Calculation::getInstance()->_calculateFormulaValue($fractionFormula);
+ $operand = $operandx;
return true;
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
index 9adcd55..e82faf5 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
@@ -78,7 +78,7 @@ class Logger
{
// Only write the debug log if logging is enabled
if ($this->writeDebugLog) {
- $message = sprintf($message, ...$args);
+ $message = sprintf($message, ...$args); //* @phpstan-ignore-line
$cellReference = implode(' -> ', $this->cellStack->showStack());
if ($this->echoDebugLog) {
echo $cellReference,
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
index 05264c3..87a733f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
@@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Operands;
interface Operand
{
+ /** @param string[] $matches */
public static function fromParser(string $formula, int $index, array $matches): self;
public function value(): string;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php
index 15c8762..9c4cf72 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php
@@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Worksheet\Table;
use Stringable;
@@ -47,6 +48,7 @@ final class StructuredReference implements Operand, Stringable
private ?int $totalsRow;
+ /** @var mixed[] */
private array $columns;
public function __construct(string $structuredReference)
@@ -54,6 +56,7 @@ final class StructuredReference implements Operand, Stringable
$this->value = $structuredReference;
}
+ /** @param string[] $matches */
public static function fromParser(string $formula, int $index, array $matches): self
{
$val = $matches[0];
@@ -171,14 +174,20 @@ final class StructuredReference implements Operand, Stringable
return $table;
}
+ /**
+ * @param array{array{string, int}, array{string, int}} $tableRange
+ *
+ * @return mixed[]
+ */
private function getColumns(Cell $cell, array $tableRange): array
{
$worksheet = $cell->getWorksheet();
$cellReference = $cell->getCoordinate();
$columns = [];
- $lastColumn = ++$tableRange[1][0];
- for ($column = $tableRange[0][0]; $column !== $lastColumn; ++$column) {
+ $lastColumn = StringHelper::stringIncrement($tableRange[1][0]);
+ for ($column = $tableRange[0][0]; $column !== $lastColumn; StringHelper::stringIncrement($column)) {
+ /** @var string $column */
$columns[$column] = $worksheet
->getCell($column . ($this->headersRow ?? ($this->firstDataRow - 1)))
->getCalculatedValue();
@@ -196,7 +205,7 @@ final class StructuredReference implements Operand, Stringable
$reference = str_replace('[' . self::ITEM_SPECIFIER_THIS_ROW . '],', '', $reference);
foreach ($this->columns as $columnId => $columnName) {
- $columnName = str_replace("\u{a0}", ' ', $columnName);
+ $columnName = str_replace("\u{a0}", ' ', $columnName); //* @phpstan-ignore-line
$reference = $this->adjustRowReference($columnName, $reference, $cell, $columnId);
}
@@ -330,7 +339,7 @@ final class StructuredReference implements Operand, Stringable
{
$columnsSelected = false;
foreach ($this->columns as $columnId => $columnName) {
- $columnName = str_replace("\u{a0}", ' ', $columnName ?? '');
+ $columnName = str_replace("\u{a0}", ' ', $columnName ?? ''); //* @phpstan-ignore-line
$cellFrom = "{$columnId}{$startRow}";
$cellTo = "{$columnId}{$endRow}";
$cellReference = ($cellFrom === $cellTo) ? $cellFrom : "{$cellFrom}:{$cellTo}";
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
index 5d564a0..7f67806 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
@@ -31,7 +31,7 @@ class BesselI
* If $ord < 0, BESSELI returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
index 4a9d9ff..58ae258 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
@@ -30,7 +30,7 @@ class BesselJ
* If $ord < 0, BESSELJ returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
index 5a9bd54..13e85cb 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
@@ -28,7 +28,7 @@ class BesselK
* If $ord < 0, BESSELKI returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
index 5d99638..c65a01b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
@@ -27,7 +27,7 @@ class BesselY
* If $ord < 0, BESSELY returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
index 47d94ec..65192bf 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
@@ -30,10 +30,10 @@ class BitWise
* Excel Function:
* BITAND(number1, number2)
*
- * @param null|array|bool|float|int|string $number1 Or can be an array of values
- * @param null|array|bool|float|int|string $number2 Or can be an array of values
+ * @param null|array|bool|float|int|string $number1 Or can be an array of values
+ * @param null|array|bool|float|int|string $number2 Or can be an array of values
*
- * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
@@ -62,10 +62,10 @@ class BitWise
* Excel Function:
* BITOR(number1, number2)
*
- * @param null|array|bool|float|int|string $number1 Or can be an array of values
- * @param null|array|bool|float|int|string $number2 Or can be an array of values
+ * @param null|array|bool|float|int|string $number1 Or can be an array of values
+ * @param null|array|bool|float|int|string $number2 Or can be an array of values
*
- * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
@@ -95,10 +95,10 @@ class BitWise
* Excel Function:
* BITXOR(number1, number2)
*
- * @param null|array|bool|float|int|string $number1 Or can be an array of values
- * @param null|array|bool|float|int|string $number2 Or can be an array of values
+ * @param null|array|bool|float|int|string $number1 Or can be an array of values
+ * @param null|array|bool|float|int|string $number2 Or can be an array of values
*
- * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
@@ -128,10 +128,10 @@ class BitWise
* Excel Function:
* BITLSHIFT(number, shift_amount)
*
- * @param null|array|bool|float|int|string $number Or can be an array of values
- * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
+ * @param null|array|bool|float|int|string $number Or can be an array of values
+ * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
*
- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 BITLSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
@@ -163,10 +163,10 @@ class BitWise
* Excel Function:
* BITRSHIFT(number, shift_amount)
*
- * @param null|array|bool|float|int|string $number Or can be an array of values
- * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
+ * @param null|array|bool|float|int|string $number Or can be an array of values
+ * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
*
- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
index 9e3275f..ac7ef51 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
@@ -20,12 +20,12 @@ class Compare
* functions you calculate the count of equal pairs. This function is also known as the
* Kronecker Delta function.
*
- * @param array|bool|float|int|string $a the first number
+ * @param array|bool|float|int|string $a the first number
* Or can be an array of values
- * @param array|bool|float|int|string $b The second number. If omitted, b is assumed to be zero.
+ * @param array|bool|float|int|string $b The second number. If omitted, b is assumed to be zero.
* Or can be an array of values
*
- * @return array|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
*/
@@ -55,12 +55,12 @@ 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 array|bool|float|int|string $number the value to test against step
+ * @param array|bool|float|int|string $number the value to test against step
* Or can be an array of values
- * @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero.
+ * @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero.
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
index 3e41371..83d110c 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
@@ -28,7 +28,7 @@ class Complex
* If omitted, the suffix is assumed to be "i".
* Or can be an array of values
*
- * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(mixed $realNumber = 0.0, mixed $imaginary = 0.0, mixed $suffix = 'i'): array|string
@@ -65,11 +65,11 @@ class Complex
* Excel Function:
* IMAGINARY(complexNumber)
*
- * @param array|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 array|float|string (string if an error)
+ * @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
*/
@@ -96,10 +96,10 @@ class Complex
* Excel Function:
* IMREAL(complexNumber)
*
- * @param array|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 array|float|string (string if an error)
+ * @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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
index d1b7764..5dd51be 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
@@ -19,10 +19,10 @@ class ComplexFunctions
* Excel Function:
* IMABS(complexNumber)
*
- * @param array|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 array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|float|string
@@ -49,10 +49,10 @@ class ComplexFunctions
* Excel Function:
* IMARGUMENT(complexNumber)
*
- * @param array|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 array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|float|string
@@ -82,10 +82,10 @@ class ComplexFunctions
* Excel Function:
* IMCONJUGATE(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -111,10 +111,10 @@ class ComplexFunctions
* Excel Function:
* IMCOS(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMCOS(array|string $complexNumber): array|string
@@ -140,10 +140,10 @@ class ComplexFunctions
* Excel Function:
* IMCOSH(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMCOSH(array|string $complexNumber): array|string
@@ -169,10 +169,10 @@ class ComplexFunctions
* Excel Function:
* IMCOT(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMCOT(array|string $complexNumber): array|string
@@ -198,10 +198,10 @@ class ComplexFunctions
* Excel Function:
* IMCSC(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMCSC(array|string $complexNumber): array|string
@@ -227,10 +227,10 @@ class ComplexFunctions
* Excel Function:
* IMCSCH(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMCSCH(array|string $complexNumber): array|string
@@ -256,10 +256,10 @@ class ComplexFunctions
* Excel Function:
* IMSIN(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMSIN(array|string $complexNumber): array|string
@@ -285,10 +285,10 @@ class ComplexFunctions
* Excel Function:
* IMSINH(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMSINH(array|string $complexNumber): array|string
@@ -314,10 +314,10 @@ class ComplexFunctions
* Excel Function:
* IMSEC(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMSEC(array|string $complexNumber): array|string
@@ -343,10 +343,10 @@ class ComplexFunctions
* Excel Function:
* IMSECH(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMSECH(array|string $complexNumber): array|string
@@ -372,10 +372,10 @@ class ComplexFunctions
* Excel Function:
* IMTAN(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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 IMTAN(array|string $complexNumber): array|string
@@ -401,10 +401,10 @@ class ComplexFunctions
* Excel Function:
* IMSQRT(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -435,10 +435,10 @@ class ComplexFunctions
* Excel Function:
* IMLN(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -468,10 +468,10 @@ class ComplexFunctions
* Excel Function:
* IMLOG10(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -501,10 +501,10 @@ class ComplexFunctions
* Excel Function:
* IMLOG2(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -534,10 +534,10 @@ class ComplexFunctions
* Excel Function:
* IMEXP(complexNumber)
*
- * @param array|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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber): array|string
@@ -563,12 +563,12 @@ class ComplexFunctions
* Excel Function:
* IMPOWER(complexNumber,realNumber)
*
- * @param array|string $complexNumber the complex number you want to raise to a power
+ * @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
+ * @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 array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber, array|float|int|string $realNumber): array|string
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
index 61efa84..ed66bea 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
@@ -20,12 +20,12 @@ class ComplexOperations
* Excel Function:
* IMDIV(complexDividend,complexDivisor)
*
- * @param array|string $complexDividend the complex numerator or dividend
+ * @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
+ * @param array|string $complexDivisor the complex denominator or divisor
* Or can be an array of values
*
- * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexDividend, array|string $complexDivisor): array|string
@@ -49,12 +49,12 @@ class ComplexOperations
* Excel Function:
* IMSUB(complexNumber1,complexNumber2)
*
- * @param array|string $complexNumber1 the complex number from which to subtract complexNumber2
+ * @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
+ * @param array|string $complexNumber2 the complex number to subtract from complexNumber1
* Or can be an array of values
*
- * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(array|string $complexNumber1, array|string $complexNumber2): array|string
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php
index 1222831..6aa631a 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php
@@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
abstract class ConvertBase
{
@@ -26,7 +27,7 @@ abstract class ConvertBase
}
}
- return strtoupper((string) $value);
+ return strtoupper(StringHelper::convertToString($value));
}
protected static function validatePlaces(mixed $places = null): ?int
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
index 9c00dcb..3b84ce3 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
@@ -15,7 +15,7 @@ class ConvertBinary extends ConvertBase
* Excel Function:
* BIN2DEC(x)
*
- * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number
+ * @param array|bool|float|int|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.
@@ -23,7 +23,7 @@ class ConvertBinary extends ConvertBase
* 10 characters (10 bits), BIN2DEC returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @return array|float|int|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
*/
@@ -44,10 +44,10 @@ class ConvertBinary extends ConvertBase
// Two's Complement
$value = substr($value, -9);
- return '-' . (512 - bindec($value));
+ return -(512 - bindec($value));
}
- return (string) bindec($value);
+ return bindec($value);
}
/**
@@ -58,14 +58,14 @@ class ConvertBinary extends ConvertBase
* Excel Function:
* BIN2HEX(x[,places])
*
- * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number
+ * @param array|bool|float|int|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.
* Or can be an array of values
- * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2HEX uses the
+ * @param null|array|float|int|string $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.
@@ -73,7 +73,7 @@ class ConvertBinary extends ConvertBase
* If places is negative, BIN2HEX returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
@@ -111,14 +111,14 @@ class ConvertBinary extends ConvertBase
* Excel Function:
* BIN2OCT(x[,places])
*
- * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number
+ * @param array|bool|float|int|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.
* Or can be an array of values
- * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2OCT uses the
+ * @param null|array|float|int|string $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.
@@ -126,7 +126,7 @@ class ConvertBinary extends ConvertBase
* If places is negative, BIN2OCT returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php
index 923caa9..9834bcc 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 array|bool|float|int|string $value The decimal integer you want to convert. If number is negative,
+ * @param array|bool|float|int|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
@@ -33,7 +33,7 @@ class ConvertDecimal extends ConvertBase
* If DEC2BIN requires more than places characters, it returns the #NUM!
* error value.
* Or can be an array of values
- * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2BIN uses
+ * @param null|array|float|int|string $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.
@@ -41,7 +41,7 @@ class ConvertDecimal extends ConvertBase
* 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
+ * @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
*/
@@ -79,7 +79,7 @@ class ConvertDecimal extends ConvertBase
* Excel Function:
* DEC2HEX(x[,places])
*
- * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative,
+ * @param array|bool|float|int|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
@@ -90,7 +90,7 @@ class ConvertDecimal extends ConvertBase
* If DEC2HEX requires more than places characters, it returns the
* #NUM! error value.
* Or can be an array of values
- * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2HEX uses
+ * @param null|array|float|int|string $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.
@@ -98,7 +98,7 @@ class ConvertDecimal extends ConvertBase
* 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
+ * @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
*/
@@ -155,7 +155,7 @@ class ConvertDecimal extends ConvertBase
* Excel Function:
* DEC2OCT(x[,places])
*
- * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative,
+ * @param array|bool|float|int|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
@@ -166,7 +166,7 @@ class ConvertDecimal extends ConvertBase
* If DEC2OCT requires more than places characters, it returns the
* #NUM! error value.
* Or can be an array of values
- * @param array|int $places The number of characters to use. If places is omitted, DEC2OCT uses
+ * @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.
@@ -174,7 +174,7 @@ class ConvertDecimal extends ConvertBase
* 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
+ * @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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php
index 40eacf1..be8ed39 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 array|bool|float|string $value The hexadecimal number you want to convert.
+ * @param array|bool|float|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.
@@ -26,7 +26,7 @@ class ConvertHex extends ConvertBase
* 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.
* Or can be an array of values
- * @param array|int $places The number of characters to use. If places is omitted,
+ * @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.
@@ -34,7 +34,7 @@ class ConvertHex extends ConvertBase
* If places is negative, HEX2BIN returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
@@ -65,7 +65,7 @@ class ConvertHex extends ConvertBase
* Excel Function:
* HEX2DEC(x)
*
- * @param array|bool|float|int|string $value The hexadecimal number you want to convert. This number cannot
+ * @param array|bool|float|int|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
@@ -74,7 +74,7 @@ class ConvertHex extends ConvertBase
* #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @return array|float|int|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
*/
@@ -104,10 +104,10 @@ class ConvertHex extends ConvertBase
$binX[$i] = ($binX[$i] == '1' ? '0' : '1');
}
- return (string) ((bindec($binX) + 1) * -1);
+ return (bindec($binX) + 1) * -1;
}
- return (string) bindec($binX);
+ return bindec($binX);
}
/**
@@ -118,7 +118,7 @@ class ConvertHex extends ConvertBase
* Excel Function:
* HEX2OCT(x[,places])
*
- * @param array|bool|float|int|string $value The hexadecimal number you want to convert. Number cannot
+ * @param array|bool|float|int|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
@@ -132,7 +132,7 @@ class ConvertHex extends ConvertBase
* If HEX2OCT requires more than places characters, it returns
* the #NUM! error value.
* Or can be an array of values
- * @param array|int $places The number of characters to use. If places is omitted, HEX2OCT
+ * @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.
@@ -141,7 +141,7 @@ class ConvertHex extends ConvertBase
* If places is negative, HEX2OCT returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php
index d6ef56c..03a906d 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 array|bool|float|int|string $value The octal number you want to convert. Number may not
+ * @param array|bool|float|int|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
@@ -29,7 +29,7 @@ class ConvertOctal extends ConvertBase
* If OCT2BIN requires more than places characters, it
* returns the #NUM! error value.
* Or can be an array of values
- * @param array|int $places The number of characters to use. If places is omitted,
+ * @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).
@@ -40,7 +40,7 @@ class ConvertOctal extends ConvertBase
* value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
@@ -69,7 +69,7 @@ class ConvertOctal extends ConvertBase
* Excel Function:
* OCT2DEC(x)
*
- * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain
+ * @param array|bool|float|int|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
@@ -78,7 +78,7 @@ class ConvertOctal extends ConvertBase
* #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @return array|float|int|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
*/
@@ -104,10 +104,10 @@ class ConvertOctal extends ConvertBase
$binX[$i] = ($binX[$i] == '1' ? '0' : '1');
}
- return (string) ((bindec($binX) + 1) * -1);
+ return (bindec($binX) + 1) * -1;
}
- return (string) bindec($binX);
+ return bindec($binX);
}
/**
@@ -118,7 +118,7 @@ class ConvertOctal extends ConvertBase
* Excel Function:
* OCT2HEX(x[,places])
*
- * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain
+ * @param array|bool|float|int|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
@@ -130,7 +130,7 @@ class ConvertOctal extends ConvertBase
* If OCT2HEX requires more than places characters, it returns
* the #NUM! error value.
* Or can be an array of values
- * @param array|int $places The number of characters to use. If places is omitted, OCT2HEX
+ * @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.
@@ -138,7 +138,7 @@ class ConvertOctal extends ConvertBase
* If places is negative, OCT2HEX returns the #NUM! error value.
* Or can be an array of values
*
- * @return array|string Result, or an error
+ * @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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
index 969c270..db1161c 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
@@ -230,7 +230,7 @@ class ConvertUOM
/**
* Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
*
- ** @var array
+ * @var array
*/
private static array $binaryConversionMultipliers = [
'Yi' => ['multiplier' => 2 ** 80, 'name' => 'yobi'],
@@ -435,6 +435,8 @@ class ConvertUOM
/**
* getConversionGroups
* Returns a list of the different conversion groups for UOM conversions.
+ *
+ * @return string[]
*/
public static function getConversionCategories(): array
{
@@ -451,6 +453,8 @@ class ConvertUOM
* Returns an array of units of measure, for a specified conversion group, or for all groups.
*
* @param ?string $category The group whose units of measure you want to retrieve
+ *
+ * @return string[][]
*/
public static function getConversionCategoryUnits(?string $category = null): array
{
@@ -468,6 +472,8 @@ class ConvertUOM
* getConversionGroupUnitDetails.
*
* @param ?string $category The group whose units of measure you want to retrieve
+ *
+ * @return array>>
*/
public static function getConversionCategoryUnitDetails(?string $category = null): array
{
@@ -488,7 +494,7 @@ class ConvertUOM
* getConversionMultipliers
* Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
*
- * @return mixed[]
+ * @return array
*/
public static function getConversionMultipliers(): array
{
@@ -499,7 +505,7 @@ class ConvertUOM
* getBinaryConversionMultipliers
* Returns an array of the additional Multiplier prefixes that can be used with Information Units of Measure in CONVERTUOM().
*
- * @return mixed[]
+ * @return array
*/
public static function getBinaryConversionMultipliers(): array
{
@@ -516,14 +522,14 @@ class ConvertUOM
* Excel Function:
* CONVERT(value,fromUOM,toUOM)
*
- * @param array|float|int|string $value the value in fromUOM to convert
+ * @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
+ * @param string|string[] $fromUOM the units for value
* Or can be an array of values
- * @param array|string $toUOM the units for the result
+ * @param string|string[] $toUOM the units for the result
* Or can be an array of values
*
- * @return array|float|string Result, or a string containing an error
+ * @return float|mixed[]|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
*/
@@ -566,6 +572,7 @@ class ConvertUOM
return ($baseValue * self::$unitConversions[$fromCategory][$toUOM]) / $toMultiplier;
}
+ /** @return array{0: string, 1: string, 2: float} */
private static function getUOMDetails(string $uom): array
{
if (isset(self::$conversionUnits[$uom])) {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php
index aee7e31..7f599dd 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php
@@ -31,7 +31,7 @@ class Erf
* If omitted, ERF integrates between zero and lower_limit
* Or can be an array of values
*
- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(mixed $lower, mixed $upper = null): array|float|string
@@ -63,7 +63,7 @@ class Erf
* @param mixed $limit Float bound for integrating ERF, other bound is zero
* Or can be an array of values
*
- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(mixed $limit)
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
index 4365fec..4cca2d6 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
@@ -26,7 +26,7 @@ class ErfC
* @param mixed $value The float lower bound for integrating ERFC
* Or can be an array of values
*
- * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @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(mixed $value)
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php
index b53829b..4344244 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php
@@ -54,9 +54,7 @@ class Amortization
$salvage = Functions::flattenSingleValue($salvage);
$period = Functions::flattenSingleValue($period);
$rate = Functions::flattenSingleValue($rate);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$cost = FinancialValidations::validateFloat($cost);
@@ -141,9 +139,7 @@ class Amortization
$salvage = Functions::flattenSingleValue($salvage);
$period = Functions::flattenSingleValue($period);
$rate = Functions::flattenSingleValue($rate);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$cost = FinancialValidations::validateFloat($cost);
@@ -171,9 +167,13 @@ class Amortization
if (
$basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
&& $yearFrac < 1
- && DateTimeExcel\Helpers::isLeapYear(Functions::scalar($purchasedYear))
) {
- $yearFrac *= 365 / 366;
+ $temp = Functions::scalar($purchasedYear);
+ if (is_int($temp) || is_string($temp)) {
+ if (DateTimeExcel\Helpers::isLeapYear($temp)) {
+ $yearFrac *= 365 / 366;
+ }
+ }
}
$f0Rate = $yearFrac * $rate * $cost;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic.php
index 6138fb1..2744c55 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic.php
@@ -38,9 +38,9 @@ class Periodic
): string|float {
$rate = Functions::flattenSingleValue($rate);
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
- $payment = ($payment === null) ? 0.0 : Functions::flattenSingleValue($payment);
- $presentValue = ($presentValue === null) ? 0.0 : Functions::flattenSingleValue($presentValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $payment = Functions::flattenSingleValue($payment) ?? 0.0;
+ $presentValue = Functions::flattenSingleValue($presentValue) ?? 0.0;
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$rate = CashFlowValidations::validateRate($rate);
@@ -77,9 +77,9 @@ class Periodic
): string|float {
$rate = Functions::flattenSingleValue($rate);
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
- $payment = ($payment === null) ? 0.0 : Functions::flattenSingleValue($payment);
- $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $payment = Functions::flattenSingleValue($payment) ?? 0.0;
+ $futureValue = Functions::flattenSingleValue($futureValue) ?? 0.0;
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$rate = CashFlowValidations::validateRate($rate);
@@ -122,8 +122,8 @@ class Periodic
$rate = Functions::flattenSingleValue($rate);
$payment = Functions::flattenSingleValue($payment);
$presentValue = Functions::flattenSingleValue($presentValue);
- $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $futureValue = Functions::flattenSingleValue($futureValue) ?? 0.0;
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$rate = CashFlowValidations::validateRate($rate);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
index 9435909..a19a61b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
@@ -41,7 +41,7 @@ class Cumulative
$presentValue = Functions::flattenSingleValue($presentValue);
$start = Functions::flattenSingleValue($start);
$end = Functions::flattenSingleValue($end);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$rate = CashFlowValidations::validateRate($rate);
@@ -104,7 +104,7 @@ class Cumulative
$presentValue = Functions::flattenSingleValue($presentValue);
$start = Functions::flattenSingleValue($start);
$end = Functions::flattenSingleValue($end);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$rate = CashFlowValidations::validateRate($rate);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
index ad68ec1..68ac57b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
@@ -43,7 +43,7 @@ class Interest
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
$presentValue = Functions::flattenSingleValue($presentValue);
$futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$interestRate = CashFlowValidations::validateRate($interestRate);
@@ -160,9 +160,9 @@ class Interest
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
$payment = Functions::flattenSingleValue($payment);
$presentValue = Functions::flattenSingleValue($presentValue);
- $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
- $guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
+ $futureValue = Functions::flattenSingleValue($futureValue) ?? 0.0;
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
+ $guess = Functions::flattenSingleValue($guess) ?? 0.1;
try {
$numberOfPeriods = CashFlowValidations::validateFloat($numberOfPeriods);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
index 41e88f9..d16be44 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
@@ -27,14 +27,14 @@ class Payments
mixed $interestRate,
mixed $numberOfPeriods,
mixed $presentValue,
- mixed $futureValue = 0,
+ mixed $futureValue = 0.0,
mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD
): string|float {
$interestRate = Functions::flattenSingleValue($interestRate);
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
$presentValue = Functions::flattenSingleValue($presentValue);
- $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $futureValue = Functions::flattenSingleValue($futureValue) ?? 0.0;
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$interestRate = CashFlowValidations::validateRate($interestRate);
@@ -83,7 +83,7 @@ class Payments
$numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
$presentValue = Functions::flattenSingleValue($presentValue);
$futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
- $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $type = Functions::flattenSingleValue($type) ?? FinancialConstants::PAYMENT_END_OF_PERIOD;
try {
$interestRate = CashFlowValidations::validateRate($interestRate);
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 e503f72..53668d1 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
@@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel;
use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class NonPeriodic
{
@@ -23,16 +24,17 @@ class NonPeriodic
* Excel Function:
* =XIRR(values,dates,guess)
*
- * @param mixed $values A series of cash flow payments, expecting float[]
+ * @param array $values A series of cash flow payments, expecting float[]
* The series of values must contain at least one positive value & one negative value
- * @param mixed[] $dates A series of payment dates
+ * @param array $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 mixed $guess An optional guess at the expected answer
*/
- public static function rate(mixed $values, mixed $dates, mixed $guess = self::DEFAULT_GUESS): float|string
+ public static function rate(mixed $values, $dates, mixed $guess = self::DEFAULT_GUESS): float|string
{
$rslt = self::xirrPart1($values, $dates);
+ /** @var array $dates */
if ($rslt !== '') {
return $rslt;
}
@@ -91,6 +93,7 @@ class NonPeriodic
$x2 += 0.5;
}
if ($found) {
+ /** @var array $dates */
return self::xirrBisection($values, $dates, $x1, $x2);
}
@@ -107,7 +110,7 @@ class NonPeriodic
* =XNPV(rate,values,dates)
*
* @param mixed $rate the discount rate to apply to the cash flows, expect array|float
- * @param mixed $values A series of cash flows that corresponds to a schedule of payments in dates, expecting floag[].
+ * @param array $values A series of cash flows that corresponds to a schedule of payments in dates, expecting float[].
* The first payment is optional and corresponds to a cost or payment that occurs
* at the beginning of the investment.
* If the first value is a cost or payment, it must be a negative value.
@@ -127,9 +130,12 @@ class NonPeriodic
return $neg && $pos;
}
+ /** @param array $values */
private static function xirrPart1(mixed &$values, mixed &$dates): string
{
- $values = Functions::flattenArray($values);
+ /** @var array */
+ $temp = Functions::flattenArray($values);
+ $values = $temp;
$dates = Functions::flattenArray($dates);
$valuesIsArray = count($values) > 1;
$datesIsArray = count($dates) > 1;
@@ -152,6 +158,7 @@ class NonPeriodic
return self::xirrPart2($values);
}
+ /** @param array $values */
private static function xirrPart2(array &$values): string
{
$valCount = count($values);
@@ -159,7 +166,7 @@ class NonPeriodic
$foundneg = false;
for ($i = 0; $i < $valCount; ++$i) {
$fld = $values[$i];
- if (!is_numeric($fld)) {
+ if (!is_numeric($fld)) { //* @phpstan-ignore-line
return ExcelError::VALUE();
} elseif ($fld > 0) {
$foundpos = true;
@@ -174,6 +181,10 @@ class NonPeriodic
return '';
}
+ /**
+ * @param array $values
+ * @param array $dates
+ */
private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string
{
$f = self::xnpvOrdered($x1, $values, $dates, false);
@@ -203,6 +214,10 @@ class NonPeriodic
return $rslt;
}
+ /**
+ * @param array $values
+ * @param array $dates
+ */
private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float
{
$rslt = ExcelError::NAN();
@@ -243,6 +258,9 @@ class NonPeriodic
private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string
{
$rate = Functions::flattenSingleValue($rate);
+ if (!is_numeric($rate)) {
+ return ExcelError::VALUE();
+ }
$values = Functions::flattenArray($values);
$dates = Functions::flattenArray($dates);
$valCount = count($values);
@@ -274,7 +292,7 @@ class NonPeriodic
$dif = Functions::scalar(DateTimeExcel\Difference::interval($date0, $datei, 'd'));
}
if (!is_numeric($dif)) {
- return $dif;
+ return StringHelper::convertToString($dif);
}
if ($rate <= -1.0) {
$xnpv += -abs($values[$i] + 0) / (-1 - $rate) ** ($dif / 365);
@@ -286,6 +304,10 @@ class NonPeriodic
return is_finite($xnpv) ? $xnpv : ExcelError::VALUE();
}
+ /**
+ * @param mixed[] $values
+ * @param mixed[] $dates
+ */
private static function validateXnpv(mixed $rate, array $values, array $dates): void
{
if (!is_numeric($rate)) {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
index 21e537b..c5c3bcb 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
@@ -36,6 +36,9 @@ class Periodic
}
$values = Functions::flattenArray($values);
$guess = Functions::flattenSingleValue($guess);
+ if (!is_numeric($guess)) {
+ return ExcelError::VALUE();
+ }
// create an initial range, with a root somewhere between 0 and guess
$x1 = 0.0;
@@ -103,7 +106,9 @@ class Periodic
return ExcelError::DIV0();
}
$values = Functions::flattenArray($values);
+ /** @var float */
$financeRate = Functions::flattenSingleValue($financeRate);
+ /** @var float */
$reinvestmentRate = Functions::flattenSingleValue($reinvestmentRate);
$n = count($values);
@@ -112,6 +117,7 @@ class Periodic
$npvPos = $npvNeg = 0.0;
foreach ($values as $i => $v) {
+ /** @var float $v */
if ($v >= 0) {
$npvPos += $v / $rr ** $i;
} else {
@@ -134,12 +140,13 @@ class Periodic
*
* Returns the Net Present Value of a cash flow series given a discount rate.
*
- * @param array $args
+ * @param array $args
*/
public static function presentValue(mixed $rate, ...$args): int|float
{
$returnValue = 0;
+ /** @var float */
$rate = Functions::flattenSingleValue($rate);
$aArgs = Functions::flattenArray($args);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php
index c2fcab3..e6c9c85 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php
@@ -49,9 +49,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
@@ -110,9 +108,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
@@ -179,9 +175,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
@@ -244,9 +238,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
@@ -296,9 +288,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
@@ -355,9 +345,7 @@ class Coupons
$settlement = Functions::flattenSingleValue($settlement);
$maturity = Functions::flattenSingleValue($maturity);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = FinancialValidations::validateSettlementDate($settlement);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
index b0581f6..3fc64b6 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
@@ -25,7 +25,7 @@ class Dollar
* 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
+ * @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(mixed $number, mixed $precision = 2)
@@ -47,6 +47,8 @@ class Dollar
* Or can be an array of values
* @param mixed $fraction Fraction
* Or can be an array of values
+ *
+ * @return array|float|string
*/
public static function decimal(mixed $fractionalDollar = null, mixed $fraction = 0): array|string|float
{
@@ -93,6 +95,8 @@ class Dollar
* Or can be an array of values
* @param mixed $fraction Fraction
* Or can be an array of values
+ *
+ * @return array|float|string
*/
public static function fractional(mixed $decimalDollar = null, mixed $fraction = 0): array|string|float
{
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
index aa28712..c983ecf 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
@@ -14,7 +14,7 @@ class Helpers
*
* Returns the number of days in a specified year, as defined by the "basis" value
*
- * @param int|string $year The year against which we're testing
+ * @param mixed $year The year against which we're testing, expect int|string
* @param int|string $basis The type of day count:
* 0 or omitted US (NASD) 360
* 1 Actual (365 or 366 in a leap year)
@@ -24,8 +24,11 @@ class Helpers
*
* @return int|string Result, or a string containing an error
*/
- public static function daysPerYear($year, $basis = 0): string|int
+ public static function daysPerYear(mixed $year, $basis = 0): string|int
{
+ if (!is_int($year) && !is_string($year)) {
+ return ExcelError::VALUE();
+ }
if (!is_numeric($basis)) {
return ExcelError::NAN();
}
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 eb57abf..5f4379d 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php
@@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\YearFrac;
use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Constants as FinancialConstants;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class AccruedInterest
{
@@ -59,12 +60,8 @@ class AccruedInterest
$settlement = Functions::flattenSingleValue($settlement);
$rate = Functions::flattenSingleValue($rate);
$parValue = ($parValue === null) ? 1000 : Functions::flattenSingleValue($parValue);
- $frequency = ($frequency === null)
- ? FinancialConstants::FREQUENCY_ANNUAL
- : Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $frequency = Functions::flattenSingleValue($frequency) ?? FinancialConstants::FREQUENCY_ANNUAL;
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$issue = SecurityValidations::validateIssueDate($issue);
@@ -81,12 +78,12 @@ class AccruedInterest
$daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis));
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
- return $daysBetweenIssueAndSettlement;
+ return StringHelper::convertToString($daysBetweenIssueAndSettlement);
}
$daysBetweenFirstInterestAndSettlement = Functions::scalar(YearFrac::fraction($firstInterest, $settlement, $basis));
if (!is_numeric($daysBetweenFirstInterestAndSettlement)) {
// return date error
- return $daysBetweenFirstInterestAndSettlement;
+ return StringHelper::convertToString($daysBetweenFirstInterestAndSettlement);
}
return $parValue * $rate * $daysBetweenIssueAndSettlement;
@@ -125,9 +122,7 @@ class AccruedInterest
$settlement = Functions::flattenSingleValue($settlement);
$rate = Functions::flattenSingleValue($rate);
$parValue = ($parValue === null) ? 1000 : Functions::flattenSingleValue($parValue);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$issue = SecurityValidations::validateIssueDate($issue);
@@ -143,7 +138,7 @@ class AccruedInterest
$daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis));
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
- return $daysBetweenIssueAndSettlement;
+ return StringHelper::convertToString($daysBetweenIssueAndSettlement);
}
return $parValue * $rate * $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 b07b2c9..12c26c2 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php
@@ -9,6 +9,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Helpers;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Price
{
@@ -52,9 +53,7 @@ class Price
$yield = Functions::flattenSingleValue($yield);
$redemption = Functions::flattenSingleValue($redemption);
$frequency = Functions::flattenSingleValue($frequency);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -119,9 +118,7 @@ class Price
$maturity = Functions::flattenSingleValue($maturity);
$discount = Functions::flattenSingleValue($discount);
$redemption = Functions::flattenSingleValue($redemption);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -137,7 +134,7 @@ class Price
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity);
@@ -178,9 +175,7 @@ class Price
$issue = Functions::flattenSingleValue($issue);
$rate = Functions::flattenSingleValue($rate);
$yield = Functions::flattenSingleValue($yield);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -201,19 +196,19 @@ class Price
$daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis));
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
- return $daysBetweenIssueAndSettlement;
+ return StringHelper::convertToString($daysBetweenIssueAndSettlement);
}
$daysBetweenIssueAndSettlement *= $daysPerYear;
$daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis));
if (!is_numeric($daysBetweenIssueAndMaturity)) {
// return date error
- return $daysBetweenIssueAndMaturity;
+ return StringHelper::convertToString($daysBetweenIssueAndMaturity);
}
$daysBetweenIssueAndMaturity *= $daysPerYear;
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
$daysBetweenSettlementAndMaturity *= $daysPerYear;
@@ -254,9 +249,7 @@ class Price
$maturity = Functions::flattenSingleValue($maturity);
$investment = Functions::flattenSingleValue($investment);
$discount = Functions::flattenSingleValue($discount);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -275,7 +268,7 @@ class Price
$daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return Functions::scalar($daysBetweenSettlementAndMaturity);
+ return StringHelper::convertToString(Functions::scalar($daysBetweenSettlementAndMaturity));
}
return $investment / (1 - ($discount * $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 2989a29..4a120e2 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php
@@ -7,6 +7,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Constants as FinancialConstants;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Rates
{
@@ -43,9 +44,7 @@ class Rates
$maturity = Functions::flattenSingleValue($maturity);
$price = Functions::flattenSingleValue($price);
$redemption = Functions::flattenSingleValue($redemption);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -65,7 +64,7 @@ class Rates
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
return (1 - $price / $redemption) / $daysBetweenSettlementAndMaturity;
@@ -104,9 +103,7 @@ class Rates
$maturity = Functions::flattenSingleValue($maturity);
$investment = Functions::flattenSingleValue($investment);
$redemption = Functions::flattenSingleValue($redemption);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -126,7 +123,7 @@ class Rates
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
return (($redemption / $investment) - 1) / ($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 a4c5a48..7ccb132 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php
@@ -7,6 +7,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Constants as FinancialConstants;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Helpers;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Yields
{
@@ -42,9 +43,7 @@ class Yields
$maturity = Functions::flattenSingleValue($maturity);
$price = Functions::flattenSingleValue($price);
$redemption = Functions::flattenSingleValue($redemption);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -64,7 +63,7 @@ class Yields
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
$daysBetweenSettlementAndMaturity *= $daysPerYear;
@@ -106,9 +105,7 @@ class Yields
$issue = Functions::flattenSingleValue($issue);
$rate = Functions::flattenSingleValue($rate);
$price = Functions::flattenSingleValue($price);
- $basis = ($basis === null)
- ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
- : Functions::flattenSingleValue($basis);
+ $basis = Functions::flattenSingleValue($basis) ?? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD;
try {
$settlement = SecurityValidations::validateSettlementDate($settlement);
@@ -129,19 +126,19 @@ class Yields
$daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis));
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
- return $daysBetweenIssueAndSettlement;
+ return StringHelper::convertToString($daysBetweenIssueAndSettlement);
}
$daysBetweenIssueAndSettlement *= $daysPerYear;
$daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis));
if (!is_numeric($daysBetweenIssueAndMaturity)) {
// return date error
- return $daysBetweenIssueAndMaturity;
+ return StringHelper::convertToString($daysBetweenIssueAndMaturity);
}
$daysBetweenIssueAndMaturity *= $daysPerYear;
$daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
- return $daysBetweenSettlementAndMaturity;
+ return StringHelper::convertToString($daysBetweenSettlementAndMaturity);
}
$daysBetweenSettlementAndMaturity *= $daysPerYear;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
index 3e62422..16f6a3d 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
@@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\Shared\Date;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Functions
{
@@ -130,16 +131,22 @@ class Functions
public static function isMatrixValue(mixed $idx): bool
{
+ $idx = StringHelper::convertToString($idx);
+
return (substr_count($idx, '.') <= 1) || (preg_match('/\.[A-Z]/', $idx) > 0);
}
public static function isValue(mixed $idx): bool
{
+ $idx = StringHelper::convertToString($idx);
+
return substr_count($idx, '.') === 0;
}
public static function isCellValue(mixed $idx): bool
{
+ $idx = StringHelper::convertToString($idx);
+
return substr_count($idx, '.') > 1;
}
@@ -154,7 +161,8 @@ class Functions
$condition = self::operandSpecialHandling($condition);
if (is_bool($condition)) {
return '=' . ($condition ? 'TRUE' : 'FALSE');
- } elseif (!is_numeric($condition)) {
+ }
+ if (!is_numeric($condition)) {
if ($condition !== '""') { // Not an empty string
// Escape any quotes in the string value
$condition = (string) preg_replace('/"/ui', '""', $condition);
@@ -162,29 +170,32 @@ class Functions
$condition = Calculation::wrapResult(strtoupper($condition));
}
- return str_replace('""""', '""', '=' . $condition);
+ return str_replace('""""', '""', '=' . StringHelper::convertToString($condition));
}
$operator = $operand = '';
if (1 === preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches)) {
[, $operator, $operand] = $matches;
}
- $operand = self::operandSpecialHandling($operand);
+ $operand = (string) self::operandSpecialHandling($operand);
if (is_numeric(trim($operand, '"'))) {
$operand = trim($operand, '"');
} elseif (!is_numeric($operand) && $operand !== 'FALSE' && $operand !== 'TRUE') {
$operand = str_replace('"', '""', $operand);
$operand = Calculation::wrapResult(strtoupper($operand));
+ $operand = StringHelper::convertToString($operand);
}
return str_replace('""""', '""', $operator . $operand);
}
- private static function operandSpecialHandling(mixed $operand): mixed
+ private static function operandSpecialHandling(mixed $operand): bool|float|int|string
{
if (is_numeric($operand) || is_bool($operand)) {
return $operand;
- } elseif (strtoupper($operand) === Calculation::getTRUE() || strtoupper($operand) === Calculation::getFALSE()) {
+ }
+ $operand = StringHelper::convertToString($operand);
+ if (strtoupper($operand) === Calculation::getTRUE() || strtoupper($operand) === Calculation::getFALSE()) {
return strtoupper($operand);
}
@@ -206,7 +217,7 @@ class Functions
*
* @param mixed $array Array to be flattened
*
- * @return array Flattened array
+ * @return array Flattened array
*/
public static function flattenArray(mixed $array): array
{
@@ -236,7 +247,7 @@ class Functions
*
* @param mixed $array Array to be flattened
*
- * @return array Flattened array
+ * @return array Flattened array
*/
public static function flattenArray2(mixed ...$array): array
{
@@ -274,7 +285,7 @@ class Functions
*
* @param array|mixed $array Array to be flattened
*
- * @return array Flattened array
+ * @return array Flattened array
*/
public static function flattenArrayIndexed($array): array
{
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
index f3a7462..00a5d65 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
@@ -15,7 +15,7 @@ class ErrorValue
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isErr(mixed $value = ''): array|bool
@@ -33,7 +33,7 @@ class ErrorValue
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isError(mixed $value = '', bool $tryNotImplemented = false): array|bool
@@ -58,7 +58,7 @@ class ErrorValue
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isNa(mixed $value = ''): array|bool
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ExcelError.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ExcelError.php
index f4ea42d..94a4a7c 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ExcelError.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ExcelError.php
@@ -39,6 +39,8 @@ class ExcelError
* ERROR_TYPE.
*
* @param mixed $value Value to check
+ *
+ * @return array|int|string
*/
public static function type(mixed $value = ''): array|int|string
{
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
index 6f04df8..57a6704 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
@@ -7,7 +7,9 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException;
use PhpOffice\PhpSpreadsheet\NamedRange;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class Value
@@ -20,7 +22,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isBlank(mixed $value = null): array|bool
@@ -43,6 +45,7 @@ class Value
return false;
}
+ $value = StringHelper::convertToString($value);
$cellValue = Functions::trimTrailingRange($value);
if (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/ui', $cellValue) === 1) {
[$worksheet, $cellValue] = Worksheet::extractSheetTitle($cellValue, true, true);
@@ -68,7 +71,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool|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 isEven(mixed $value = null): array|string|bool
@@ -79,11 +82,12 @@ class Value
if ($value === null) {
return ExcelError::NAME();
- } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ }
+ if (!is_numeric($value)) {
return ExcelError::VALUE();
}
- return ((int) fmod($value, 2)) === 0;
+ return ((int) fmod($value + 0, 2)) === 0;
}
/**
@@ -92,7 +96,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool|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 isOdd(mixed $value = null): array|string|bool
@@ -103,11 +107,12 @@ class Value
if ($value === null) {
return ExcelError::NAME();
- } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ }
+ if (!is_numeric($value)) {
return ExcelError::VALUE();
}
- return ((int) fmod($value, 2)) !== 0;
+ return ((int) fmod($value + 0, 2)) !== 0;
}
/**
@@ -116,7 +121,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isNumber(mixed $value = null): array|bool
@@ -138,7 +143,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isLogical(mixed $value = null): array|bool
@@ -156,7 +161,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isText(mixed $value = null): array|bool
@@ -174,7 +179,7 @@ class Value
* @param mixed $value Value to check
* Or can be an array of values
*
- * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * @return array|bool 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 isNonText(mixed $value = null): array|bool
@@ -191,14 +196,17 @@ class Value
*
* @param mixed $cellReference The cell to check
* @param ?Cell $cell The current cell (containing this formula)
+ *
+ * @return array|bool|string
*/
public static function isFormula(mixed $cellReference = '', ?Cell $cell = null): array|bool|string
{
if ($cell === null) {
return ExcelError::REF();
}
+ $cellReference = StringHelper::convertToString($cellReference);
- $fullCellReference = Functions::expandDefinedName((string) $cellReference, $cell);
+ $fullCellReference = Functions::expandDefinedName($cellReference, $cell);
if (str_contains($cellReference, '!')) {
$cellReference = Functions::trimSheetFromCellReference($cellReference);
@@ -219,8 +227,15 @@ class Value
$worksheet = (!empty($worksheetName))
? $cell->getWorksheet()->getParentOrThrow()->getSheetByName($worksheetName)
: $cell->getWorksheet();
+ if ($worksheet === null) {
+ return ExcelError::REF();
+ }
- return ($worksheet !== null) ? $worksheet->getCell($fullCellReference)->isFormula() : ExcelError::REF();
+ try {
+ return $worksheet->getCell($fullCellReference)->isFormula();
+ } catch (SpreadsheetException) {
+ return true;
+ }
}
/**
@@ -244,21 +259,14 @@ class Value
while (is_array($value)) {
$value = array_shift($value);
}
-
- switch (gettype($value)) {
- case 'double':
- case 'float':
- case 'integer':
- return $value;
- case 'boolean':
- return (int) $value;
- case 'string':
- // Errors
- if (($value !== '') && ($value[0] == '#')) {
- return $value;
- }
-
- break;
+ if (is_float($value) || is_int($value)) {
+ return $value;
+ }
+ if (is_bool($value)) {
+ return (int) $value;
+ }
+ if (is_string($value) && substr($value, 0, 1) === '#') {
+ return $value;
}
return 0;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/ExcelArrayPseudoFunctions.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/ExcelArrayPseudoFunctions.php
index 83ea458..8cce0b2 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/ExcelArrayPseudoFunctions.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/ExcelArrayPseudoFunctions.php
@@ -39,6 +39,7 @@ class ExcelArrayPseudoFunctions
return $result;
}
+ /** @return array|string */
public static function anchorArray(string $cellReference, Cell $cell): array|string
{
//$coordinate = $cell->getCoordinate();
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
index 22c95e8..f289c3f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
@@ -4,7 +4,11 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\Internal;
class MakeMatrix
{
- /** @param array $args */
+ /**
+ * @param mixed[] $args
+ *
+ * @return mixed[]
+ */
public static function make(...$args): array
{
return $args;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
index 16bb5dd..f0a5476 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
@@ -106,7 +106,7 @@ class Operations
* @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
* Or can be an array of values
*
- * @return array|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
*/
@@ -130,6 +130,10 @@ class Operations
return !$logical;
}
+ /**
+ * @param mixed[] $args
+ * @param callable(int, int): bool $func
+ */
private static function countTrueValues(array $args, callable $func): bool|string
{
$trueValueCount = 0;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
index 0a5347b..a17e554 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
@@ -6,6 +6,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Cell\AddressHelper;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Address
{
@@ -44,7 +45,7 @@ class Address
* @param mixed $sheetName Optional Name of worksheet to use
* Or can be an array of values
*
- * @return array|string If an array of values is passed as the $testValue argument, then the returned result will also be
+ * @return mixed[]|string 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 cell(mixed $row, mixed $column, mixed $relativity = 1, mixed $referenceStyle = true, mixed $sheetName = ''): array|string
@@ -63,14 +64,16 @@ class Address
);
}
- $relativity = $relativity ?? 1;
+ $relativity = ($relativity === null) ? 1 : (int) StringHelper::convertToString($relativity);
$referenceStyle = $referenceStyle ?? true;
+ $row = (int) StringHelper::convertToString($row);
+ $column = (int) StringHelper::convertToString($column);
if (($row < 1) || ($column < 1)) {
return ExcelError::VALUE();
}
- $sheetName = self::sheetName($sheetName);
+ $sheetName = self::sheetName(StringHelper::convertToString($sheetName));
if (is_int($referenceStyle)) {
$referenceStyle = (bool) $referenceStyle;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ChooseRowsEtc.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ChooseRowsEtc.php
index 97303e7..944675e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ChooseRowsEtc.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ChooseRowsEtc.php
@@ -80,6 +80,11 @@ class ChooseRowsEtc
return $outputArray;
}
+ /**
+ * @param mixed[] $array
+ *
+ * @return mixed[]|string
+ */
private static function dropRows(array $array, mixed $offset): array|string
{
if ($offset === null) {
@@ -134,6 +139,11 @@ class ChooseRowsEtc
return self::transpose($outputArray3);
}
+ /**
+ * @param mixed[] $array
+ *
+ * @return mixed[]|string
+ */
private static function takeRows(array $array, mixed $offset): array|string
{
if ($offset === null) {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
index 43e89c9..3a1a6c4 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
@@ -30,7 +30,7 @@ class ExcelMatch
* @param mixed $matchType The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below.
* If match_type is 1 or -1, the list has to be ordered.
*
- * @return array|float|int|string The relative position of the found item
+ * @return array|float|int|string The relative position of the found item
*/
public static function MATCH(mixed $lookupValue, mixed $lookupArray, mixed $matchType = self::MATCHTYPE_LARGEST_VALUE): array|string|int|float
{
@@ -70,13 +70,14 @@ class ExcelMatch
};
if ($valueKey !== null) {
- return ++$valueKey;
+ return ++$valueKey; //* @phpstan-ignore-line
}
// Unsuccessful in finding a match, return #N/A error value
return ExcelError::NA();
}
+ /** @param mixed[] $lookupArray */
private static function matchFirstValue(array $lookupArray, mixed $lookupValue): int|string|null
{
if (is_string($lookupValue)) {
@@ -113,6 +114,10 @@ class ExcelMatch
return null;
}
+ /**
+ * @param mixed[] $lookupArray
+ * @param mixed[] $keySet
+ */
private static function matchLargestValue(array $lookupArray, mixed $lookupValue, array $keySet): mixed
{
if (is_string($lookupValue)) {
@@ -147,6 +152,7 @@ class ExcelMatch
return null;
}
+ /** @param mixed[] $lookupArray */
private static function matchSmallestValue(array $lookupArray, mixed $lookupValue): int|string|null
{
$valueKey = null;
@@ -215,6 +221,7 @@ class ExcelMatch
return self::MATCHTYPE_FIRST_VALUE;
}
+ /** @param mixed[] $lookupArray */
private static function validateLookupArray(array $lookupArray): void
{
// Lookup_array should not be empty
@@ -224,6 +231,11 @@ class ExcelMatch
}
}
+ /**
+ * @param mixed[] $lookupArray
+ *
+ * @return mixed[]
+ */
private static function prepareLookupArray(array $lookupArray, mixed $matchType): array
{
// Lookup_array should contain only number, text, or logical values, or empty (null) cells
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
index daedcd0..486194e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
@@ -6,8 +6,12 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class Filter
{
- public static function filter(array $lookupArray, mixed $matchArray, mixed $ifEmpty = null): mixed
+ public static function filter(mixed $lookupArray, mixed $matchArray, mixed $ifEmpty = null): mixed
{
+ if (!is_array($lookupArray)) {
+ return ExcelError::VALUE();
+ }
+ /** @var mixed[] $lookupArray */
if (!is_array($matchArray)) {
return ExcelError::VALUE();
}
@@ -21,10 +25,17 @@ class Filter
if (empty($result)) {
return $ifEmpty ?? ExcelError::CALC();
}
+ /** @var callable(mixed): mixed */
+ $func = 'array_values';
- return array_values(array_map('array_values', $result));
+ return array_values(array_map($func, $result));
}
+ /**
+ * @param mixed[] $sortArray
+ *
+ * @return mixed[]
+ */
private static function enumerateArrayKeys(array $sortArray): array
{
array_walk(
@@ -39,17 +50,29 @@ class Filter
return array_values($sortArray);
}
+ /**
+ * @param mixed[] $lookupArray
+ * @param mixed[] $matchArray
+ *
+ * @return mixed[]
+ */
private static function filterByRow(array $lookupArray, array $matchArray): array
{
$matchArray = array_values(array_column($matchArray, 0)); // @phpstan-ignore-line
return array_filter(
array_values($lookupArray),
- fn ($index): bool => (bool) $matchArray[$index],
+ fn ($index): bool => (bool) ($matchArray[$index] ?? null),
ARRAY_FILTER_USE_KEY
);
}
+ /**
+ * @param mixed[] $lookupArray
+ * @param mixed[] $matchArray
+ *
+ * @return mixed[]
+ */
private static function filterByColumn(array $lookupArray, array $matchArray): array
{
$lookupArray = Matrix::transpose($lookupArray);
@@ -57,7 +80,7 @@ class Filter
if (count($matchArray) === 1) {
$matchArray = array_pop($matchArray);
}
-
+ /** @var mixed[] $matchArray */
array_walk(
$matchArray,
function (&$value): void {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
index 55a2a8f..f4982a0 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
@@ -5,6 +5,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Formula
{
@@ -21,6 +22,7 @@ class Formula
}
$worksheet = null;
+ $cellReference = StringHelper::convertToString($cellReference);
if (1 === preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches)) {
$cellReference = $matches[6] . $matches[7];
$worksheetName = trim($matches[3], "'");
@@ -37,6 +39,6 @@ class Formula
return ExcelError::NA();
}
- return $worksheet->getCell($cellReference)->getValue();
+ return $worksheet->getCell($cellReference)->getValueString();
}
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
index fd83700..30c021b 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
@@ -18,14 +18,14 @@ class HLookup extends LookupBase
* in the same column based on the index_number.
*
* @param mixed $lookupValue The value that you want to match in lookup_array
- * @param mixed $lookupArray The range of cells being searched
- * @param mixed $indexNumber The row number in table_array from which the matching value must be returned.
+ * @param mixed[][] $lookupArray The range of cells being searched
+ * @param array|float|int|string $indexNumber The row number in table_array from which the matching value must be returned.
* The first row is 1.
* @param mixed $notExactMatch determines if you are looking for an exact match based on lookup_value
*
* @return mixed The value of the found cell
*/
- public static function lookup(mixed $lookupValue, mixed $lookupArray, mixed $indexNumber, mixed $notExactMatch = true): mixed
+ public static function lookup(mixed $lookupValue, $lookupArray, $indexNumber, mixed $notExactMatch = true): mixed
{
if (is_array($lookupValue) || is_array($indexNumber)) {
return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $lookupValue, $lookupArray, $indexNumber, $notExactMatch);
@@ -49,6 +49,7 @@ class HLookup extends LookupBase
$firstkey = $f[0] - 1;
$returnColumn = $firstkey + $indexNumber;
+ /** @var mixed[][] $lookupArray */
$firstColumn = array_shift($f) ?? 1;
$rowNumber = self::hLookupSearch($lookupValue, $lookupArray, $firstColumn, $notExactMatch);
@@ -62,17 +63,20 @@ class HLookup extends LookupBase
/**
* @param mixed $lookupValue The value that you want to match in lookup_array
+ * @param mixed[][] $lookupArray
* @param int|string $column
*/
private static function hLookupSearch(mixed $lookupValue, array $lookupArray, $column, bool $notExactMatch): ?int
{
- $lookupLower = StringHelper::strToLower((string) $lookupValue);
+ $lookupLower = StringHelper::strToLower(StringHelper::convertToString($lookupValue));
$rowNumber = null;
foreach ($lookupArray[$column] as $rowKey => $rowData) {
// break if we have passed possible keys
+ /** @var string $rowKey */
$bothNumeric = is_numeric($lookupValue) && is_numeric($rowData);
$bothNotNumeric = !is_numeric($lookupValue) && !is_numeric($rowData);
+ /** @var scalar $rowData */
$cellDataLower = StringHelper::strToLower((string) $rowData);
if (
@@ -96,6 +100,11 @@ class HLookup extends LookupBase
return $rowNumber;
}
+ /**
+ * @param mixed[] $lookupArray
+ *
+ * @return mixed[]
+ */
private static function convertLiteralArray(array $lookupArray): array
{
if (array_key_exists(0, $lookupArray)) {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
index 21c2030..5f94ffa 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
@@ -35,6 +35,7 @@ class Helpers
}
}
+ /** @return array{string, ?string, string} */
public static function extractCellAddresses(string $cellAddress, bool $a1, Worksheet $sheet, string $sheetName = '', ?int $baseRow = null, ?int $baseCol = null): array
{
$cellAddress1 = $cellAddress;
@@ -57,6 +58,7 @@ class Helpers
return [$cellAddress1, $cellAddress2, $cellAddress];
}
+ /** @return array{string, ?Worksheet, string} */
public static function extractWorksheet(string $cellAddress, Cell $cell): array
{
$sheetName = '';
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
index 455442a..e7752aa 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
@@ -5,6 +5,7 @@ namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
+use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
class Hyperlink
{
@@ -22,18 +23,23 @@ class Hyperlink
*/
public static function set(mixed $linkURL = '', mixed $displayName = null, ?Cell $cell = null): string
{
- $linkURL = ($linkURL === null) ? '' : Functions::flattenSingleValue($linkURL);
+ $linkURL = ($linkURL === null) ? '' : StringHelper::convertToString(Functions::flattenSingleValue($linkURL));
$displayName = ($displayName === null) ? '' : Functions::flattenSingleValue($displayName);
if ((!is_object($cell)) || (trim($linkURL) == '')) {
return ExcelError::REF();
}
- if ((is_object($displayName)) || trim($displayName) == '') {
+ if (is_object($displayName)) {
+ $displayName = $linkURL;
+ }
+ $displayName = StringHelper::convertToString($displayName);
+ if (trim($displayName) === '') {
$displayName = $linkURL;
}
- $cell->getHyperlink()->setUrl($linkURL);
+ $cell->getHyperlink()
+ ->setUrl($linkURL);
$cell->getHyperlink()->setTooltip($displayName);
return $displayName;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
index d53900d..756478c 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
@@ -34,6 +34,8 @@ class Indirect
/**
* Convert cellAddress to string, verify not null string.
+ *
+ * @param null|mixed[]|string $cellAddress
*/
private static function validateAddress(array|string|null $cellAddress): string
{
@@ -54,12 +56,12 @@ class Indirect
* Excel Function:
* =INDIRECT(cellAddress, bool) where the bool argument is optional
*
- * @param array|string $cellAddress $cellAddress The cell address of the current cell (containing this formula)
+ * @param mixed[]|string $cellAddress $cellAddress The cell address of the current cell (containing this formula)
* @param mixed $a1fmt Expect bool Helpers::CELLADDRESS_USE_A1 or CELLADDRESS_USE_R1C1,
* but can be provided as numeric which is cast to bool
* @param Cell $cell The current cell (containing this formula)
*
- * @return array|string An array containing a cell or range of cells, or a string on error
+ * @return mixed[]|string An array containing a cell or range of cells, or a string on error
*/
public static function INDIRECT($cellAddress, mixed $a1fmt, Cell $cell): string|array
{
@@ -99,13 +101,13 @@ class Indirect
/**
* Extract range values.
*
- * @return array Array of values in range if range contains more than one element.
+ * @return mixed[] Array of values in range if range contains more than one element.
* Otherwise, a single value is returned.
*/
private static function extractRequiredCells(?Worksheet $worksheet, string $cellAddress): array
{
return Calculation::getInstance($worksheet !== null ? $worksheet->getParent() : null)
- ->extractCellRange($cellAddress, $worksheet, false);
+ ->extractCellRange($cellAddress, $worksheet, false, createCell: true);
}
private static function handleRowColumnRanges(?Worksheet $worksheet, string $start, string $end): string
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
index b187620..9d3eea4 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
@@ -28,6 +28,7 @@ class Lookup
if (!is_array($lookupVector)) {
return ExcelError::NA();
}
+ /** @var mixed[][] $lookupVector */
$hasResultVector = isset($resultVector);
$lookupRows = self::rowCount($lookupVector);
$lookupColumns = self::columnCount($lookupVector);
@@ -35,16 +36,19 @@ class Lookup
if (($lookupRows === 1 && $lookupColumns > 1) || (!$hasResultVector && $lookupRows === 2 && $lookupColumns !== 2)) {
$lookupVector = Matrix::transpose($lookupVector);
$lookupRows = self::rowCount($lookupVector);
+ /** @var mixed[][] $lookupVector */
$lookupColumns = self::columnCount($lookupVector);
}
- $resultVector = self::verifyResultVector($resultVector ?? $lookupVector);
+ $resultVector = self::verifyResultVector($resultVector ?? $lookupVector); //* @phpstan-ignore-line
if ($lookupRows === 2 && !$hasResultVector) {
$resultVector = array_pop($lookupVector);
$lookupVector = array_shift($lookupVector);
}
+ /** @var mixed[] $lookupVector */
+ /** @var mixed[] $resultVector */
if ($lookupColumns !== 2) {
$lookupVector = self::verifyLookupValues($lookupVector, $resultVector);
}
@@ -52,6 +56,12 @@ class Lookup
return VLookup::lookup($lookupValue, $lookupVector, 2);
}
+ /**
+ * @param mixed[] $lookupVector
+ * @param mixed[] $resultVector
+ *
+ * @return mixed[]
+ */
private static function verifyLookupValues(array $lookupVector, array $resultVector): array
{
foreach ($lookupVector as &$value) {
@@ -77,6 +87,11 @@ class Lookup
return $lookupVector;
}
+ /**
+ * @param mixed[][] $resultVector
+ *
+ * @return mixed[]
+ */
private static function verifyResultVector(array $resultVector): array
{
$resultRows = self::rowCount($resultVector);
@@ -90,11 +105,13 @@ class Lookup
return $resultVector;
}
+ /** @param mixed[] $dataArray */
private static function rowCount(array $dataArray): int
{
return count($dataArray);
}
+ /** @param mixed[][] $dataArray */
private static function columnCount(array $dataArray): int
{
$rowKeys = array_keys($dataArray);
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
index 7d21cce..39c498f 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
@@ -7,15 +7,18 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
abstract class LookupBase
{
- protected static function validateLookupArray(mixed $lookup_array): void
+ protected static function validateLookupArray(mixed $lookupArray): void
{
- if (!is_array($lookup_array)) {
+ if (!is_array($lookupArray)) {
throw new Exception(ExcelError::REF());
}
}
- /** @param float|int|string $index_number */
- protected static function validateIndexLookup(array $lookup_array, $index_number): int
+ /**
+ * @param mixed[] $lookupArray
+ * @param float|int|string $index_number number >= 1
+ */
+ protected static function validateIndexLookup(array $lookupArray, $index_number): int
{
// index_number must be a number greater than or equal to 1.
// Excel results are inconsistent when index is non-numeric.
@@ -30,8 +33,8 @@ abstract class LookupBase
throw new Exception(ExcelError::VALUE());
}
- // index_number must be less than or equal to the number of columns in lookup_array
- if (empty($lookup_array)) {
+ // index_number must be less than or equal to the number of columns in lookupArray
+ if (empty($lookupArray)) {
throw new Exception(ExcelError::REF());
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php
index 74c313c..620705e 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php
@@ -11,7 +11,7 @@ class LookupRefValidations
public static function validateInt(mixed $value): int
{
if (!is_numeric($value)) {
- if (ErrorValue::isError($value)) {
+ if (is_string($value) && ErrorValue::isError($value)) {
throw new Exception($value);
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php
index b8e84a6..287e841 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php
@@ -12,6 +12,8 @@ class Matrix
/**
* Helper function; NOT an implementation of any Excel Function.
+ *
+ * @param mixed[] $values
*/
public static function isColumnVector(array $values): bool
{
@@ -20,6 +22,8 @@ class Matrix
/**
* Helper function; NOT an implementation of any Excel Function.
+ *
+ * @param mixed[] $values
*/
public static function isRowVector(array $values): bool
{
@@ -30,7 +34,9 @@ class Matrix
/**
* TRANSPOSE.
*
- * @param array|mixed $matrixData A matrix of values
+ * @param mixed $matrixData A matrix of values
+ *
+ * @return mixed[]
*/
public static function transpose($matrixData): array
{
@@ -38,8 +44,12 @@ class Matrix
if (!is_array($matrixData)) {
$matrixData = [[$matrixData]];
}
+ if (!is_array(end($matrixData))) {
+ $matrixData = [$matrixData];
+ }
$column = 0;
+ /** @var mixed[][] $matrixData */
foreach ($matrixData as $matrixRow) {
$row = 0;
foreach ($matrixRow as $matrixCell) {
@@ -115,7 +125,7 @@ class Matrix
}
$rowKeys = array_keys($matrix);
- $columnKeys = @array_keys($matrix[$rowKeys[0]]);
+ $columnKeys = @array_keys($matrix[$rowKeys[0]]); //* @phpstan-ignore-line
if ($columnNum > count($columnKeys)) {
return ExcelError::REF();
@@ -125,18 +135,23 @@ class Matrix
return self::extractRowValue($matrix, $rowKeys, $rowNum);
}
- $columnNum = $columnKeys[--$columnNum];
+ $columnNum = $columnKeys[--$columnNum]; //* @phpstan-ignore-line
if ($rowNum === 0) {
return array_map(
fn ($value): array => [$value],
array_column($matrix, $columnNum)
);
}
- $rowNum = $rowKeys[--$rowNum];
+ $rowNum = $rowKeys[--$rowNum]; //* @phpstan-ignore-line
+ /** @var mixed[][] $matrix */
return $matrix[$rowNum][$columnNum];
}
+ /**
+ * @param mixed[] $matrix
+ * @param mixed[] $rowKeys
+ */
private static function extractRowValue(array $matrix, array $rowKeys, int $rowNum): mixed
{
if ($rowNum === 0) {
@@ -144,7 +159,7 @@ class Matrix
}
$rowNum = $rowKeys[--$rowNum];
- $row = $matrix[$rowNum];
+ $row = $matrix[$rowNum]; //* @phpstan-ignore-line
if (is_array($row)) {
return [$rowNum => $row];
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
index 9d201ff..6b07262 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
@@ -25,28 +25,32 @@ class Offset
* @param null|string $cellAddress The reference from which you want to base the offset.
* Reference must refer to a cell or range of adjacent cells;
* otherwise, OFFSET returns the #VALUE! error value.
- * @param mixed $rows The number of rows, up or down, that you want the upper-left cell to refer to.
+ * @param int $rows The number of rows, up or down, that you want the upper-left cell to refer to.
* Using 5 as the rows argument specifies that the upper-left cell in the
* reference is five rows below reference. Rows can be positive (which means
* below the starting reference) or negative (which means above the starting
* reference).
- * @param mixed $columns The number of columns, to the left or right, that you want the upper-left cell
+ * @param int $columns The number of columns, to the left or right, that you want the upper-left cell
* of the result to refer to. Using 5 as the cols argument specifies that the
* upper-left cell in the reference is five columns to the right of reference.
* Cols can be positive (which means to the right of the starting reference)
* or negative (which means to the left of the starting reference).
- * @param mixed $height The height, in number of rows, that you want the returned reference to be.
+ * @param ?int $height The height, in number of rows, that you want the returned reference to be.
* Height must be a positive number.
- * @param mixed $width The width, in number of columns, that you want the returned reference to be.
+ * @param ?int $width The width, in number of columns, that you want the returned reference to be.
* Width must be a positive number.
*
- * @return array|string An array containing a cell or range of cells, or a string on error
+ * @return array|string An array containing a cell or range of cells, or a string on error
*/
- public static function OFFSET(?string $cellAddress = null, mixed $rows = 0, mixed $columns = 0, mixed $height = null, mixed $width = null, ?Cell $cell = null): string|array
+ public static function OFFSET(?string $cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $cell = null): string|array
{
+ /** @var int */
$rows = Functions::flattenSingleValue($rows);
+ /** @var int */
$columns = Functions::flattenSingleValue($columns);
+ /** @var int */
$height = Functions::flattenSingleValue($height);
+ /** @var int */
$width = Functions::flattenSingleValue($width);
if ($cellAddress === null || $cellAddress === '') {
@@ -95,12 +99,14 @@ class Offset
return self::extractRequiredCells($worksheet, $cellAddress);
}
+ /** @return mixed[] */
private static function extractRequiredCells(?Worksheet $worksheet, string $cellAddress): array
{
return Calculation::getInstance($worksheet !== null ? $worksheet->getParent() : null)
->extractCellRange($cellAddress, $worksheet, false);
}
+ /** @return array{string, ?Worksheet} */
private static function extractWorksheet(?string $cellAddress, Cell $cell): array
{
$cellAddress = self::assessCellAddress($cellAddress ?? '', $cell);
@@ -126,7 +132,11 @@ class Offset
return $cellAddress;
}
- private static function adjustEndCellColumnForWidth(string $endCellColumn, mixed $width, int $startCellColumn, mixed $columns): int
+ /**
+ * @param null|object|scalar $width
+ * @param scalar $columns
+ */
+ private static function adjustEndCellColumnForWidth(string $endCellColumn, $width, int $startCellColumn, $columns): int
{
$endCellColumn = Coordinate::columnIndexFromString($endCellColumn) - 1;
if (($width !== null) && (!is_object($width))) {
@@ -138,7 +148,11 @@ class Offset
return $endCellColumn;
}
- private static function adustEndCellRowForHeight(mixed $height, int $startCellRow, mixed $rows, mixed $endCellRow): int
+ /**
+ * @param null|object|scalar $height
+ * @param scalar $rows
+ */
+ private static function adustEndCellRowForHeight($height, int $startCellRow, $rows, int $endCellRow): int
{
if (($height !== null) && (!is_object($height))) {
$endCellRow = $startCellRow + (int) $height - 1;
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
index ea3ce44..caf0983 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
@@ -3,9 +3,11 @@
namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
+use PhpOffice\PhpSpreadsheet\Calculation\Information\ErrorValue;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use PhpOffice\PhpSpreadsheet\Exception as SpreadsheetException;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class RowColumnInformation
@@ -13,7 +15,7 @@ class RowColumnInformation
/**
* Test if cellAddress is null or whitespace string.
*
- * @param null|array|string $cellAddress A reference to a range of cells
+ * @param null|mixed[]|string $cellAddress A reference to a range of cells
*/
private static function cellAddressNullOrWhitespace($cellAddress): bool
{
@@ -38,11 +40,11 @@ class RowColumnInformation
* Excel Function:
* =COLUMN([cellAddress])
*
- * @param null|array|string $cellAddress A reference to a range of cells for which you want the column numbers
+ * @param null|mixed[]|string $cellAddress A reference to a range of cells for which you want the column numbers
*
- * @return int|int[]
+ * @return int|int[]|string
*/
- public static function COLUMN($cellAddress = null, ?Cell $cell = null): int|array
+ public static function COLUMN($cellAddress = null, ?Cell $cell = null): int|string|array
{
if (self::cellAddressNullOrWhitespace($cellAddress)) {
return self::cellColumn($cell);
@@ -79,7 +81,11 @@ class RowColumnInformation
$cellAddress = (string) preg_replace('/[^a-z]/i', '', $cellAddress);
- return Coordinate::columnIndexFromString($cellAddress);
+ try {
+ return Coordinate::columnIndexFromString($cellAddress);
+ } catch (SpreadsheetException) {
+ return ExcelError::NAME();
+ }
}
/**
@@ -90,7 +96,7 @@ class RowColumnInformation
* Excel Function:
* =COLUMNS(cellAddress)
*
- * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells
+ * @param null|mixed[]|string $cellAddress An array or array formula, or a reference to a range of cells
* for which you want the number of columns
*
* @return int|string The number of columns in cellAddress, or a string if arguments are invalid
@@ -100,6 +106,9 @@ class RowColumnInformation
if (self::cellAddressNullOrWhitespace($cellAddress)) {
return 1;
}
+ if (is_string($cellAddress) && ErrorValue::isError($cellAddress)) {
+ return $cellAddress;
+ }
if (!is_array($cellAddress)) {
return ExcelError::VALUE();
}
@@ -115,9 +124,18 @@ class RowColumnInformation
return $columns;
}
- private static function cellRow(?Cell $cell): int
+ private static function cellRow(?Cell $cell): int|string
{
- return ($cell !== null) ? $cell->getRow() : 1;
+ return ($cell !== null) ? self::convert0ToName($cell->getRow()) : 1;
+ }
+
+ private static function convert0ToName(int|string $result): int|string
+ {
+ if (is_int($result) && ($result <= 0 || $result > 1048576)) {
+ return ExcelError::NAME();
+ }
+
+ return $result;
}
/**
@@ -133,11 +151,11 @@ class RowColumnInformation
* Excel Function:
* =ROW([cellAddress])
*
- * @param null|array|string $cellAddress A reference to a range of cells for which you want the row numbers
+ * @param null|mixed[][]|string $cellAddress A reference to a range of cells for which you want the row numbers
*
- * @return int|mixed[]
+ * @return int|mixed[]|string
*/
- public static function ROW($cellAddress = null, ?Cell $cell = null): int|array
+ public static function ROW($cellAddress = null, ?Cell $cell = null): int|string|array
{
if (self::cellAddressNullOrWhitespace($cellAddress)) {
return self::cellRow($cell);
@@ -172,7 +190,7 @@ class RowColumnInformation
}
[$cellAddress] = explode(':', $cellAddress);
- return (int) preg_replace('/\D/', '', $cellAddress);
+ return self::convert0ToName((int) preg_replace('/\D/', '', $cellAddress));
}
/**
@@ -183,7 +201,7 @@ class RowColumnInformation
* Excel Function:
* =ROWS(cellAddress)
*
- * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells
+ * @param null|mixed[]|string $cellAddress An array or array formula, or a reference to a range of cells
* for which you want the number of rows
*
* @return int|string The number of rows in cellAddress, or a string if arguments are invalid
@@ -193,6 +211,9 @@ class RowColumnInformation
if (self::cellAddressNullOrWhitespace($cellAddress)) {
return 1;
}
+ if (is_string($cellAddress) && ErrorValue::isError($cellAddress)) {
+ return $cellAddress;
+ }
if (!is_array($cellAddress)) {
return ExcelError::VALUE();
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
index 9ad47b4..78a30a4 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
@@ -36,6 +36,7 @@ class Sort extends LookupRefValidations
return $sortArray;
}
+ /** @var mixed[][] */
$sortArray = self::enumerateArrayKeys($sortArray);
$byColumn = (bool) $byColumn;
@@ -43,7 +44,7 @@ class Sort extends LookupRefValidations
try {
// If $sortIndex and $sortOrder are scalars, then convert them into arrays
- if (is_scalar($sortIndex)) {
+ if (!is_array($sortIndex)) {
$sortIndex = [$sortIndex];
$sortOrder = is_scalar($sortOrder) ? [$sortOrder] : $sortOrder;
}
@@ -55,7 +56,11 @@ class Sort extends LookupRefValidations
}
// We want a simple, enumrated array of arrays where we can reference column by its index number.
- $sortArray = array_values(array_map('array_values', $sortArray));
+ /** @var callable(mixed): mixed */
+ $temp = 'array_values';
+ /** @var array $sortOrder */
+ $sortArray = array_values(array_map($temp, $sortArray));
+ /** @var int[] $sortIndex */
return ($byColumn === true)
? self::sortByColumn($sortArray, $sortIndex, $sortOrder)
@@ -104,6 +109,11 @@ class Sort extends LookupRefValidations
return self::processSortBy($sortArray, $sortBy, $sortOrder);
}
+ /**
+ * @param mixed[] $sortArray
+ *
+ * @return mixed[]
+ */
private static function enumerateArrayKeys(array $sortArray): array
{
array_walk(
@@ -133,6 +143,7 @@ class Sort extends LookupRefValidations
$sortOrder = self::validateSortOrder($sortOrder);
}
+ /** @return mixed[] */
private static function validateSortVector(mixed $sortVector, int $sortArraySize): array
{
if (!is_array($sortVector)) {
@@ -158,6 +169,7 @@ class Sort extends LookupRefValidations
return $sortOrder;
}
+ /** @param mixed[] $sortIndex */
private static function validateArrayArgumentsForSort(array &$sortIndex, mixed &$sortOrder, int $sortArraySize): void
{
// It doesn't matter if they're row or column vectors, it works either way
@@ -184,6 +196,11 @@ class Sort extends LookupRefValidations
}
}
+ /**
+ * @param mixed[] $sortVector
+ *
+ * @return mixed[]
+ */
private static function prepareSortVectorValues(array $sortVector): array
{
// Strings should be sorted case-insensitive; with booleans converted to locale-strings
@@ -202,14 +219,19 @@ class Sort extends LookupRefValidations
}
/**
- * @param array[] $sortIndex
+ * @param mixed[] $sortArray
+ * @param mixed[] $sortIndex
* @param int[] $sortOrder
+ *
+ * @return mixed[]
*/
private static function processSortBy(array $sortArray, array $sortIndex, array $sortOrder): array
{
$sortArguments = [];
+ /** @var mixed[] */
$sortData = [];
foreach ($sortIndex as $index => $sortValues) {
+ /** @var mixed[] $sortValues */
$sortData[] = $sortValues;
$sortArguments[] = self::prepareSortVectorValues($sortValues);
$sortArguments[] = $sortOrder[$index] === self::ORDER_ASCENDING ? SORT_ASC : SORT_DESC;
@@ -221,8 +243,11 @@ class Sort extends LookupRefValidations
}
/**
+ * @param mixed[] $sortArray
* @param int[] $sortIndex
* @param int[] $sortOrder
+ *
+ * @return mixed[]
*/
private static function sortByRow(array $sortArray, array $sortIndex, array $sortOrder): array
{
@@ -232,8 +257,11 @@ class Sort extends LookupRefValidations
}
/**
+ * @param mixed[] $sortArray
* @param int[] $sortIndex
* @param int[] $sortOrder
+ *
+ * @return mixed[]
*/
private static function sortByColumn(array $sortArray, array $sortIndex, array $sortOrder): array
{
@@ -244,8 +272,11 @@ class Sort extends LookupRefValidations
}
/**
+ * @param mixed[] $sortArray
* @param int[] $sortIndex
* @param int[] $sortOrder
+ *
+ * @return mixed[]
*/
private static function buildVectorForSort(array $sortArray, array $sortIndex, array $sortOrder): array
{
@@ -263,6 +294,12 @@ class Sort extends LookupRefValidations
return $sortData;
}
+ /**
+ * @param mixed[] $sortData
+ * @param mixed[] $sortArguments
+ *
+ * @return mixed[]
+ */
private static function executeVectorSortQuery(array $sortData, array $sortArguments): array
{
$sortData = Matrix::transpose($sortData);
@@ -287,11 +324,18 @@ class Sort extends LookupRefValidations
return $sortedData;
}
+ /**
+ * @param mixed[] $sortArray
+ * @param mixed[] $sortVector
+ *
+ * @return mixed[]
+ */
private static function sortLookupArrayFromVector(array $sortArray, array $sortVector): array
{
// Building a new array in the correct (sorted) order works; but may be memory heavy for larger arrays
$sortedArray = [];
foreach ($sortVector as $index) {
+ /** @var int|string $index */
$sortedArray[] = $sortArray[$index];
}
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
index 103520e..40a9df7 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
@@ -33,17 +33,20 @@ class Unique
: self::uniqueByRow($lookupVector, $exactlyOnce);
}
+ /** @param mixed[] $lookupVector */
private static function uniqueByRow(array $lookupVector, bool $exactlyOnce): mixed
{
// When not $byColumn, we count whole rows or values, not individual values
// so implode each row into a single string value
array_walk(
$lookupVector,
+ //* @phpstan-ignore-next-line
function (array &$value): void {
$valuex = '';
$separator = '';
$numericIndicator = "\x01";
foreach ($value as $cellValue) {
+ /** @var scalar $cellValue */
$valuex .= $separator . $cellValue;
$separator = "\x00";
if (is_int($cellValue) || is_float($cellValue)) {
@@ -54,6 +57,7 @@ class Unique
}
);
+ /** @var string[] $lookupVector */
$result = self::countValuesCaseInsensitive($lookupVector);
if ($exactlyOnce === true) {
@@ -84,8 +88,10 @@ class Unique
return (count($result) === 1) ? array_pop($result) : $result;
}
+ /** @param mixed[] $lookupVector */
private static function uniqueByColumn(array $lookupVector, bool $exactlyOnce): mixed
{
+ /** @var string[] */
$flattenedLookupVector = Functions::flattenArray($lookupVector);
if (count($lookupVector, COUNT_RECURSIVE) > count($flattenedLookupVector, COUNT_RECURSIVE) + 1) {
@@ -111,6 +117,11 @@ class Unique
return $result;
}
+ /**
+ * @param string[] $caseSensitiveLookupValues
+ *
+ * @return mixed[]
+ */
private static function countValuesCaseInsensitive(array $caseSensitiveLookupValues): array
{
$caseInsensitiveCounts = array_count_values(
@@ -138,6 +149,11 @@ class Unique
return $caseSensitiveCounts;
}
+ /**
+ * @param mixed[] $values
+ *
+ * @return mixed[]
+ */
private static function exactlyOnceFilter(array $values): array
{
return array_filter(
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
index 1c24b2a..76929c5 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
@@ -17,14 +17,14 @@ class VLookup extends LookupBase
* in the same row based on the index_number.
*
* @param mixed $lookupValue The value that you want to match in lookup_array
- * @param mixed $lookupArray The range of cells being searched
- * @param mixed $indexNumber The column number in table_array from which the matching value must be returned.
+ * @param mixed[] $lookupArray The range of cells being searched
+ * @param array|float|int|string $indexNumber The column number in table_array from which the matching value must be returned.
* The first column is 1.
* @param mixed $notExactMatch determines if you are looking for an exact match based on lookup_value
*
* @return mixed The value of the found cell
*/
- public static function lookup(mixed $lookupValue, mixed $lookupArray, mixed $indexNumber, mixed $notExactMatch = true): mixed
+ public static function lookup(mixed $lookupValue, $lookupArray, mixed $indexNumber, mixed $notExactMatch = true): mixed
{
if (is_array($lookupValue) || is_array($indexNumber)) {
return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $lookupValue, $lookupArray, $indexNumber, $notExactMatch);
@@ -54,6 +54,7 @@ class VLookup extends LookupBase
uasort($lookupArray, $callable);
}
+ /** @var string[][] $lookupArray */
$rowNumber = self::vLookupSearch($lookupValue, $lookupArray, $firstColumn, $notExactMatch);
if ($rowNumber !== null) {
@@ -64,6 +65,10 @@ class VLookup extends LookupBase
return ExcelError::NA();
}
+ /**
+ * @param scalar[] $a
+ * @param scalar[] $b
+ */
private static function vlookupSort(array $a, array $b): int
{
reset($a);
@@ -80,11 +85,12 @@ class VLookup extends LookupBase
/**
* @param mixed $lookupValue The value that you want to match in lookup_array
+ * @param string[][] $lookupArray
* @param int|string $column
*/
private static function vLookupSearch(mixed $lookupValue, array $lookupArray, $column, bool $notExactMatch): ?int
{
- $lookupLower = StringHelper::strToLower((string) $lookupValue);
+ $lookupLower = StringHelper::strToLower(StringHelper::convertToString($lookupValue));
$rowNumber = null;
foreach ($lookupArray as $rowKey => $rowData) {
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
index 03e6139..3b7e532 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
@@ -16,7 +16,7 @@ class Absolute
*
* @param mixed $number Should be numeric, or can be an array of numbers
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
index e7de7aa..7c3597d 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
@@ -16,7 +16,7 @@ class Angle
*
* @param mixed $number Should be numeric, or can be an array of numbers
*
- * @return array|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
*/
@@ -42,7 +42,7 @@ class Angle
*
* @param mixed $number Should be numeric, or can be an array of numbers
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
index 8901d3f..47c2c98 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
@@ -22,6 +22,8 @@ class Arabic
/**
* Recursively calculate the arabic value of a roman numeral.
+ *
+ * @param string[] $roman
*/
private static function calculateArabic(array $roman, int &$sum = 0, int $subtract = 0): int
{
@@ -55,7 +57,7 @@ class Arabic
*
* @param string|string[] $roman Should be a string, or can be an array of strings
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
index 7eda72c..e9ef191 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
@@ -25,7 +25,7 @@ class Base
* @param mixed $minLength expect int or null
* Or can be an array of values
*
- * @return array|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
*/
diff --git a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
index 365ec2e..3458ca8 100644
--- a/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
+++ b/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
@@ -22,12 +22,12 @@ class Ceiling
* Excel Function:
* CEILING(number[,significance])
*
- * @param array|float $number the number you want the ceiling
+ * @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
+ * @param array|float $significance the multiple to which you want to round
* Or can be an array of values
*
- * @return array|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
*/
@@ -63,14 +63,14 @@ class Ceiling
* Or can be an array of values
* @param mixed $significance Significance
* Or can be an array of values
- * @param array|int $mode direction to round negative numbers
+ * @param array|int $mode direction to round negative numbers
* Or can be an array of values
*
- * @return array|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(mixed $number, mixed $significance = null, $mode = 0): array|string|float
+ public static function math(mixed $number, mixed $significance = null, $mode = 0, bool $checkSigns = false): array|string|float
{
if (is_array($number) || is_array($significance) || is_array($mode)) {
return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode);
@@ -87,6 +87,11 @@ class Ceiling
if (empty($significance * $number)) {
return 0.0;
}
+ if ($checkSigns) {
+ if (($number > 0 && $significance < 0) || ($number < 0 && $significance > 0)) {
+ return ExcelError::NAN();
+ }
+ }
if (self::ceilingMathTest((float) $significance, (float) $number, (int) $mode)) {
return floor($number / $significance) * $significance;
}
@@ -104,10 +109,10 @@ class Ceiling
*
* @param mixed $number the number you want to round
* Or can be an array of values
- * @param array|float $significance the multiple to which you want to round
+ * @param array