diff --git a/composer.json b/composer.json index bf03b9a795..6ab8d5232c 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "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.3 || 10.5.0-beta", "mpdf/mpdf": "^8.1.1", "phpcompatibility/php-compatibility": "^9.3", "phpstan/phpstan": "^1.1 || ^2.0", diff --git a/composer.lock b/composer.lock index 43c4aeaef7..c8ef1ab235 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eebf758015c7124f27782196c50a3253", + "content-hash": "bdd52c7e8b5927c46d3962857f7bb48d", "packages": [ { "name": "composer/pcre", @@ -1227,16 +1227,16 @@ }, { "name": "mitoteam/jpgraph", - "version": "10.4.4", + "version": "10.5.0-beta", "source": { "type": "git", "url": "https://github.com/mitoteam/jpgraph.git", - "reference": "9ad8e2fcc30f765c788a28543e9705fb541d499f" + "reference": "2a9c57a91f8e9460af5ffafe780355890711f36f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mitoteam/jpgraph/zipball/9ad8e2fcc30f765c788a28543e9705fb541d499f", - "reference": "9ad8e2fcc30f765c788a28543e9705fb541d499f", + "url": "https://api.github.com/repos/mitoteam/jpgraph/zipball/2a9c57a91f8e9460af5ffafe780355890711f36f", + "reference": "2a9c57a91f8e9460af5ffafe780355890711f36f", "shasum": "" }, "require": { @@ -1269,16 +1269,16 @@ "role": "Composer package maintenance, PHP-compatibility patches" } ], - "description": "JpGraph library composer package with PHP 8.4 support", + "description": "JpGraph library composer package with PHP 8.5 support", "homepage": "https://github.com/mitoteam/jpgraph", "keywords": [ "jpgraph" ], "support": { "issues": "https://github.com/mitoteam/jpgraph/issues", - "source": "https://github.com/mitoteam/jpgraph/tree/10.4.4" + "source": "https://github.com/mitoteam/jpgraph/tree/10.5.0-beta" }, - "time": "2025-01-01T05:39:20+00:00" + "time": "2025-08-19T05:32:34+00:00" }, { "name": "mpdf/mpdf", @@ -5644,7 +5644,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "dealerdirect/phpcodesniffer-composer-installer": 20 + "dealerdirect/phpcodesniffer-composer-installer": 20, + "mitoteam/jpgraph": 10 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index c57724926e..2e00977dfb 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -1699,7 +1699,7 @@ private function processTokenStack(false|array $tokens, ?string $cellID = null, 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])) { // 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(); diff --git a/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php b/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php index 5c72a199dc..052b9f5545 100644 --- a/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php +++ b/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php @@ -117,9 +117,9 @@ protected static function getFilteredColumn(array $database, ?int $field, array /** @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; diff --git a/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php b/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php index e6dbbcbdee..97e4c95149 100644 --- a/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php +++ b/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php @@ -78,7 +78,7 @@ public function initialiseForLoop(): void 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 @@ private function initialiseCondition(): void 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 @@ private function initialiseThen(): void 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/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 19191df4c0..2aee7378a8 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -1275,7 +1275,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet // Set comment properties $comment = $docSheet->getComment([(int) $column + 1, (int) $row + 1]); $comment->getFillColor()->setRGB($fillColor); - if (isset($drowingImages[$fillImageRelId])) { + if (isset($fillImageRelId, $drowingImages[$fillImageRelId])) { $objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $objDrawing->setName($fillImageTitle); $imagePath = str_replace(['../', '/xl/'], 'xl/', $drowingImages[$fillImageRelId]); diff --git a/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php b/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php index 9cac63970c..c52fe64805 100644 --- a/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php +++ b/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php @@ -76,7 +76,7 @@ public function save($filename, int $flags = 0): void public function specialErrorHandler(int $errno, string $errstr, string $filename, int $lineno): bool { if ($errno === E_DEPRECATED) { - if (preg_match('/canonical|imagedestroy|http_get_last_response_headers/', $errstr) === 1) { + if (preg_match('/canonical|imagedestroy|http_get_last_response_headers|Using null as an array offset/', $errstr) === 1) { return true; } } diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Rels.php b/src/PhpSpreadsheet/Writer/Xlsx/Rels.php index 2f3be064b3..a913767dc3 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Rels.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Rels.php @@ -219,7 +219,7 @@ public function writeWorksheetRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\ // (! synchronize with \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet::writeDrawings) reset($drawingOriginalIds); $relPath = key($drawingOriginalIds); - if (isset($drawingOriginalIds[$relPath])) { + if (isset($relPath, $drawingOriginalIds[$relPath])) { $rId = (int) (substr($drawingOriginalIds[$relPath], 3)); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d773f8cbdd..79adbabc4e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,9 +6,6 @@ function phpunit10ErrorHandler(int $errno, string $errstr, string $filename, int $lineno): bool { - if (strIncrement85(PHP_VERSION_ID, $errno, $errstr, $filename)) { - return true; // message suppressed - stop error handling - } $x = error_reporting() & $errno; if ( in_array( @@ -34,18 +31,6 @@ function phpunit10ErrorHandler(int $errno, string $errstr, string $filename, int return false; // continue error handling } -function strIncrement85(int $version, int $errno, string $errstr, string $filename): bool -{ - if ($version < 80500 || $errno !== E_DEPRECATED) { - return false; - } - if (preg_match('/canonical/', $errstr) === 1 && preg_match('/mitoteam/', $filename) === 1) { - return true; - } - - return false; -} - if (!method_exists(PHPUnit\Framework\TestCase::class, 'setOutputCallback')) { set_error_handler('phpunit10ErrorHandler'); }