PHPStan Level 3

This commit is contained in:
Adrien Crivelli 2021-04-04 22:20:00 +09:00
parent 02f37d4f7e
commit f9532231d2
No known key found for this signature in database
GPG Key ID: 16D79B903B4B5874
90 changed files with 225 additions and 370 deletions

View File

@ -1,8 +1,10 @@
parameters:
level: 2
level: 3
paths:
- src/
- tests/
parallel:
processTimeout: 300.0
ignoreErrors:
- '~^Class GdImage not found\.$~'
- '~^Return typehint of method .* has invalid type GdImage\.$~'

View File

@ -5234,10 +5234,8 @@ class Calculation
/**
* Get a list of all implemented functions as an array of function objects.
*
* @return array of Category
*/
public function getFunctions()
public function getFunctions(): array
{
return self::$phpSpreadsheetFunctions;
}

View File

@ -57,7 +57,7 @@ abstract class DatabaseAbstract
* the column label in which you specify a condition for the
* column.
*
* @return array of mixed
* @return mixed[]
*/
protected static function filter(array $database, array $criteria): array
{

View File

@ -1395,7 +1395,7 @@ class Engineering
*
* @see Use the getConversionMultipliers() method in the ConvertUOM class instead
*
* @return array of mixed
* @return mixed[]
*/
public static function getConversionMultipliers()
{
@ -1412,7 +1412,7 @@ class Engineering
*
* @see Use the getBinaryConversionMultipliers() method in the ConvertUOM class instead
*
* @return array of mixed
* @return mixed[]
*/
public static function getBinaryConversionMultipliers()
{

View File

@ -38,7 +38,7 @@ class ConvertBinary extends ConvertBase
return '-' . (512 - bindec($value));
}
return bindec($value);
return (string) bindec($value);
}
/**

View File

@ -85,10 +85,10 @@ class ConvertHex extends ConvertBase
$binX[$i] = ($binX[$i] == '1' ? '0' : '1');
}
return (bindec($binX) + 1) * -1;
return (string) ((bindec($binX) + 1) * -1);
}
return bindec($binX);
return (string) bindec($binX);
}
/**

View File

@ -85,10 +85,10 @@ class ConvertOctal extends ConvertBase
$binX[$i] = ($binX[$i] == '1' ? '0' : '1');
}
return (bindec($binX) + 1) * -1;
return (string) ((bindec($binX) + 1) * -1);
}
return bindec($binX);
return (string) bindec($binX);
}
/**

View File

@ -490,7 +490,7 @@ class ConvertUOM
* getConversionMultipliers
* Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
*
* @return array of mixed
* @return mixed[]
*/
public static function getConversionMultipliers()
{
@ -501,7 +501,7 @@ class ConvertUOM
* getBinaryConversionMultipliers
* Returns an array of the additional Multiplier prefixes that can be used with Information Units of Measure in CONVERTUOM().
*
* @return array of mixed
* @return mixed[]
*/
public static function getBinaryConversionMultipliers()
{

View File

@ -90,10 +90,8 @@ class FormulaParser
* Get Token.
*
* @param int $pId Token id
*
* @return string
*/
public function getToken($pId = 0)
public function getToken(int $pId = 0): FormulaToken
{
if (isset($this->tokens[$pId])) {
return $this->tokens[$pId];

View File

@ -303,7 +303,7 @@ class Functions
*
* @param mixed $value Value to check
*
* @return bool
* @return int|string
*/
public static function errorType($value = '')
{

View File

@ -38,7 +38,7 @@ class Offset
* @param mixed $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|int|string An array containing a cell or range of cells, or a string on error
*/
public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $pCell = null)
{

View File

@ -19,7 +19,7 @@ class Fact
*
* @param float $factVal Factorial Value
*
* @return int|string Factorial, or a string containing an error
* @return float|int|string Factorial, or a string containing an error
*/
public static function funcFact($factVal)
{

View File

@ -729,7 +729,7 @@ class Statistical
* @param mixed[] $newValues Values of X for which we want to find Y
* @param bool $const a logical value specifying whether to force the intersect to equal 0
*
* @return array of float
* @return float[]
*/
public static function GROWTH($yValues, $xValues = [], $newValues = [], $const = true)
{
@ -1795,7 +1795,7 @@ class Statistical
* @param mixed[] $newValues Values of X for which we want to find Y
* @param bool $const a logical value specifying whether to force the intersect to equal 0
*
* @return array of float
* @return float[]
*/
public static function TREND($yValues, $xValues = [], $newValues = [], $const = true)
{

View File

@ -142,7 +142,7 @@ class Trends
* @param mixed[] $newValues Values of X for which we want to find Y
* @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
*
* @return array of float
* @return float[]
*/
public static function GROWTH($yValues, $xValues = [], $newValues = [], $const = true)
{
@ -399,7 +399,7 @@ class Trends
* @param mixed[] $newValues Values of X for which we want to find Y
* @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
*
* @return array of float
* @return float[]
*/
public static function TREND($yValues, $xValues = [], $newValues = [], $const = true)
{

View File

@ -78,6 +78,7 @@ class Cell
public function detach(): void
{
// @phpstan-ignore-next-line
$this->parent = null;
}
@ -201,7 +202,7 @@ class Cell
break;
case DataType::TYPE_STRING2:
$pDataType = DataType::TYPE_STRING;
// no break
// no break
case DataType::TYPE_STRING:
// Synonym for string
case DataType::TYPE_INLINE:
@ -563,7 +564,7 @@ class Cell
// Verify if cell is in range
return ($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow);
($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow);
}
/**

View File

@ -13,7 +13,7 @@ class Axis extends Properties
/**
* Axis Number.
*
* @var array of mixed
* @var mixed[]
*/
private $axisNumber = [
'format' => self::FORMAT_CODE_GENERAL,
@ -23,7 +23,7 @@ class Axis extends Properties
/**
* Axis Options.
*
* @var array of mixed
* @var mixed[]
*/
private $axisOptions = [
'minimum' => null,
@ -41,7 +41,7 @@ class Axis extends Properties
/**
* Fill Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $fillProperties = [
'type' => self::EXCEL_COLOR_TYPE_ARGB,
@ -52,7 +52,7 @@ class Axis extends Properties
/**
* Line Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $lineProperties = [
'type' => self::EXCEL_COLOR_TYPE_ARGB,
@ -63,7 +63,7 @@ class Axis extends Properties
/**
* Line Style Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $lineStyleProperties = [
'width' => '9525',
@ -86,7 +86,7 @@ class Axis extends Properties
/**
* Shadow Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $shadowProperties = [
'presets' => self::SHADOW_PRESETS_NOSHADOW,
@ -111,7 +111,7 @@ class Axis extends Properties
/**
* Glow Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $glowProperties = [
'size' => null,
@ -125,7 +125,7 @@ class Axis extends Properties
/**
* Soft Edge Properties.
*
* @var array of mixed
* @var mixed[]
*/
private $softEdges = [
'size' => null,

View File

@ -75,21 +75,21 @@ class DataSeries
/**
* Order of plots in Series.
*
* @var array of integer
* @var int[]
*/
private $plotOrder = [];
/**
* Plot Label.
*
* @var array of DataSeriesValues
* @var DataSeriesValues[]
*/
private $plotLabel = [];
/**
* Plot Category.
*
* @var array of DataSeriesValues
* @var DataSeriesValues[]
*/
private $plotCategory = [];
@ -103,7 +103,7 @@ class DataSeries
/**
* Plot Values.
*
* @var array of DataSeriesValues
* @var DataSeriesValues[]
*/
private $plotValues = [];
@ -231,7 +231,7 @@ class DataSeries
/**
* Get Plot Labels.
*
* @return array of DataSeriesValues
* @return DataSeriesValues[]
*/
public function getPlotLabels()
{
@ -243,7 +243,7 @@ class DataSeries
*
* @param mixed $index
*
* @return DataSeriesValues
* @return DataSeriesValues|false
*/
public function getPlotLabelByIndex($index)
{
@ -260,7 +260,7 @@ class DataSeries
/**
* Get Plot Categories.
*
* @return array of DataSeriesValues
* @return DataSeriesValues[]
*/
public function getPlotCategories()
{
@ -272,7 +272,7 @@ class DataSeries
*
* @param mixed $index
*
* @return DataSeriesValues
* @return DataSeriesValues|false
*/
public function getPlotCategoryByIndex($index)
{
@ -313,7 +313,7 @@ class DataSeries
/**
* Get Plot Values.
*
* @return array of DataSeriesValues
* @return DataSeriesValues[]
*/
public function getPlotValues()
{
@ -325,7 +325,7 @@ class DataSeries
*
* @param mixed $index
*
* @return DataSeriesValues
* @return DataSeriesValues|false
*/
public function getPlotValuesByIndex($index)
{

View File

@ -55,7 +55,7 @@ class DataSeriesValues
/**
* Data Values.
*
* @var array of mixed
* @var mixed[]
*/
private $dataValues = [];
@ -313,7 +313,7 @@ class DataSeriesValues
/**
* Get Series Data Values.
*
* @return array of mixed
* @return mixed[]
*/
public function getDataValues()
{

View File

@ -67,7 +67,7 @@ class PlotArea
/**
* Get Plot Series.
*
* @return array of DataSeries
* @return DataSeries[]
*/
public function getPlotGroup()
{

View File

@ -19,21 +19,21 @@ class Cells
/**
* Parent worksheet.
*
* @var Worksheet
* @var null|Worksheet
*/
private $parent;
/**
* The currently active Cell.
*
* @var Cell
* @var null|Cell
*/
private $currentCell;
/**
* Coordinate of the currently active Cell.
*
* @var string
* @var null|string
*/
private $currentCoordinate;

View File

@ -100,7 +100,7 @@ class Properties
/**
* Custom Properties.
*
* @var string[]
* @var array{value: mixed, type: string}[]
*/
private $customProperties = [];

View File

@ -126,7 +126,7 @@ class HashTable
*
* @param int $pIndex
*
* @return T
* @return null|T
*/
public function getByIndex($pIndex)
{
@ -142,7 +142,7 @@ class HashTable
*
* @param string $pHashCode
*
* @return T
* @return null|T
*/
public function getByHashCode($pHashCode)
{

View File

@ -38,7 +38,7 @@ abstract class BaseReader implements IReader
* Restrict which sheets should be loaded?
* This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.
*
* @var array of string
* @var null|string[]
*/
protected $loadSheetsOnly;

View File

@ -374,7 +374,7 @@ class Xls extends BaseReader
*
* @var int
*/
private $encryptionStartPos = false;
private $encryptionStartPos = 0;
/**
* The current RC4 decryption object.
@ -659,7 +659,7 @@ class Xls extends BaseReader
$this->definedname = [];
$this->sst = [];
$this->drawingGroupData = '';
$this->xfIndex = '';
$this->xfIndex = 0;
$this->mapCellXfIndex = [];
$this->mapCellStyleXfIndex = [];
@ -1296,7 +1296,7 @@ class Xls extends BaseReader
// TODO Provide support for named values
}
}
$this->data = null;
$this->data = '';
return $this->spreadsheet;
}

View File

@ -879,10 +879,11 @@ class Xlsx extends BaseReader
// Loop through contents
foreach ($commentsFile->commentList->comment as $comment) {
$commentModel = $docSheet->getComment((string) $comment['ref']);
if (!empty($comment['authorId'])) {
$docSheet->getComment((string) $comment['ref'])->setAuthor($authors[(string) $comment['authorId']]);
$commentModel->setAuthor($authors[$comment['authorId']]);
}
$docSheet->getComment((string) $comment['ref'])->setText($this->parseRichText($comment->text));
$commentModel->setText($this->parseRichText($comment->text));
}
}

View File

@ -21,16 +21,16 @@ class Theme
/**
* Colour Map.
*
* @var array of string
* @var string[]
*/
private $colourMap;
/**
* Create a new Theme.
*
* @param mixed $themeName
* @param mixed $colourSchemeName
* @param mixed $colourMap
* @param string $themeName
* @param string $colourSchemeName
* @param string[] $colourMap
*/
public function __construct($themeName, $colourSchemeName, $colourMap)
{
@ -63,9 +63,9 @@ class Theme
/**
* Get colour Map Value by Position.
*
* @param mixed $index
* @param int $index
*
* @return string
* @return null|string
*/
public function getColourByIndex($index)
{

View File

@ -118,7 +118,7 @@ class Settings
if (self::$libXmlLoaderOptions === null && defined('LIBXML_DTDLOAD')) {
self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR);
} elseif (self::$libXmlLoaderOptions === null) {
self::$libXmlLoaderOptions = true;
self::$libXmlLoaderOptions = 0;
}
return self::$libXmlLoaderOptions;

View File

@ -255,7 +255,7 @@ class Date
*
* @param int $dateValue Unix Timestamp
*
* @return float MS Excel serialized date/time value
* @return false|float MS Excel serialized date/time value
*/
public static function timestampToExcel($dateValue)
{

View File

@ -15,7 +15,7 @@ class Drawing
*/
public static function pixelsToEMU($pValue)
{
return round($pValue * 9525);
return $pValue * 9525;
}
/**
@ -28,7 +28,7 @@ class Drawing
public static function EMUToPixels($pValue)
{
if ($pValue != 0) {
return round($pValue / 9525);
return (int) round($pValue / 9525);
}
return 0;
@ -141,7 +141,7 @@ class Drawing
public static function angleToDegrees($pValue)
{
if ($pValue != 0) {
return round($pValue / 60000);
return (int) round($pValue / 60000);
}
return 0;

View File

@ -268,7 +268,7 @@ class Font
$columnWidth = Drawing::pixelsToCellDimension($columnWidth, $defaultFont);
// Return
return round($columnWidth, 6);
return (int) round($columnWidth, 6);
}
/**

View File

@ -221,7 +221,7 @@ class LUDecomposition
/**
* Count determinants.
*
* @return array d matrix deterninat
* @return float
*/
public function det()
{

View File

@ -147,7 +147,7 @@ class Matrix
* @param int $i Row position
* @param int $j Column position
*
* @return mixed Element (int/float/double)
* @return float|int
*/
public function get($i = null, $j = null)
{
@ -323,11 +323,9 @@ class Matrix
*
* @param int $i Row position
* @param int $j Column position
* @param mixed $c Int/float/double value
*
* @return mixed Element (int/float/double)
* @param float|int $c value
*/
public function set($i = null, $j = null, $c = null)
public function set($i = null, $j = null, $c = null): void
{
// Optimized set version just has this
$this->A[$i][$j] = $c;

View File

@ -9,7 +9,7 @@ class ChainedBlockStream
/**
* The OLE container of the file that is being read.
*
* @var OLE
* @var null|OLE
*/
public $ole;
@ -112,7 +112,7 @@ class ChainedBlockStream
*
* @param int $count maximum number of bytes to read
*
* @return string
* @return false|string
*/
public function stream_read($count) // @codingStandardsIgnoreLine
{

View File

@ -188,7 +188,7 @@ class OLERead
*
* @param int $stream
*
* @return string
* @return null|string
*/
public function getStream($stream)
{

View File

@ -2,7 +2,7 @@
namespace PhpOffice\PhpSpreadsheet\Shared\Trend;
class BestFit
abstract class BestFit
{
/**
* Indicator flag for a calculation error.
@ -96,24 +96,18 @@ class BestFit
*
* @param float $xValue X-Value
*
* @return bool Y-Value
* @return float Y-Value
*/
public function getValueOfYForX($xValue)
{
return false;
}
abstract public function getValueOfYForX($xValue);
/**
* Return the X-Value for a specified value of Y.
*
* @param float $yValue Y-Value
*
* @return bool X-Value
* @return float X-Value
*/
public function getValueOfXForY($yValue)
{
return false;
}
abstract public function getValueOfXForY($yValue);
/**
* Return the original set of X-Values.
@ -130,12 +124,9 @@ class BestFit
*
* @param int $dp Number of places of decimal precision to display
*
* @return bool
* @return string
*/
public function getEquation($dp = 0)
{
return false;
}
abstract public function getEquation($dp = 0);
/**
* Return the Slope of the line.

View File

@ -42,6 +42,7 @@ class PolynomialBestFit extends BestFit
{
$retVal = $this->getIntersect();
$slope = $this->getSlope();
// @phpstan-ignore-next-line
foreach ($slope as $key => $value) {
if ($value != 0.0) {
$retVal += $value * $xValue ** ($key + 1);
@ -76,6 +77,7 @@ class PolynomialBestFit extends BestFit
$intersect = $this->getIntersect($dp);
$equation = 'Y = ' . $intersect;
// @phpstan-ignore-next-line
foreach ($slope as $key => $value) {
if ($value != 0.0) {
$equation .= ' + ' . $value . ' * X';
@ -93,7 +95,7 @@ class PolynomialBestFit extends BestFit
*
* @param int $dp Number of places of decimal precision to display
*
* @return string
* @return float
*/
public function getSlope($dp = 0)
{
@ -103,6 +105,7 @@ class PolynomialBestFit extends BestFit
$coefficients[] = round($coefficient, $dp);
}
// @phpstan-ignore-next-line
return $coefficients;
}

View File

@ -205,7 +205,7 @@ class Xls
* @param int $width Width in pixels
* @param int $height Height in pixels
*
* @return array
* @return null|array
*/
public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height)
{
@ -245,16 +245,16 @@ class Xls
// Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell
// with zero height or width.
if (self::sizeCol($sheet, Coordinate::stringFromColumnIndex($col_start)) == 0) {
return;
return null;
}
if (self::sizeCol($sheet, Coordinate::stringFromColumnIndex($col_end)) == 0) {
return;
return null;
}
if (self::sizeRow($sheet, $row_start + 1) == 0) {
return;
return null;
}
if (self::sizeRow($sheet, $row_end + 1) == 0) {
return;
return null;
}
// Convert the pixel values to the percentage value expected by Excel

View File

@ -69,7 +69,7 @@ class Spreadsheet
/**
* Named ranges.
*
* @var NamedRange[]
* @var DefinedName[]
*/
private $definedNames = [];
@ -104,21 +104,21 @@ class Spreadsheet
/**
* macrosCode : all macros code as binary data (the vbaProject.bin file, this include form, code, etc.), null if no macro.
*
* @var string
* @var null|string
*/
private $macrosCode;
/**
* macrosCertificate : if macros are signed, contains binary data vbaProjectSignature.bin file, null if not signed.
*
* @var string
* @var null|string
*/
private $macrosCertificate;
/**
* ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI.
*
* @var null|string
* @var null|array{target: string, data: string}
*/
private $ribbonXMLData;
@ -298,11 +298,9 @@ class Spreadsheet
/**
* retrieve ribbon XML Data.
*
* return string|null|array
*
* @param string $what
*
* @return string
* @return null|array|string
*/
public function getRibbonXMLData($what = 'all') //we need some constants here...
{
@ -455,7 +453,7 @@ class Spreadsheet
*
* @param string $pName Sheet name
*
* @return Worksheet
* @return null|Worksheet
*/
public function getSheetByCodeName($pName)
{
@ -515,12 +513,10 @@ class Spreadsheet
*/
public function disconnectWorksheets(): void
{
$worksheet = null;
foreach ($this->workSheetCollection as $k => &$worksheet) {
foreach ($this->workSheetCollection as $worksheet) {
$worksheet->disconnectCells();
$this->workSheetCollection[$k] = null;
unset($worksheet);
}
unset($worksheet);
$this->workSheetCollection = [];
}
@ -876,7 +872,7 @@ class Spreadsheet
/**
* Get an array of all Named Ranges.
*
* @return NamedRange[]
* @return DefinedName[]
*/
public function getNamedRanges(): array
{
@ -891,7 +887,7 @@ class Spreadsheet
/**
* Get an array of all Named Formulae.
*
* @return NamedFormula[]
* @return DefinedName[]
*/
public function getNamedFormulae(): array
{
@ -1124,6 +1120,7 @@ class Spreadsheet
*/
public function __clone()
{
// @phpstan-ignore-next-line
foreach ($this as $key => $val) {
if (is_object($val) || (is_array($val))) {
$this->{$key} = unserialize(serialize($val));

View File

@ -35,21 +35,21 @@ class Alignment extends Supervisor
/**
* Horizontal alignment.
*
* @var string
* @var null|string
*/
protected $horizontal = self::HORIZONTAL_GENERAL;
/**
* Vertical alignment.
*
* @var string
* @var null|string
*/
protected $vertical = self::VERTICAL_BOTTOM;
/**
* Text rotation.
*
* @var int
* @var null|int
*/
protected $textRotation = 0;
@ -179,7 +179,7 @@ class Alignment extends Supervisor
/**
* Get Horizontal.
*
* @return string
* @return null|string
*/
public function getHorizontal()
{
@ -216,7 +216,7 @@ class Alignment extends Supervisor
/**
* Get Vertical.
*
* @return string
* @return null|string
*/
public function getVertical()
{
@ -253,7 +253,7 @@ class Alignment extends Supervisor
/**
* Get TextRotation.
*
* @return int
* @return null|int
*/
public function getTextRotation()
{

View File

@ -37,7 +37,7 @@ class Border extends Supervisor
protected $color;
/**
* @var int
* @var null|int
*/
public $colorIndex;

View File

@ -28,19 +28,19 @@ class Fill extends Supervisor
const FILL_PATTERN_MEDIUMGRAY = 'mediumGray';
/**
* @var int
* @var null|int
*/
public $startcolorIndex;
/**
* @var int
* @var null|int
*/
public $endcolorIndex;
/**
* Fill type.
*
* @var string
* @var null|string
*/
protected $fillType = self::FILL_NONE;
@ -168,7 +168,7 @@ class Fill extends Supervisor
/**
* Get Fill Type.
*
* @return string
* @return null|string
*/
public function getFillType()
{

View File

@ -14,56 +14,56 @@ class Font extends Supervisor
/**
* Font Name.
*
* @var string
* @var null|string
*/
protected $name = 'Calibri';
/**
* Font Size.
*
* @var float
* @var null|float
*/
protected $size = 11;
/**
* Bold.
*
* @var bool
* @var null|bool
*/
protected $bold = false;
/**
* Italic.
*
* @var bool
* @var null|bool
*/
protected $italic = false;
/**
* Superscript.
*
* @var bool
* @var null|bool
*/
protected $superscript = false;
/**
* Subscript.
*
* @var bool
* @var null|bool
*/
protected $subscript = false;
/**
* Underline.
*
* @var string
* @var null|string
*/
protected $underline = self::UNDERLINE_NONE;
/**
* Strikethrough.
*
* @var bool
* @var null|bool
*/
protected $strikethrough = false;
@ -75,7 +75,7 @@ class Font extends Supervisor
protected $color;
/**
* @var int
* @var null|int
*/
public $colorIndex;
@ -199,7 +199,7 @@ class Font extends Supervisor
/**
* Get Name.
*
* @return string
* @return null|string
*/
public function getName()
{
@ -235,7 +235,7 @@ class Font extends Supervisor
/**
* Get Size.
*
* @return float
* @return null|float
*/
public function getSize()
{
@ -271,7 +271,7 @@ class Font extends Supervisor
/**
* Get Bold.
*
* @return bool
* @return null|bool
*/
public function getBold()
{
@ -307,7 +307,7 @@ class Font extends Supervisor
/**
* Get Italic.
*
* @return bool
* @return null|bool
*/
public function getItalic()
{
@ -343,7 +343,7 @@ class Font extends Supervisor
/**
* Get Superscript.
*
* @return bool
* @return null|bool
*/
public function getSuperscript()
{
@ -377,7 +377,7 @@ class Font extends Supervisor
/**
* Get Subscript.
*
* @return bool
* @return null|bool
*/
public function getSubscript()
{
@ -411,7 +411,7 @@ class Font extends Supervisor
/**
* Get Underline.
*
* @return string
* @return null|string
*/
public function getUnderline()
{
@ -451,7 +451,7 @@ class Font extends Supervisor
/**
* Get Strikethrough.
*
* @return bool
* @return null|bool
*/
public function getStrikethrough()
{

View File

@ -64,14 +64,14 @@ class NumberFormat extends Supervisor
/**
* Format Code.
*
* @var string
* @var null|string
*/
protected $formatCode = self::FORMAT_GENERAL;
/**
* Built-in format Code.
*
* @var string
* @var false|int
*/
protected $builtInFormatCode = 0;
@ -150,7 +150,7 @@ class NumberFormat extends Supervisor
/**
* Get Format Code.
*
* @return string
* @return null|string
*/
public function getFormatCode()
{
@ -190,7 +190,7 @@ class NumberFormat extends Supervisor
/**
* Get Built-In Format Code.
*
* @return int
* @return false|int
*/
public function getBuiltInFormatCode()
{

View File

@ -14,7 +14,7 @@ class AutoFilter
/**
* Autofilter Worksheet.
*
* @var Worksheet
* @var null|Worksheet
*/
private $workSheet;
@ -47,7 +47,7 @@ class AutoFilter
/**
* Get AutoFilter Parent Worksheet.
*
* @return Worksheet
* @return null|Worksheet
*/
public function getParent()
{
@ -791,10 +791,10 @@ class AutoFilter
if ($ruleOperator === AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
$ruleValue = floor($ruleValue * ($dataRowCount / 100));
}
if ($ruleValue < 1) {
if (!is_array($ruleValue) && $ruleValue < 1) {
$ruleValue = 1;
}
if ($ruleValue > 500) {
if (!is_array($ruleValue) && $ruleValue > 500) {
$ruleValue = 500;
}

View File

@ -49,7 +49,7 @@ class Column
/**
* Autofilter.
*
* @var AutoFilter
* @var null|AutoFilter
*/
private $parent;
@ -77,14 +77,14 @@ class Column
/**
* Autofilter Column Rules.
*
* @var array of Column\Rule
* @var Column\Rule[]
*/
private $ruleset = [];
/**
* Autofilter Column Dynamic Attributes.
*
* @var array of mixed
* @var mixed[]
*/
private $attributes = [];
@ -133,7 +133,7 @@ class Column
/**
* Get this Column's AutoFilter Parent.
*
* @return AutoFilter
* @return null|AutoFilter
*/
public function getParent()
{
@ -256,7 +256,7 @@ class Column
*
* @param string $pName Attribute Name
*
* @return string
* @return null|string
*/
public function getAttribute($pName)
{

View File

@ -217,7 +217,7 @@ class Rule
/**
* Autofilter Rule Value.
*
* @var string
* @var string|string[]
*/
private $value = '';
@ -276,7 +276,7 @@ class Rule
/**
* Get AutoFilter Rule Value.
*
* @return string
* @return string|string[]
*/
public function getValue()
{

View File

@ -39,7 +39,7 @@ class BaseDrawing implements IComparable
/**
* Worksheet.
*
* @var Worksheet
* @var null|Worksheet
*/
protected $worksheet;
@ -190,7 +190,7 @@ class BaseDrawing implements IComparable
/**
* Get Worksheet.
*
* @return Worksheet
* @return null|Worksheet
*/
public function getWorksheet()
{
@ -330,7 +330,7 @@ class BaseDrawing implements IComparable
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
$ratio = $this->height / ($this->width != 0 ? $this->width : 1);
$this->height = round($ratio * $pValue);
$this->height = (int) round($ratio * $pValue);
}
// Set width
@ -361,7 +361,7 @@ class BaseDrawing implements IComparable
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
$ratio = $this->width / ($this->height != 0 ? $this->height : 1);
$this->width = round($ratio * $pValue);
$this->width = (int) round($ratio * $pValue);
}
// Set height
@ -392,10 +392,10 @@ class BaseDrawing implements IComparable
$yratio = $height / ($this->height != 0 ? $this->height : 1);
if ($this->resizeProportional && !($width == 0 || $height == 0)) {
if (($xratio * $this->height) < $height) {
$this->height = ceil($xratio * $this->height);
$this->height = (int) ceil($xratio * $this->height);
$this->width = $width;
} else {
$this->width = ceil($yratio * $this->width);
$this->width = (int) ceil($yratio * $this->width);
$this->height = $height;
}
} else {

View File

@ -25,6 +25,7 @@ abstract class CellIterator implements Iterator
*/
public function __destruct()
{
// @phpstan-ignore-next-line
$this->worksheet = null;
}

View File

@ -36,6 +36,7 @@ class Column
*/
public function __destruct()
{
// @phpstan-ignore-next-line
$this->parent = null;
}

View File

@ -18,7 +18,7 @@ class ColumnCellIterator extends CellIterator
/**
* Column index.
*
* @var string
* @var int
*/
private $columnIndex;

View File

@ -57,6 +57,7 @@ class ColumnIterator implements Iterator
*/
public function __destruct()
{
// @phpstan-ignore-next-line
$this->worksheet = null;
}

View File

@ -52,7 +52,7 @@ class Shadow implements IComparable
/**
* Shadow alignment.
*
* @var int
* @var string
*/
private $alignment;
@ -184,7 +184,7 @@ class Shadow implements IComparable
/**
* Get Shadow alignment.
*
* @return int
* @return string
*/
public function getAlignment()
{
@ -194,7 +194,7 @@ class Shadow implements IComparable
/**
* Set Shadow alignment.
*
* @param int $pValue
* @param string $pValue
*
* @return $this
*/

View File

@ -29,14 +29,6 @@ class Iterator implements \Iterator
$this->subject = $subject;
}
/**
* Destructor.
*/
public function __destruct()
{
$this->subject = null;
}
/**
* Rewind iterator.
*/

View File

@ -52,7 +52,6 @@ class MemoryDrawing extends BaseDrawing
public function __construct()
{
// Initialise values
$this->imageResource = null;
$this->renderingFunction = self::RENDERING_DEFAULT;
$this->mimeType = self::MIMETYPE_DEFAULT;
$this->uniqueName = md5(mt_rand(0, 9999) . time() . mt_rand(0, 9999));

View File

@ -238,7 +238,7 @@ class PageSetup
/**
* Print area.
*
* @var string
* @var null|string
*/
private $printArea;

View File

@ -36,6 +36,7 @@ class Row
*/
public function __destruct()
{
// @phpstan-ignore-next-line
$this->worksheet = null;
}

View File

@ -50,14 +50,6 @@ class RowIterator implements Iterator
$this->resetStart($startRow);
}
/**
* Destructor.
*/
public function __destruct()
{
$this->subject = null;
}
/**
* (Re)Set the start row and the current row pointer.
*

View File

@ -105,7 +105,7 @@ class Worksheet implements IComparable
*
* @var ArrayObject<Chart>
*/
private $chartCollection = [];
private $chartCollection;
/**
* Worksheet title.
@ -278,9 +278,9 @@ class Worksheet implements IComparable
/**
* Cached highest column.
*
* @var string
* @var int
*/
private $cachedHighestColumn = 'A';
private $cachedHighestColumn = 1;
/**
* Cached highest row.
@ -313,7 +313,7 @@ class Worksheet implements IComparable
/**
* Tab color.
*
* @var Color
* @var null|Color
*/
private $tabColor;
@ -383,9 +383,11 @@ class Worksheet implements IComparable
{
if ($this->cellCollection !== null) {
$this->cellCollection->unsetWorksheetCells();
// @phpstan-ignore-next-line
$this->cellCollection = null;
}
// detach ourself from the workbook, so that it can then delete this worksheet successfully
// @phpstan-ignore-next-line
$this->parent = null;
}
@ -1039,7 +1041,7 @@ class Worksheet implements IComparable
public function getHighestColumn($row = null)
{
if ($row == null) {
return $this->cachedHighestColumn;
return Coordinate::stringFromColumnIndex($this->cachedHighestColumn);
}
return $this->getHighestDataColumn($row);
@ -1252,11 +1254,12 @@ class Worksheet implements IComparable
// Coordinates
$aCoordinates = Coordinate::coordinateFromString($pCoordinate);
if (Coordinate::columnIndexFromString($this->cachedHighestColumn) < Coordinate::columnIndexFromString($aCoordinates[0])) {
$this->cachedHighestColumn = $aCoordinates[0];
$aIndexes = Coordinate::indexesFromString($pCoordinate);
if ($this->cachedHighestColumn < $aIndexes[0]) {
$this->cachedHighestColumn = $aIndexes[0];
}
if ($aCoordinates[1] > $this->cachedHighestRow) {
$this->cachedHighestRow = $aCoordinates[1];
if ($aIndexes[1] > $this->cachedHighestRow) {
$this->cachedHighestRow = $aIndexes[1];
}
// Cell needs appropriate xfIndex from dimensions records
@ -1377,8 +1380,9 @@ class Worksheet implements IComparable
}
$this->columnDimensions[$pColumn] = new ColumnDimension($pColumn);
if (Coordinate::columnIndexFromString($this->cachedHighestColumn) < Coordinate::columnIndexFromString($pColumn)) {
$this->cachedHighestColumn = $pColumn;
$columnIndex = Coordinate::columnIndexFromString($pColumn);
if ($this->cachedHighestColumn < $columnIndex) {
$this->cachedHighestColumn = $columnIndex;
}
}
@ -1987,7 +1991,7 @@ class Worksheet implements IComparable
/**
* Get the default position of the right bottom pane.
*
* @return int
* @return null|string
*/
public function getTopLeftCell()
{
@ -2677,9 +2681,9 @@ class Worksheet implements IComparable
// Cache values
if ($highestColumn < 1) {
$this->cachedHighestColumn = 'A';
$this->cachedHighestColumn = 1;
} else {
$this->cachedHighestColumn = Coordinate::stringFromColumnIndex($highestColumn);
$this->cachedHighestColumn = $highestColumn;
}
$this->cachedHighestRow = $highestRow;
@ -2905,7 +2909,6 @@ class Worksheet implements IComparable
public function resetTabColor()
{
$this->tabColor = null;
$this->tabColor = null;
return $this;
}
@ -2935,6 +2938,7 @@ class Worksheet implements IComparable
*/
public function __clone()
{
// @phpstan-ignore-next-line
foreach ($this as $key => $val) {
if ($key == 'parent') {
continue;

View File

@ -37,7 +37,7 @@ class Html extends BaseWriter
/**
* Sheet index to write.
*
* @var int
* @var null|int
*/
private $sheetIndex = 0;
@ -735,7 +735,7 @@ class Html extends BaseWriter
if ($chartCoordinates['cell'] == $coordinates) {
$chartFileName = File::sysGetTempDir() . '/' . uniqid('', true) . '.png';
if (!$chart->render($chartFileName)) {
return;
return '';
}
$html .= PHP_EOL;

View File

@ -165,7 +165,7 @@ abstract class Pdf extends Html
/**
* Set Paper Size.
*
* @param string $pValue Paper size see PageSetup::PAPERSIZE_*
* @param int $pValue Paper size see PageSetup::PAPERSIZE_*
*
* @return self
*/

View File

@ -81,14 +81,14 @@ class Xls extends BaseWriter
/**
* Basic OLE object summary information.
*
* @var array
* @var string
*/
private $summaryInformation;
/**
* Extended OLE object document summary information.
*
* @var array
* @var string
*/
private $documentSummaryInformation;
@ -727,6 +727,7 @@ class Xls extends BaseWriter
} elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
// Null-terminated string
$dataProp['data']['data'] .= chr(0);
// @phpstan-ignore-next-line
++$dataProp['data']['length'];
// Complete the string with null string for being a %4
$dataProp['data']['length'] = $dataProp['data']['length'] + ((4 - $dataProp['data']['length'] % 4) == 4 ? 0 : (4 - $dataProp['data']['length'] % 4));
@ -744,6 +745,7 @@ class Xls extends BaseWriter
} else {
$dataSection_Content .= $dataProp['data']['data'];
// @phpstan-ignore-next-line
$dataSection_Content_Offset += 4 + $dataProp['data']['length'];
}
}

View File

@ -49,7 +49,7 @@ class BIFFwriter
/**
* The string containing the data of the BIFF stream.
*
* @var string
* @var null|string
*/
public $_data;

View File

@ -119,7 +119,7 @@ class Font
/**
* Map of BIFF2-BIFF8 codes for underline styles.
*
* @var array of int
* @var int[]
*/
private static $mapUnderline = [
\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE => 0x00,

View File

@ -95,7 +95,7 @@ class Worksheet extends BIFFwriter
/**
* Whether to use outline.
*
* @var int
* @var bool
*/
private $outlineOn;
@ -244,10 +244,10 @@ class Worksheet extends BIFFwriter
$this->printHeaders = 0;
$this->outlineStyle = 0;
$this->outlineBelow = 1;
$this->outlineRight = 1;
$this->outlineOn = 1;
$this->outlineStyle = false;
$this->outlineBelow = true;
$this->outlineRight = true;
$this->outlineOn = true;
$this->fontHashIndex = [];
@ -594,15 +594,13 @@ class Worksheet extends BIFFwriter
}
/**
* Retrieves data from memory in one chunk, or from disk in $buffer
* Retrieves data from memory in one chunk, or from disk
* sized chunks.
*
* @return string The data
*/
public function getData()
{
$buffer = 4096;
// Return data stored in memory
if (isset($this->_data)) {
$tmp = $this->_data;
@ -612,7 +610,7 @@ class Worksheet extends BIFFwriter
}
// No data to return
return false;
return '';
}
/**
@ -640,11 +638,6 @@ class Worksheet extends BIFFwriter
$this->outlineBelow = $symbols_below;
$this->outlineRight = $symbols_right;
$this->outlineStyle = $auto_style;
// Ensure this is a boolean vale for Window2
if ($this->outlineOn) {
$this->outlineOn = 1;
}
}
/**
@ -926,20 +919,14 @@ class Worksheet extends BIFFwriter
* The hyperlink can be to a http, ftp, mail, internal sheet (not yet), or external
* directory url.
*
* Returns 0 : normal termination
* -2 : row or column out of range
* -3 : long string truncated to 255 chars
*
* @param int $row Row
* @param int $col Column
* @param string $url URL string
*
* @return int
*/
private function writeUrl($row, $col, $url)
private function writeUrl($row, $col, $url): void
{
// Add start row and col to arg list
return $this->writeUrlRange($row, $col, $row, $col, $url);
$this->writeUrlRange($row, $col, $row, $col, $url);
}
/**
@ -954,21 +941,19 @@ class Worksheet extends BIFFwriter
* @param int $col2 End column
* @param string $url URL string
*
* @return int
*
* @see writeUrl()
*/
public function writeUrlRange($row1, $col1, $row2, $col2, $url)
private function writeUrlRange($row1, $col1, $row2, $col2, $url): void
{
// Check for internal/external sheet links or default to web link
if (preg_match('[^internal:]', $url)) {
return $this->writeUrlInternal($row1, $col1, $row2, $col2, $url);
$this->writeUrlInternal($row1, $col1, $row2, $col2, $url);
}
if (preg_match('[^external:]', $url)) {
return $this->writeUrlExternal($row1, $col1, $row2, $col2, $url);
$this->writeUrlExternal($row1, $col1, $row2, $col2, $url);
}
return $this->writeUrlWeb($row1, $col1, $row2, $col2, $url);
$this->writeUrlWeb($row1, $col1, $row2, $col2, $url);
}
/**
@ -982,14 +967,11 @@ class Worksheet extends BIFFwriter
* @param int $col2 End column
* @param string $url URL string
*
* @return int
*
* @see writeUrl()
*/
public function writeUrlWeb($row1, $col1, $row2, $col2, $url)
public function writeUrlWeb($row1, $col1, $row2, $col2, $url): void
{
$record = 0x01B8; // Record identifier
$length = 0x00000; // Bytes to follow
// Pack the undocumented parts of the hyperlink stream
$unknown1 = pack('H*', 'D0C9EA79F9BACE118C8200AA004BA90B02000000');
@ -1014,8 +996,6 @@ class Worksheet extends BIFFwriter
// Write the packed data
$this->append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url);
return 0;
}
/**
@ -1027,14 +1007,11 @@ class Worksheet extends BIFFwriter
* @param int $col2 End column
* @param string $url URL string
*
* @return int
*
* @see writeUrl()
*/
public function writeUrlInternal($row1, $col1, $row2, $col2, $url)
private function writeUrlInternal($row1, $col1, $row2, $col2, $url): void
{
$record = 0x01B8; // Record identifier
$length = 0x00000; // Bytes to follow
// Strip URL type
$url = preg_replace('/^internal:/', '', $url);
@ -1063,8 +1040,6 @@ class Worksheet extends BIFFwriter
// Write the packed data
$this->append($header . $data . $unknown1 . $options . $url_len . $url);
return 0;
}
/**
@ -1080,16 +1055,14 @@ class Worksheet extends BIFFwriter
* @param int $col2 End column
* @param string $url URL string
*
* @return int
*
* @see writeUrl()
*/
public function writeUrlExternal($row1, $col1, $row2, $col2, $url)
private function writeUrlExternal($row1, $col1, $row2, $col2, $url): void
{
// Network drives are different. We will handle them separately
// MS/Novell network drives and shares start with \\
if (preg_match('[^external:\\\\]', $url)) {
return; //($this->writeUrlExternal_net($row1, $col1, $row2, $col2, $url, $str, $format));
return;
}
$record = 0x01B8; // Record identifier
@ -1165,8 +1138,6 @@ class Worksheet extends BIFFwriter
// Write the packed data
$this->append($header . $data);
return 0;
}
/**

View File

@ -362,7 +362,7 @@ class Xf
/**
* Map of BIFF2-BIFF8 codes for border styles.
*
* @var array of int
* @var int[]
*/
private static $mapBorderStyles = [
Border::BORDER_NONE => 0x00,
@ -396,7 +396,7 @@ class Xf
/**
* Map of BIFF2-BIFF8 codes for fill types.
*
* @var array of int
* @var int[]
*/
private static $mapFillTypes = [
Fill::FILL_NONE => 0x00,
@ -437,7 +437,7 @@ class Xf
/**
* Map of BIFF2-BIFF8 codes for horizontal alignment.
*
* @var array of int
* @var int[]
*/
private static $mapHAlignments = [
Alignment::HORIZONTAL_GENERAL => 0,
@ -464,7 +464,7 @@ class Xf
/**
* Map of BIFF2-BIFF8 codes for vertical alignment.
*
* @var array of int
* @var int[]
*/
private static $mapVAlignments = [
Alignment::VERTICAL_TOP => 0,

View File

@ -200,12 +200,19 @@ class Xlsx extends BaseWriter
$this->writerPartWorksheet = new Worksheet($this);
// Set HashTable variables
// @phpstan-ignore-next-line
$this->bordersHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->drawingHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->fillHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->fontHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->numFmtHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->styleHashTable = new HashTable();
// @phpstan-ignore-next-line
$this->stylesConditionalHashTable = new HashTable();
}

View File

@ -170,13 +170,13 @@ class DocProps extends WriterPart
/**
* Write docProps/custom.xml to XML format.
*
* @return string XML Output
* @return null|string XML Output
*/
public function writeDocPropsCustom(Spreadsheet $spreadsheet)
{
$customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
if (empty($customPropertyList)) {
return;
return null;
}
// Create XML writer

View File

@ -10,7 +10,7 @@ class Theme extends WriterPart
/**
* Map of Major fonts to write.
*
* @var array of string
* @var string[]
*/
private static $majorFonts = [
'Jpan' => ' Pゴシック',
@ -48,7 +48,7 @@ class Theme extends WriterPart
/**
* Map of Minor fonts to write.
*
* @var array of string
* @var string[]
*/
private static $minorFonts = [
'Jpan' => ' Pゴシック',
@ -86,7 +86,7 @@ class Theme extends WriterPart
/**
* Map of core colours.
*
* @var array of string
* @var string[]
*/
private static $colourScheme = [
'dk2' => '1F497D',

View File

@ -22,11 +22,6 @@ class ImConjugateTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCONJUGATE
*

View File

@ -22,11 +22,6 @@ class ImCosTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCOS
*

View File

@ -22,11 +22,6 @@ class ImCoshTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCOSH
*

View File

@ -22,11 +22,6 @@ class ImCotTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCOT
*

View File

@ -22,11 +22,6 @@ class ImCscTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCSC
*

View File

@ -22,11 +22,6 @@ class ImCschTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMCSCH
*

View File

@ -22,11 +22,6 @@ class ImDivTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMDIV
*

View File

@ -22,11 +22,6 @@ class ImExpTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMEXP
*

View File

@ -22,11 +22,6 @@ class ImLnTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMLN
*

View File

@ -22,11 +22,6 @@ class ImLog10Test extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMLOG10
*

View File

@ -22,11 +22,6 @@ class ImLog2Test extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMLOG2
*

View File

@ -22,11 +22,6 @@ class ImPowerTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMPOWER
*

View File

@ -22,11 +22,6 @@ class ImProductTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMPRODUCT
*

View File

@ -22,11 +22,6 @@ class ImSecTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSEC
*

View File

@ -22,11 +22,6 @@ class ImSechTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSECH
*

View File

@ -22,11 +22,6 @@ class ImSinTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSIN
*

View File

@ -22,11 +22,6 @@ class ImSinhTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSINH
*

View File

@ -22,11 +22,6 @@ class ImSqrtTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSQRT
*

View File

@ -22,11 +22,6 @@ class ImSubTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSUB
*

View File

@ -22,11 +22,6 @@ class ImSumTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMSUM
*

View File

@ -22,11 +22,6 @@ class ImTanTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
protected function tearDown(): void
{
$this->complexAssert = null;
}
/**
* @dataProvider providerIMTAN
*

View File

@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase;
class SettingsTest extends TestCase
{
/**
* @var string
* @var bool
*/
protected $prevValue;