Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 10 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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])
Expand All @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Writer/Pdf/Dompdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Writer/Xlsx/Rels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
15 changes: 0 additions & 15 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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');
}