Skip to content

Commit

Permalink
BREAKING Drop all deprecated things
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Dec 10, 2023
1 parent 2e48f15 commit 816b91d
Show file tree
Hide file tree
Showing 42 changed files with 40 additions and 10,009 deletions.
14 changes: 2 additions & 12 deletions src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use PhpOffice\PhpSpreadsheet\Calculation\Engine\CyclicReferenceStack;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\Logger;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\Operands;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
use PhpOffice\PhpSpreadsheet\Calculation\Token\Stack;
use PhpOffice\PhpSpreadsheet\Cell\AddressRange;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
Expand Down Expand Up @@ -117,17 +118,6 @@ class Calculation
*/
private Logger $debugLog;

/**
* Flag to determine how formula errors should be handled
* If true, then a user error will be triggered
* If false, then an exception will be thrown.
*
* @var ?bool
*
* @deprecated 1.25.2 use setSuppressFormulaErrors() instead
*/
public ?bool $suppressFormulaErrors = null;

private bool $suppressFormulaErrorsNew = false;

/**
Expand Down Expand Up @@ -2874,7 +2864,7 @@ public static function getExcelConstants(string $key): mixed
],
'NAME.ERROR' => [
'argumentCount' => '*',
'functionCall' => [Functions::class, 'NAME'],
'functionCall' => [ExcelError::class, 'NAME'],
],
'WILDCARDMATCH' => [
'argumentCount' => '2',
Expand Down
422 changes: 0 additions & 422 deletions src/PhpSpreadsheet/Calculation/Database.php

This file was deleted.

886 changes: 0 additions & 886 deletions src/PhpSpreadsheet/Calculation/DateTime.php

This file was deleted.

1,385 changes: 0 additions & 1,385 deletions src/PhpSpreadsheet/Calculation/Engineering.php

This file was deleted.

1,372 changes: 0 additions & 1,372 deletions src/PhpSpreadsheet/Calculation/Financial.php

This file was deleted.

333 changes: 0 additions & 333 deletions src/PhpSpreadsheet/Calculation/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,323 +197,6 @@ private static function operandSpecialHandling(mixed $operand): mixed
return $operand;
}

/**
* NULL.
*
* Returns the error value #NULL!
*
* @deprecated 1.23.0 Use the null() method in the Information\ExcelError class instead
* @see Information\ExcelError::null()
*
* @return string #NULL!
*/
public static function null(): string
{
return Information\ExcelError::null();
}

/**
* NaN.
*
* Returns the error value #NUM!
*
* @deprecated 1.23.0 Use the NAN() method in the Information\Error class instead
* @see Information\ExcelError::NAN()
*
* @return string #NUM!
*/
public static function NAN(): string
{
return Information\ExcelError::NAN();
}

/**
* REF.
*
* Returns the error value #REF!
*
* @deprecated 1.23.0 Use the REF() method in the Information\ExcelError class instead
* @see Information\ExcelError::REF()
*
* @return string #REF!
*/
public static function REF(): string
{
return Information\ExcelError::REF();
}

/**
* NA.
*
* Excel Function:
* =NA()
*
* Returns the error value #N/A
* #N/A is the error value that means "no value is available."
*
* @deprecated 1.23.0 Use the NA() method in the Information\ExcelError class instead
* @see Information\ExcelError::NA()
*
* @return string #N/A!
*/
public static function NA(): string
{
return Information\ExcelError::NA();
}

/**
* VALUE.
*
* Returns the error value #VALUE!
*
* @deprecated 1.23.0 Use the VALUE() method in the Information\ExcelError class instead
* @see Information\ExcelError::VALUE()
*
* @return string #VALUE!
*/
public static function VALUE(): string
{
return Information\ExcelError::VALUE();
}

/**
* NAME.
*
* Returns the error value #NAME?
*
* @deprecated 1.23.0 Use the NAME() method in the Information\ExcelError class instead
* @see Information\ExcelError::NAME()
*
* @return string #NAME?
*/
public static function NAME(): string
{
return Information\ExcelError::NAME();
}

/**
* DIV0.
*
* @deprecated 1.23.0 Use the DIV0() method in the Information\ExcelError class instead
* @see Information\ExcelError::DIV0()
*
* @return string #Not Yet Implemented
*/
public static function DIV0(): string
{
return Information\ExcelError::DIV0();
}

/**
* ERROR_TYPE.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the type() method in the Information\ExcelError class instead
* @see Information\ExcelError::type()
*
* @return array|int|string
*/
public static function errorType(mixed $value = '')
{
return Information\ExcelError::type($value);
}

/**
* IS_BLANK.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isBlank() method in the Information\Value class instead
* @see Information\Value::isBlank()
*
* @return array|bool
*/
public static function isBlank(mixed $value = null)
{
return Information\Value::isBlank($value);
}

/**
* IS_ERR.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isErr() method in the Information\ErrorValue class instead
* @see Information\ErrorValue::isErr()
*
* @return array|bool
*/
public static function isErr(mixed $value = '')
{
return Information\ErrorValue::isErr($value);
}

/**
* IS_ERROR.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isError() method in the Information\ErrorValue class instead
* @see Information\ErrorValue::isError()
*
* @return array|bool
*/
public static function isError(mixed $value = '')
{
return Information\ErrorValue::isError($value);
}

/**
* IS_NA.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isNa() method in the Information\ErrorValue class instead
* @see Information\ErrorValue::isNa()
*
* @return array|bool
*/
public static function isNa(mixed $value = '')
{
return Information\ErrorValue::isNa($value);
}

/**
* IS_EVEN.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isEven() method in the Information\Value class instead
* @see Information\Value::isEven()
*
* @return array|bool|string
*/
public static function isEven(mixed $value = null)
{
return Information\Value::isEven($value);
}

/**
* IS_ODD.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isOdd() method in the Information\Value class instead
* @see Information\Value::isOdd()
*
* @return array|bool|string
*/
public static function isOdd(mixed $value = null)
{
return Information\Value::isOdd($value);
}

/**
* IS_NUMBER.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isNumber() method in the Information\Value class instead
* @see Information\Value::isNumber()
*
* @return array|bool
*/
public static function isNumber(mixed $value = null)
{
return Information\Value::isNumber($value);
}

/**
* IS_LOGICAL.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isLogical() method in the Information\Value class instead
* @see Information\Value::isLogical()
*/
public static function isLogical(mixed $value = null): bool|array
{
return Information\Value::isLogical($value);
}

/**
* IS_TEXT.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isText() method in the Information\Value class instead
* @see Information\Value::isText()
*
* @return array|bool
*/
public static function isText(mixed $value = null)
{
return Information\Value::isText($value);
}

/**
* IS_NONTEXT.
*
* @param mixed $value Value to check
*
* @deprecated 1.23.0 Use the isNonText() method in the Information\Value class instead
* @see Information\Value::isNonText()
*
* @return array|bool
*/
public static function isNonText(mixed $value = null)
{
return Information\Value::isNonText($value);
}

/**
* N.
*
* Returns a value converted to a number
*
* @deprecated 1.23.0 Use the asNumber() method in the Information\Value class instead
* @see Information\Value::asNumber()
*
* @param null|mixed $value The value you want converted
*
* @return number|string N converts values listed in the following table
* If value is or refers to N returns
* A number That number
* A date The serial number of that date
* TRUE 1
* FALSE 0
* An error value The error value
* Anything else 0
*/
public static function n($value = null)
{
return Information\Value::asNumber($value);
}

/**
* TYPE.
*
* Returns a number that identifies the type of a value
*
* @deprecated 1.23.0 Use the type() method in the Information\Value class instead
* @see Information\Value::type()
*
* @param null|mixed $value The value you want tested
*
* @return int N converts values listed in the following table
* If value is or refers to N returns
* A number 1
* Text 2
* Logical Value 4
* An error value 16
* Array or Matrix 64
*/
public static function TYPE($value = null): int
{
return Information\Value::type($value);
}

/**
* Convert a multi-dimensional array to a simple 1-dimensional array.
*
Expand Down Expand Up @@ -606,22 +289,6 @@ public static function flattenSingleValue(mixed $value = ''): mixed
return $value;
}

/**
* ISFORMULA.
*
* @deprecated 1.23.0 Use the isFormula() method in the Information\Value class instead
* @see Information\Value::isFormula()
*
* @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)
{
return Information\Value::isFormula($cellReference, $cell);
}

public static function expandDefinedName(string $coordinate, Cell $cell): string
{
$worksheet = $cell->getWorksheet();
Expand Down
11 changes: 0 additions & 11 deletions src/PhpSpreadsheet/Calculation/Information/ExcelError.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ class ExcelError
'calculation' => '#CALC!', //14
];

/**
* List of error codes. Replaced by constant;
* previously it was public and updateable, allowing
* user to make inappropriate alterations.
*
* @deprecated 1.25.0 Use ERROR_CODES constant instead.
*
* @var array<string, string>
*/
public static array $errorCodes = self::ERROR_CODES;

public static function throwError(mixed $value): string
{
return in_array($value, self::ERROR_CODES, true) ? $value : self::ERROR_CODES['value'];
Expand Down
Loading

0 comments on commit 816b91d

Please sign in to comment.