From 2a0a53cd6a6f39217f12f6b14107ae50e18bd4fc Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Wed, 20 Sep 2023 17:53:47 +0800 Subject: [PATCH] Drop all Scrutinizer annotations Because they tend to clutter our code a lot and unfortunately, there are lots of false positives. Instead, it would probably be better to deal with false positives out of band, via the Scrutinizer web UI. --- infra/DocumentGenerator.php | 2 +- samples/Basic/25_In_memory_image.php | 4 +- samples/Calculations/DateTime/DAYS360.php | 2 - samples/Calculations/DateTime/EDATE.php | 1 - samples/Calculations/DateTime/EOMONTH.php | 1 - samples/Calculations/DateTime/NETWORKDAYS.php | 2 - samples/Calculations/DateTime/NOW.php | 1 - samples/Calculations/DateTime/TODAY.php | 1 - samples/Calculations/DateTime/WEEKDAY.php | 2 - samples/Calculations/DateTime/YEARFRAC.php | 5 - samples/Calculations/Engineering/BESSELI.php | 1 - samples/Calculations/Engineering/BESSELJ.php | 1 - samples/Calculations/Engineering/BESSELK.php | 1 - samples/Calculations/Engineering/BESSELY.php | 1 - samples/Calculations/Engineering/BIN2DEC.php | 1 - samples/Calculations/Engineering/BIN2HEX.php | 1 - samples/Calculations/Engineering/BIN2OCT.php | 1 - samples/Calculations/Engineering/BITAND.php | 4 - .../Calculations/Engineering/BITLSHIFT.php | 9 - samples/Calculations/Engineering/BITOR.php | 4 - .../Calculations/Engineering/BITRSHIFT.php | 9 - samples/Calculations/Engineering/BITXOR.php | 4 - samples/Calculations/Engineering/COMPLEX.php | 1 - samples/Calculations/Engineering/CONVERT.php | 2 - samples/Calculations/Engineering/DEC2BIN.php | 1 - samples/Calculations/Engineering/DEC2HEX.php | 1 - samples/Calculations/Engineering/DEC2OCT.php | 1 - samples/Calculations/Engineering/DELTA.php | 2 - samples/Calculations/Engineering/ERF.php | 2 - samples/Calculations/Engineering/ERFC.php | 1 - samples/Calculations/Engineering/GESTEP.php | 2 - samples/Calculations/Engineering/HEX2BIN.php | 1 - samples/Calculations/Engineering/HEX2DEC.php | 1 - samples/Calculations/Engineering/HEX2OCT.php | 1 - samples/Calculations/Engineering/IMABS.php | 1 - .../Calculations/Engineering/IMAGINARY.php | 1 - .../Calculations/Engineering/IMARGUMENT.php | 1 - .../Calculations/Engineering/IMCONJUGATE.php | 1 - samples/Calculations/Engineering/IMCOS.php | 1 - samples/Calculations/Engineering/IMCOSH.php | 1 - samples/Calculations/Engineering/IMCOT.php | 1 - samples/Calculations/Engineering/IMCSC.php | 1 - samples/Calculations/Engineering/IMCSCH.php | 1 - samples/Calculations/Engineering/IMDIV.php | 1 - samples/Calculations/Engineering/IMEXP.php | 1 - samples/Calculations/Engineering/IMLN.php | 1 - samples/Calculations/Engineering/IMLOG10.php | 1 - samples/Calculations/Engineering/IMLOG2.php | 1 - samples/Calculations/Engineering/IMPOWER.php | 1 - .../Calculations/Engineering/IMPRODUCT.php | 1 - samples/Calculations/Engineering/IMREAL.php | 1 - samples/Calculations/Engineering/IMSEC.php | 1 - samples/Calculations/Engineering/IMSECH.php | 1 - samples/Calculations/Engineering/IMSIN.php | 1 - samples/Calculations/Engineering/IMSINH.php | 1 - samples/Calculations/Engineering/IMSQRT.php | 1 - samples/Calculations/Engineering/IMSUB.php | 1 - samples/Calculations/Engineering/IMSUM.php | 1 - samples/Calculations/Engineering/IMTAN.php | 1 - samples/Calculations/Engineering/OCT2BIN.php | 1 - samples/Calculations/Engineering/OCT2DEC.php | 1 - samples/Calculations/Engineering/OCT2HEX.php | 1 - samples/DefinedNames/AbsoluteNamedRange.php | 2 - .../DefinedNames/NamedFormulaeAndRanges.php | 2 - samples/DefinedNames/RelativeNamedRange.php | 2 - samples/DefinedNames/RelativeNamedRange2.php | 2 - .../RelativeNamedRangeAsFunction.php | 2 - samples/DefinedNames/ScopedNamedRange.php | 2 - samples/DefinedNames/ScopedNamedRange2.php | 2 - samples/DefinedNames/SimpleNamedFormula.php | 3 - samples/DefinedNames/SimpleNamedRange.php | 3 - .../01_Simple_file_reader_using_IOFactory.php | 2 +- ...e_file_reader_using_a_specified_reader.php | 2 +- ...using_the_IOFactory_to_return_a_reader.php | 2 +- ..._IOFactory_to_identify_a_reader_to_use.php | 4 +- ...reader_using_the_read_data_only_option.php | 2 +- ...ple_file_reader_loading_all_worksheets.php | 2 +- ...eader_loading_a_single_named_worksheet.php | 2 +- ...eader_loading_several_named_worksheets.php | 2 +- ...Simple_file_reader_using_a_read_filter.php | 2 +- ...eader_using_a_configurable_read_filter.php | 2 +- ...a_configurable_read_filter_(version_1).php | 2 +- ...a_configurable_read_filter_(version_2).php | 2 +- ...ple_file_reader_for_multiple_CSV_files.php | 8 +- ...ks_to_split_across_multiple_worksheets.php | 2 +- ...e_file_using_the_Advanced_Value_Binder.php | 4 +- ...dling_loader_exceptions_using_TryCatch.php | 4 +- ...eader_loading_several_named_worksheets.php | 2 +- ...worksheets_without_loading_entire_file.php | 2 +- ...nformation_without_loading_entire_file.php | 2 +- .../20_Reader_worksheet_hyperlink_image.php | 2 +- ...Long_Integers_with_String_Value_Binder.php | 4 +- .../Calculation/Calculation.php | 2 +- src/PhpSpreadsheet/Calculation/DateTime.php | 2 +- .../Calculation/DateTimeExcel/Date.php | 4 +- .../Calculation/Engineering/ConvertUOM.php | 2 +- .../Calculation/Statistical/Conditional.php | 8 +- .../Calculation/TextData/Text.php | 2 +- src/PhpSpreadsheet/Chart/DataSeriesValues.php | 2 +- src/PhpSpreadsheet/Collection/Cells.php | 2 +- src/PhpSpreadsheet/Helper/Html.php | 1 - src/PhpSpreadsheet/Helper/Sample.php | 4 +- src/PhpSpreadsheet/Reader/Csv.php | 2 +- src/PhpSpreadsheet/Reader/Gnumeric/Styles.php | 3 +- src/PhpSpreadsheet/Reader/Ods.php | 3 +- src/PhpSpreadsheet/Reader/Ods/Properties.php | 2 - .../Reader/Security/XmlScanner.php | 2 +- src/PhpSpreadsheet/Reader/Xlsx.php | 6 +- src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php | 12 +- .../Reader/Xlsx/ColumnAndRowAttributes.php | 2 - .../Reader/Xlsx/ConditionalStyles.php | 3 +- .../Reader/Xlsx/TableReader.php | 4 +- src/PhpSpreadsheet/Reader/Xml.php | 2 +- .../Reader/Xml/PageSettings.php | 1 - src/PhpSpreadsheet/ReferenceHelper.php | 4 - src/PhpSpreadsheet/Settings.php | 2 +- .../Shared/OLE/ChainedBlockStream.php | 2 +- src/PhpSpreadsheet/Shared/PasswordHasher.php | 2 +- src/PhpSpreadsheet/Shared/StringHelper.php | 2 +- src/PhpSpreadsheet/Shared/XMLWriter.php | 1 - src/PhpSpreadsheet/Spreadsheet.php | 2 +- src/PhpSpreadsheet/Style/Border.php | 2 +- src/PhpSpreadsheet/Style/Color.php | 2 +- .../ConditionalFormattingRuleExtension.php | 5 +- .../Wizard/CellValue.php | 2 +- .../Wizard/Expression.php | 2 +- .../Style/NumberFormat/DateFormatter.php | 2 +- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 2 +- src/PhpSpreadsheet/Worksheet/Column.php | 1 - src/PhpSpreadsheet/Worksheet/Row.php | 1 - src/PhpSpreadsheet/Worksheet/Worksheet.php | 2 +- src/PhpSpreadsheet/Writer/Csv.php | 2 +- src/PhpSpreadsheet/Writer/Xls/Escher.php | 65 +++---- .../CalculationFunctionListTest.php | 2 +- .../Functions/DateTime/DateValueTest.php | 1 - .../Functions/DateTime/DayTest.php | 2 - .../Functions/DateTime/Days360Test.php | 1 - .../Functions/DateTime/HourTest.php | 1 - .../Functions/DateTime/IsoWeekNumTest.php | 2 - .../Functions/DateTime/MinuteTest.php | 1 - .../Functions/DateTime/MonthTest.php | 1 - .../Functions/DateTime/MovedFunctionsTest.php | 54 +++--- .../Functions/DateTime/SecondTest.php | 1 - .../Functions/DateTime/TimeValueTest.php | 1 - .../Functions/DateTime/WeekDayTest.php | 1 - .../Functions/DateTime/WeekNumTest.php | 2 - .../Functions/DateTime/YearTest.php | 1 - .../Functions/Engineering/Bin2DecTest.php | 2 - .../Functions/Engineering/Bin2HexTest.php | 2 - .../Functions/Engineering/Bin2OctTest.php | 2 - .../Functions/Engineering/ComplexTest.php | 1 - .../Functions/Engineering/Dec2BinTest.php | 2 - .../Functions/Engineering/Dec2HexTest.php | 2 - .../Functions/Engineering/Dec2OctTest.php | 2 - .../Functions/Engineering/DeltaTest.php | 1 - .../Functions/Engineering/ErfCTest.php | 1 - .../Functions/Engineering/ErfPreciseTest.php | 1 - .../Functions/Engineering/ErfTest.php | 1 - .../Functions/Engineering/GeStepTest.php | 1 - .../Functions/Engineering/Hex2BinTest.php | 2 - .../Functions/Engineering/Hex2DecTest.php | 2 - .../Functions/Engineering/Hex2OctTest.php | 2 - .../Functions/Engineering/ImAbsTest.php | 1 - .../Functions/Engineering/ImArgumentTest.php | 1 - .../Functions/Engineering/ImConjugateTest.php | 1 - .../Functions/Engineering/ImCosTest.php | 1 - .../Functions/Engineering/ImCoshTest.php | 1 - .../Functions/Engineering/ImCotTest.php | 1 - .../Functions/Engineering/ImCscTest.php | 1 - .../Functions/Engineering/ImCschTest.php | 1 - .../Functions/Engineering/ImDivTest.php | 1 - .../Functions/Engineering/ImExpTest.php | 1 - .../Functions/Engineering/ImLnTest.php | 1 - .../Functions/Engineering/ImLog10Test.php | 1 - .../Functions/Engineering/ImLog2Test.php | 1 - .../Functions/Engineering/ImPowerTest.php | 1 - .../Functions/Engineering/ImProductTest.php | 1 - .../Functions/Engineering/ImRealTest.php | 1 - .../Functions/Engineering/ImSecTest.php | 1 - .../Functions/Engineering/ImSechTest.php | 1 - .../Functions/Engineering/ImSinTest.php | 1 - .../Functions/Engineering/ImSinhTest.php | 1 - .../Functions/Engineering/ImSqrtTest.php | 1 - .../Functions/Engineering/ImSubTest.php | 1 - .../Functions/Engineering/ImSumTest.php | 1 - .../Functions/Engineering/ImTanTest.php | 1 - .../Functions/Engineering/ImaginaryTest.php | 1 - .../Engineering/MovedBitwiseTest.php | 10 +- .../Engineering/MovedFunctionsTest.php | 108 ++++++------ .../Functions/Engineering/Oct2BinTest.php | 2 - .../Functions/Engineering/Oct2DecTest.php | 2 - .../Functions/Engineering/Oct2HexTest.php | 2 - .../Financial/MovedFunctionsTest.php | 94 +++++----- .../Information/DeprecatedFunctionsTest.php | 42 ++--- .../Logical/DeprecatedFunctionsTest.php | 22 +-- .../Functions/LookupRef/IndirectTest.php | 2 +- .../LookupRef/MovedFunctionsTest.php | 34 ++-- .../Functions/MathTrig/MovedFunctionsTest.php | 146 ++++++++-------- .../Functions/MathTrig/RandArrayTest.php | 4 +- .../Functions/MathTrig/RandBetweenTest.php | 4 +- .../Statistical/MovedFunctionsTest.php | 162 +++++++++--------- .../Functions/TextData/DeprecatedTest.php | 52 +++--- .../Calculation/FunctionsTest.php | 2 +- .../Cell/CoordinateTest.php | 2 +- .../Chart/GridlinesLineStyleTest.php | 4 +- .../Functional/DrawingImageHyperlinkTest.php | 2 +- .../Reader/Xls/XlsTest.php | 3 +- .../Reader/Xlsx/AutoFilter2Test.php | 5 +- .../Reader/Xlsx/RibbonTest.php | 4 +- .../Reader/Xml/XmlTest.php | 6 +- .../Worksheet/ByColumnAndRowTest.php | 21 +-- .../Worksheet/ColumnCellIteratorTest.php | 5 +- .../Worksheet/DrawingTest.php | 2 +- .../Worksheet/MemoryDrawingTest.php | 2 +- .../Worksheet/RowCellIteratorTest.php | 3 - .../Writer/Html/MemoryDrawingOffsetTest.php | 2 +- .../Writer/Xlsx/DrawingsTest.php | 2 +- .../Writer/Xlsx/MemoryDrawingTest.php | 2 +- 218 files changed, 493 insertions(+), 732 deletions(-) diff --git a/infra/DocumentGenerator.php b/infra/DocumentGenerator.php index 8a6be076c..e2c3c86cb 100644 --- a/infra/DocumentGenerator.php +++ b/infra/DocumentGenerator.php @@ -41,7 +41,7 @@ class DocumentGenerator private static function tableRow(array $lengths, ?array $values = null): string { $result = ''; - foreach (array_map(/** @scrutinizer ignore-type */ null, $lengths, $values ?? []) as $i => [$length, $value]) { + foreach (array_map(null, $lengths, $values ?? []) as $i => [$length, $value]) { $pad = $value === null ? '-' : ' '; if ($i > 0) { $result .= '|' . $pad; diff --git a/samples/Basic/25_In_memory_image.php b/samples/Basic/25_In_memory_image.php index b0cd8ec05..1833e683a 100644 --- a/samples/Basic/25_In_memory_image.php +++ b/samples/Basic/25_In_memory_image.php @@ -40,7 +40,7 @@ $helper->log('Add a drawing to the worksheet'); $drawing = new MemoryDrawing(); $drawing->setName('Sample image'); $drawing->setDescription('Sample image'); -$drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); +$drawing->setImageResource($gdImage); $drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG); $drawing->setMimeType(MemoryDrawing::MIMETYPE_DEFAULT); $drawing->setHeight(36); @@ -56,7 +56,7 @@ $helper->log('Add a drawing to the new worksheet'); $drawing = new MemoryDrawing(); $drawing->setName('Sample image'); $drawing->setDescription('Sample image'); -$drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); +$drawing->setImageResource($gdImage); $drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG); $drawing->setMimeType(MemoryDrawing::MIMETYPE_DEFAULT); $drawing->setHeight(36); diff --git a/samples/Calculations/DateTime/DAYS360.php b/samples/Calculations/DateTime/DAYS360.php index 0963cc620..b0e2fdbb1 100644 --- a/samples/Calculations/DateTime/DAYS360.php +++ b/samples/Calculations/DateTime/DAYS360.php @@ -51,9 +51,7 @@ for ($row = 1; $row <= $testDateCount; ++$row) { )); $helper->log(sprintf( 'Days: %d (US) %d (European)', - /** @scrutinizer ignore-type */ $worksheet->getCell('G' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('H' . $row)->getCalculatedValue() )); } diff --git a/samples/Calculations/DateTime/EDATE.php b/samples/Calculations/DateTime/EDATE.php index d3681d4ab..be6e4d191 100644 --- a/samples/Calculations/DateTime/EDATE.php +++ b/samples/Calculations/DateTime/EDATE.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDateCount; ++$row) { '%s and %d months is %d (%s)', $worksheet->getCell('B' . $row)->getFormattedValue(), $worksheet->getCell('C' . $row)->getFormattedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), $worksheet->getCell('D' . $row)->getFormattedValue() )); diff --git a/samples/Calculations/DateTime/EOMONTH.php b/samples/Calculations/DateTime/EOMONTH.php index 3fefcbcf4..e0b7568a0 100644 --- a/samples/Calculations/DateTime/EOMONTH.php +++ b/samples/Calculations/DateTime/EOMONTH.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDateCount; ++$row) { '%s and %d months is %d (%s)', $worksheet->getCell('B' . $row)->getFormattedValue(), $worksheet->getCell('C' . $row)->getFormattedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), $worksheet->getCell('D' . $row)->getFormattedValue() )); diff --git a/samples/Calculations/DateTime/NETWORKDAYS.php b/samples/Calculations/DateTime/NETWORKDAYS.php index 6ba302593..585c04380 100644 --- a/samples/Calculations/DateTime/NETWORKDAYS.php +++ b/samples/Calculations/DateTime/NETWORKDAYS.php @@ -60,9 +60,7 @@ for ($row = 1; $row <= 12; ++$row) { 'Between %s and %s is %d working days; %d with public holidays', $worksheet->getCell('A1')->getFormattedValue(), $worksheet->getCell('B' . $row)->getFormattedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue() )); } diff --git a/samples/Calculations/DateTime/NOW.php b/samples/Calculations/DateTime/NOW.php index fb0222b17..858a3162b 100644 --- a/samples/Calculations/DateTime/NOW.php +++ b/samples/Calculations/DateTime/NOW.php @@ -22,7 +22,6 @@ $worksheet->getStyle('A1') // Test the formulae $helper->log(sprintf( 'Today is %f (%s)', - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue(), $worksheet->getCell('A1')->getFormattedValue() )); diff --git a/samples/Calculations/DateTime/TODAY.php b/samples/Calculations/DateTime/TODAY.php index 7f1dd0780..031149d59 100644 --- a/samples/Calculations/DateTime/TODAY.php +++ b/samples/Calculations/DateTime/TODAY.php @@ -22,7 +22,6 @@ $worksheet->getStyle('A1') // Test the formulae $helper->log(sprintf( 'Today is %d (%s)', - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue(), $worksheet->getCell('A1')->getFormattedValue() )); diff --git a/samples/Calculations/DateTime/WEEKDAY.php b/samples/Calculations/DateTime/WEEKDAY.php index 7be2bbdf2..7d4b4288b 100644 --- a/samples/Calculations/DateTime/WEEKDAY.php +++ b/samples/Calculations/DateTime/WEEKDAY.php @@ -49,12 +49,10 @@ for ($row = 1; $row <= $testDateCount; ++$row) { $helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue())); $helper->log(sprintf( 'Weekday is: %d (1-7 = Sun-Sat)', - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue() )); $helper->log(sprintf( 'Weekday is: %d (1-7 = Mon-Sun)', - /** @scrutinizer ignore-type */ $worksheet->getCell('G' . $row)->getCalculatedValue() )); } diff --git a/samples/Calculations/DateTime/YEARFRAC.php b/samples/Calculations/DateTime/YEARFRAC.php index bc8edb710..81b36435d 100644 --- a/samples/Calculations/DateTime/YEARFRAC.php +++ b/samples/Calculations/DateTime/YEARFRAC.php @@ -55,27 +55,22 @@ for ($row = 1; $row <= $testDateCount; ++$row) { )); $helper->log(sprintf( 'Days: %f - US (NASD) 30/360', - /** @scrutinizer ignore-type */ $worksheet->getCell('G' . $row)->getCalculatedValue() )); $helper->log(sprintf( 'Days: %f - Actual', - /** @scrutinizer ignore-type */ $worksheet->getCell('H' . $row)->getCalculatedValue() )); $helper->log(sprintf( 'Days: %f - Actual/360', - /** @scrutinizer ignore-type */ $worksheet->getCell('I' . $row)->getCalculatedValue() )); $helper->log(sprintf( 'Days: %f - Actual/365', - /** @scrutinizer ignore-type */ $worksheet->getCell('J' . $row)->getCalculatedValue() )); $helper->log(sprintf( 'Days: %f - European 30/360', - /** @scrutinizer ignore-type */ $worksheet->getCell('K' . $row)->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/BESSELI.php b/samples/Calculations/Engineering/BESSELI.php index 4962dfbbd..bd5d9b715 100644 --- a/samples/Calculations/Engineering/BESSELI.php +++ b/samples/Calculations/Engineering/BESSELI.php @@ -23,7 +23,6 @@ for ($n = 0; $n <= 5; ++$n) { $helper->log(sprintf( '%s = %f', $worksheet->getCell('A1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/BESSELJ.php b/samples/Calculations/Engineering/BESSELJ.php index f9a0b6a50..3aa478868 100644 --- a/samples/Calculations/Engineering/BESSELJ.php +++ b/samples/Calculations/Engineering/BESSELJ.php @@ -23,7 +23,6 @@ for ($n = 0; $n <= 5; ++$n) { $helper->log(sprintf( '%s = %f', $worksheet->getCell('A1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/BESSELK.php b/samples/Calculations/Engineering/BESSELK.php index 7f5cc20ca..ee8698e94 100644 --- a/samples/Calculations/Engineering/BESSELK.php +++ b/samples/Calculations/Engineering/BESSELK.php @@ -23,7 +23,6 @@ for ($n = 0; $n <= 5; ++$n) { $helper->log(sprintf( '%s = %f', $worksheet->getCell('A1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/BESSELY.php b/samples/Calculations/Engineering/BESSELY.php index 626177218..750b7204b 100644 --- a/samples/Calculations/Engineering/BESSELY.php +++ b/samples/Calculations/Engineering/BESSELY.php @@ -23,7 +23,6 @@ for ($n = 0; $n <= 5; ++$n) { $helper->log(sprintf( '%s = %f', $worksheet->getCell('A1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('A1')->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/BIN2DEC.php b/samples/Calculations/Engineering/BIN2DEC.php index 9117bef92..0c4c45324 100644 --- a/samples/Calculations/Engineering/BIN2DEC.php +++ b/samples/Calculations/Engineering/BIN2DEC.php @@ -41,7 +41,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Binary %s is decimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BIN2HEX.php b/samples/Calculations/Engineering/BIN2HEX.php index 072cf28e4..51a111997 100644 --- a/samples/Calculations/Engineering/BIN2HEX.php +++ b/samples/Calculations/Engineering/BIN2HEX.php @@ -41,7 +41,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Binary %s is hexadecimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BIN2OCT.php b/samples/Calculations/Engineering/BIN2OCT.php index 01c632531..c320d360a 100644 --- a/samples/Calculations/Engineering/BIN2OCT.php +++ b/samples/Calculations/Engineering/BIN2OCT.php @@ -41,7 +41,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Binary %s is octal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BITAND.php b/samples/Calculations/Engineering/BITAND.php index 1fa82f1a4..2a8f7a3cc 100644 --- a/samples/Calculations/Engineering/BITAND.php +++ b/samples/Calculations/Engineering/BITAND.php @@ -40,14 +40,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): Bitwise AND of %d (%s) and %d (%s) is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('E' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BITLSHIFT.php b/samples/Calculations/Engineering/BITLSHIFT.php index 4c8cfefd9..872c8098d 100644 --- a/samples/Calculations/Engineering/BITLSHIFT.php +++ b/samples/Calculations/Engineering/BITLSHIFT.php @@ -42,33 +42,24 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): Bitwise Left Shift of %d (%s) by 1 bit is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), )); $helper->log(sprintf( '(E%d): Bitwise Left Shift of %d (%s) by 2 bits is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('E' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue(), )); $helper->log(sprintf( '(E%d): Bitwise Left Shift of %d (%s) by 3 bits is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('G' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('H' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BITOR.php b/samples/Calculations/Engineering/BITOR.php index f8cf3f2a0..1bf7f71d1 100644 --- a/samples/Calculations/Engineering/BITOR.php +++ b/samples/Calculations/Engineering/BITOR.php @@ -40,14 +40,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): Bitwise OR of %d (%s) and %d (%s) is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('E' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BITRSHIFT.php b/samples/Calculations/Engineering/BITRSHIFT.php index bc8774a88..3e7f3a88d 100644 --- a/samples/Calculations/Engineering/BITRSHIFT.php +++ b/samples/Calculations/Engineering/BITRSHIFT.php @@ -40,33 +40,24 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): Bitwise Right Shift of %d (%s) by 1 bit is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), )); $helper->log(sprintf( '(E%d): Bitwise Right Shift of %d (%s) by 2 bits is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('E' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue(), )); $helper->log(sprintf( '(E%d): Bitwise Right Shift of %d (%s) by 3 bits is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('G' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('H' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/BITXOR.php b/samples/Calculations/Engineering/BITXOR.php index 84098b979..482662cd7 100644 --- a/samples/Calculations/Engineering/BITXOR.php +++ b/samples/Calculations/Engineering/BITXOR.php @@ -40,14 +40,10 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): Bitwise XOR of %d (%s) and %d (%s) is %d (%s)', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('E' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('F' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/COMPLEX.php b/samples/Calculations/Engineering/COMPLEX.php index bf88a2a39..c58a17977 100644 --- a/samples/Calculations/Engineering/COMPLEX.php +++ b/samples/Calculations/Engineering/COMPLEX.php @@ -36,7 +36,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(A%d): Formula %s result is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('A' . $row)->getCalculatedValue() )); } diff --git a/samples/Calculations/Engineering/CONVERT.php b/samples/Calculations/Engineering/CONVERT.php index 38fd47c9c..bce56ba50 100644 --- a/samples/Calculations/Engineering/CONVERT.php +++ b/samples/Calculations/Engineering/CONVERT.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $worksheet->getCell('D' . $row)->getValue(), $worksheet->getCell('A' . $row)->getValue(), trim($worksheet->getCell('B' . $row)->getValue(), '"'), - /** @scrutinizer ignore-type */ $worksheet->getCell('D' . $row)->getCalculatedValue(), trim($worksheet->getCell('C' . $row)->getValue(), '"') )); @@ -55,6 +54,5 @@ $helper->log(sprintf( '(A%d): Unit of Measure Conversion Formula %s result is %s', $row, $worksheet->getCell('H1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('H1')->getCalculatedValue() )); diff --git a/samples/Calculations/Engineering/DEC2BIN.php b/samples/Calculations/Engineering/DEC2BIN.php index 1d7e4c86a..2a064c061 100644 --- a/samples/Calculations/Engineering/DEC2BIN.php +++ b/samples/Calculations/Engineering/DEC2BIN.php @@ -42,7 +42,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Decimal %s is binary %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/DEC2HEX.php b/samples/Calculations/Engineering/DEC2HEX.php index ac00996d2..0a19ae544 100644 --- a/samples/Calculations/Engineering/DEC2HEX.php +++ b/samples/Calculations/Engineering/DEC2HEX.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Decimal %s is hexadecimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/DEC2OCT.php b/samples/Calculations/Engineering/DEC2OCT.php index 9eb80594b..fc11a832b 100644 --- a/samples/Calculations/Engineering/DEC2OCT.php +++ b/samples/Calculations/Engineering/DEC2OCT.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Decimal %s is octal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/DELTA.php b/samples/Calculations/Engineering/DELTA.php index 579b5e6a7..cd51b1616 100644 --- a/samples/Calculations/Engineering/DELTA.php +++ b/samples/Calculations/Engineering/DELTA.php @@ -40,9 +40,7 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), - /** @scrutinizer ignore-type */ $comparison[$worksheet->getCell('C' . $row)->getCalculatedValue()] )); } diff --git a/samples/Calculations/Engineering/ERF.php b/samples/Calculations/Engineering/ERF.php index 310db12aa..e65058889 100644 --- a/samples/Calculations/Engineering/ERF.php +++ b/samples/Calculations/Engineering/ERF.php @@ -50,7 +50,6 @@ for ($row = 1; $row <= $testDataCount1; ++$row) { $row, $worksheet->getCell('C' . $row)->getValue(), $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } @@ -63,7 +62,6 @@ for ($row = $testDataCount1 + 1; $row <= $testDataCount2 + $testDataCount1; ++$r $worksheet->getCell('C' . $row)->getValue(), $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/ERFC.php b/samples/Calculations/Engineering/ERFC.php index 59a2cec8e..5e7bcc6d0 100644 --- a/samples/Calculations/Engineering/ERFC.php +++ b/samples/Calculations/Engineering/ERFC.php @@ -36,7 +36,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('C' . $row)->getValue(), $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/GESTEP.php b/samples/Calculations/Engineering/GESTEP.php index ccc44e23a..73f0a31ce 100644 --- a/samples/Calculations/Engineering/GESTEP.php +++ b/samples/Calculations/Engineering/GESTEP.php @@ -43,10 +43,8 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), sprintf( - /** @scrutinizer ignore-type */ $comparison[$worksheet->getCell('C' . $row)->getCalculatedValue()], $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), diff --git a/samples/Calculations/Engineering/HEX2BIN.php b/samples/Calculations/Engineering/HEX2BIN.php index 55dfc1f51..2ad089256 100644 --- a/samples/Calculations/Engineering/HEX2BIN.php +++ b/samples/Calculations/Engineering/HEX2BIN.php @@ -41,7 +41,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Hexadecimal %s is binary %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/HEX2DEC.php b/samples/Calculations/Engineering/HEX2DEC.php index eee19de88..745d41105 100644 --- a/samples/Calculations/Engineering/HEX2DEC.php +++ b/samples/Calculations/Engineering/HEX2DEC.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Hexadecimal %s is decimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/HEX2OCT.php b/samples/Calculations/Engineering/HEX2OCT.php index e1f72cc16..3608c1bb3 100644 --- a/samples/Calculations/Engineering/HEX2OCT.php +++ b/samples/Calculations/Engineering/HEX2OCT.php @@ -41,7 +41,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Hexadecimal %s is octal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMABS.php b/samples/Calculations/Engineering/IMABS.php index 706ffac88..9c6b843cd 100644 --- a/samples/Calculations/Engineering/IMABS.php +++ b/samples/Calculations/Engineering/IMABS.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The absolute value of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMAGINARY.php b/samples/Calculations/Engineering/IMAGINARY.php index 3f5479675..991389385 100644 --- a/samples/Calculations/Engineering/IMAGINARY.php +++ b/samples/Calculations/Engineering/IMAGINARY.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The imaginary component of %s is %f', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMARGUMENT.php b/samples/Calculations/Engineering/IMARGUMENT.php index dabd90f61..e559e9513 100644 --- a/samples/Calculations/Engineering/IMARGUMENT.php +++ b/samples/Calculations/Engineering/IMARGUMENT.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Theta Argument of %s is %f radians', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCONJUGATE.php b/samples/Calculations/Engineering/IMCONJUGATE.php index 2038d58d7..3b4429ed0 100644 --- a/samples/Calculations/Engineering/IMCONJUGATE.php +++ b/samples/Calculations/Engineering/IMCONJUGATE.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Conjugate of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCOS.php b/samples/Calculations/Engineering/IMCOS.php index ef4ee3261..5b8f81ea3 100644 --- a/samples/Calculations/Engineering/IMCOS.php +++ b/samples/Calculations/Engineering/IMCOS.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Cosine of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCOSH.php b/samples/Calculations/Engineering/IMCOSH.php index e0faa0c13..9a3937664 100644 --- a/samples/Calculations/Engineering/IMCOSH.php +++ b/samples/Calculations/Engineering/IMCOSH.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Hyperbolic Cosine of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCOT.php b/samples/Calculations/Engineering/IMCOT.php index 3aded47e0..e3d980cd2 100644 --- a/samples/Calculations/Engineering/IMCOT.php +++ b/samples/Calculations/Engineering/IMCOT.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Cotangent of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCSC.php b/samples/Calculations/Engineering/IMCSC.php index 4101fb6e7..ab6695d06 100644 --- a/samples/Calculations/Engineering/IMCSC.php +++ b/samples/Calculations/Engineering/IMCSC.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Cosecant of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMCSCH.php b/samples/Calculations/Engineering/IMCSCH.php index e25878ff7..4513d9e94 100644 --- a/samples/Calculations/Engineering/IMCSCH.php +++ b/samples/Calculations/Engineering/IMCSCH.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Hyperbolic Cosecant of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMDIV.php b/samples/Calculations/Engineering/IMDIV.php index e8c0292f9..9512be573 100644 --- a/samples/Calculations/Engineering/IMDIV.php +++ b/samples/Calculations/Engineering/IMDIV.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMEXP.php b/samples/Calculations/Engineering/IMEXP.php index 484edf20d..7f5837b23 100644 --- a/samples/Calculations/Engineering/IMEXP.php +++ b/samples/Calculations/Engineering/IMEXP.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Exponential of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMLN.php b/samples/Calculations/Engineering/IMLN.php index eb7afe974..956182573 100644 --- a/samples/Calculations/Engineering/IMLN.php +++ b/samples/Calculations/Engineering/IMLN.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Natural Logarithm of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMLOG10.php b/samples/Calculations/Engineering/IMLOG10.php index 8adba66d7..d501c3ded 100644 --- a/samples/Calculations/Engineering/IMLOG10.php +++ b/samples/Calculations/Engineering/IMLOG10.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Base-10 Logarithm of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMLOG2.php b/samples/Calculations/Engineering/IMLOG2.php index 311b39433..25986b398 100644 --- a/samples/Calculations/Engineering/IMLOG2.php +++ b/samples/Calculations/Engineering/IMLOG2.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Base-2 Logarithm of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMPOWER.php b/samples/Calculations/Engineering/IMPOWER.php index 55037b7fc..c6674fbe9 100644 --- a/samples/Calculations/Engineering/IMPOWER.php +++ b/samples/Calculations/Engineering/IMPOWER.php @@ -44,7 +44,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMPRODUCT.php b/samples/Calculations/Engineering/IMPRODUCT.php index fa2c3d937..f81bc6668 100644 --- a/samples/Calculations/Engineering/IMPRODUCT.php +++ b/samples/Calculations/Engineering/IMPRODUCT.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMREAL.php b/samples/Calculations/Engineering/IMREAL.php index 232c5c43a..4e537c0fd 100644 --- a/samples/Calculations/Engineering/IMREAL.php +++ b/samples/Calculations/Engineering/IMREAL.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The real component of %s is %f radians', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSEC.php b/samples/Calculations/Engineering/IMSEC.php index 83bdc27fc..e6c524b3c 100644 --- a/samples/Calculations/Engineering/IMSEC.php +++ b/samples/Calculations/Engineering/IMSEC.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Secant of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSECH.php b/samples/Calculations/Engineering/IMSECH.php index 5e156e5b5..e07b6e08e 100644 --- a/samples/Calculations/Engineering/IMSECH.php +++ b/samples/Calculations/Engineering/IMSECH.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Hyperbolic Secant of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSIN.php b/samples/Calculations/Engineering/IMSIN.php index 18c17af1b..d3b8c281d 100644 --- a/samples/Calculations/Engineering/IMSIN.php +++ b/samples/Calculations/Engineering/IMSIN.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Sine of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSINH.php b/samples/Calculations/Engineering/IMSINH.php index 94ef2e20e..ac0a9039b 100644 --- a/samples/Calculations/Engineering/IMSINH.php +++ b/samples/Calculations/Engineering/IMSINH.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Hyperbolic Sine of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSQRT.php b/samples/Calculations/Engineering/IMSQRT.php index a12b5582b..c2573c919 100644 --- a/samples/Calculations/Engineering/IMSQRT.php +++ b/samples/Calculations/Engineering/IMSQRT.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Square Root of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSUB.php b/samples/Calculations/Engineering/IMSUB.php index 194b7063a..90bd27a4f 100644 --- a/samples/Calculations/Engineering/IMSUB.php +++ b/samples/Calculations/Engineering/IMSUB.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMSUM.php b/samples/Calculations/Engineering/IMSUM.php index 51f702a56..2a8be3207 100644 --- a/samples/Calculations/Engineering/IMSUM.php +++ b/samples/Calculations/Engineering/IMSUM.php @@ -37,7 +37,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { $row, $worksheet->getCell('A' . $row)->getValue(), $worksheet->getCell('B' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('C' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/IMTAN.php b/samples/Calculations/Engineering/IMTAN.php index 5f083a803..ffaa53b24 100644 --- a/samples/Calculations/Engineering/IMTAN.php +++ b/samples/Calculations/Engineering/IMTAN.php @@ -43,7 +43,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(E%d): The Tangent of %s is %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/OCT2BIN.php b/samples/Calculations/Engineering/OCT2BIN.php index 9c116f343..9c4bbf863 100644 --- a/samples/Calculations/Engineering/OCT2BIN.php +++ b/samples/Calculations/Engineering/OCT2BIN.php @@ -42,7 +42,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Octal %s is binary %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/OCT2DEC.php b/samples/Calculations/Engineering/OCT2DEC.php index 6b1eec9fc..ea6afb2fb 100644 --- a/samples/Calculations/Engineering/OCT2DEC.php +++ b/samples/Calculations/Engineering/OCT2DEC.php @@ -44,7 +44,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Octal %s is decimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/Calculations/Engineering/OCT2HEX.php b/samples/Calculations/Engineering/OCT2HEX.php index 2407c86fa..47e9b6e16 100644 --- a/samples/Calculations/Engineering/OCT2HEX.php +++ b/samples/Calculations/Engineering/OCT2HEX.php @@ -44,7 +44,6 @@ for ($row = 1; $row <= $testDataCount; ++$row) { '(B%d): Octal %s is hexadecimal %s', $row, $worksheet->getCell('A' . $row)->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B' . $row)->getCalculatedValue(), )); } diff --git a/samples/DefinedNames/AbsoluteNamedRange.php b/samples/DefinedNames/AbsoluteNamedRange.php index 492249dd1..30afc00d6 100644 --- a/samples/DefinedNames/AbsoluteNamedRange.php +++ b/samples/DefinedNames/AbsoluteNamedRange.php @@ -46,10 +46,8 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/NamedFormulaeAndRanges.php b/samples/DefinedNames/NamedFormulaeAndRanges.php index 43a5832ec..a5ca80e70 100644 --- a/samples/DefinedNames/NamedFormulaeAndRanges.php +++ b/samples/DefinedNames/NamedFormulaeAndRanges.php @@ -57,10 +57,8 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/RelativeNamedRange.php b/samples/DefinedNames/RelativeNamedRange.php index f6fb0968f..fac75a471 100644 --- a/samples/DefinedNames/RelativeNamedRange.php +++ b/samples/DefinedNames/RelativeNamedRange.php @@ -49,10 +49,8 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/RelativeNamedRange2.php b/samples/DefinedNames/RelativeNamedRange2.php index fa0e27975..b3e957fd2 100644 --- a/samples/DefinedNames/RelativeNamedRange2.php +++ b/samples/DefinedNames/RelativeNamedRange2.php @@ -52,10 +52,8 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/RelativeNamedRangeAsFunction.php b/samples/DefinedNames/RelativeNamedRangeAsFunction.php index 4797615e7..333d01ab0 100644 --- a/samples/DefinedNames/RelativeNamedRangeAsFunction.php +++ b/samples/DefinedNames/RelativeNamedRangeAsFunction.php @@ -55,10 +55,8 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/ScopedNamedRange.php b/samples/DefinedNames/ScopedNamedRange.php index 776a8589d..aa71454df 100644 --- a/samples/DefinedNames/ScopedNamedRange.php +++ b/samples/DefinedNames/ScopedNamedRange.php @@ -62,12 +62,10 @@ $worksheet $helper->log(sprintf( 'Worked %.2f hours at a rate of %s - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $chargeRateCellValue = $spreadsheet ->getSheetByName($spreadsheet->getNamedRange('CHARGE_RATE')->getWorksheet()->getTitle()) ->getCell($spreadsheet->getNamedRange('CHARGE_RATE')->getCellsInRange()[0])->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); diff --git a/samples/DefinedNames/ScopedNamedRange2.php b/samples/DefinedNames/ScopedNamedRange2.php index e4ec13a5f..5f0898c91 100644 --- a/samples/DefinedNames/ScopedNamedRange2.php +++ b/samples/DefinedNames/ScopedNamedRange2.php @@ -78,11 +78,9 @@ $worksheet foreach ($spreadsheet->getAllSheets() as $worksheet) { $helper->log(sprintf( 'Worked %.2f hours for "%s" at a rate of %.2f - Charge to the client is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell("B{$row}")->getCalculatedValue(), $worksheet->getTitle(), $worksheet->getCell('B1')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell("C{$row}")->getCalculatedValue() )); } diff --git a/samples/DefinedNames/SimpleNamedFormula.php b/samples/DefinedNames/SimpleNamedFormula.php index c327f56c4..ea1f802da 100644 --- a/samples/DefinedNames/SimpleNamedFormula.php +++ b/samples/DefinedNames/SimpleNamedFormula.php @@ -34,12 +34,9 @@ $worksheet $helper->log(sprintf( 'With a Tax Rate of %.2f and a net price of %.2f, Tax is %.2f and the gross price is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell('B1')->getCalculatedValue(), $worksheet->getCell('B3')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B4')->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B5')->getCalculatedValue() )); diff --git a/samples/DefinedNames/SimpleNamedRange.php b/samples/DefinedNames/SimpleNamedRange.php index c725f1b1c..7a7cdc94a 100644 --- a/samples/DefinedNames/SimpleNamedRange.php +++ b/samples/DefinedNames/SimpleNamedRange.php @@ -28,12 +28,9 @@ $worksheet $helper->log(sprintf( 'With a Tax Rate of %.2f and a net price of %.2f, Tax is %.2f and the gross price is %.2f', - /** @scrutinizer ignore-type */ $worksheet->getCell('B1')->getCalculatedValue(), $worksheet->getCell('B3')->getValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B4')->getCalculatedValue(), - /** @scrutinizer ignore-type */ $worksheet->getCell('B5')->getCalculatedValue() )); diff --git a/samples/Reader/01_Simple_file_reader_using_IOFactory.php b/samples/Reader/01_Simple_file_reader_using_IOFactory.php index 9a39d0f7c..ec07ad74b 100644 --- a/samples/Reader/01_Simple_file_reader_using_IOFactory.php +++ b/samples/Reader/01_Simple_file_reader_using_IOFactory.php @@ -5,7 +5,7 @@ use PhpOffice\PhpSpreadsheet\IOFactory; require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory to identify the format'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory to identify the format'); $spreadsheet = IOFactory::load($inputFileName); $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); diff --git a/samples/Reader/02_Simple_file_reader_using_a_specified_reader.php b/samples/Reader/02_Simple_file_reader_using_a_specified_reader.php index f6812f135..2605f1ff3 100644 --- a/samples/Reader/02_Simple_file_reader_using_a_specified_reader.php +++ b/samples/Reader/02_Simple_file_reader_using_a_specified_reader.php @@ -5,7 +5,7 @@ use PhpOffice\PhpSpreadsheet\Reader\Xls; require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using ' . Xls::class); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using ' . Xls::class); $reader = new Xls(); $spreadsheet = $reader->load($inputFileName); diff --git a/samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php b/samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php index b7fba6e64..977cb8b12 100644 --- a/samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php +++ b/samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php @@ -7,7 +7,7 @@ require __DIR__ . '/../Header.php'; $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $reader = IOFactory::createReader($inputFileType); $spreadsheet = $reader->load($inputFileName); diff --git a/samples/Reader/04_Simple_file_reader_using_the_IOFactory_to_identify_a_reader_to_use.php b/samples/Reader/04_Simple_file_reader_using_the_IOFactory_to_identify_a_reader_to_use.php index 99f3583b4..b6ef66ad1 100644 --- a/samples/Reader/04_Simple_file_reader_using_the_IOFactory_to_identify_a_reader_to_use.php +++ b/samples/Reader/04_Simple_file_reader_using_the_IOFactory_to_identify_a_reader_to_use.php @@ -7,9 +7,9 @@ require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; $inputFileType = IOFactory::identify($inputFileName); -$helper->log('File ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' has been identified as an ' . $inputFileType . ' file'); +$helper->log('File ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' has been identified as an ' . $inputFileType . ' file'); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with the identified reader type'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with the identified reader type'); $reader = IOFactory::createReader($inputFileType); $spreadsheet = $reader->load($inputFileName); diff --git a/samples/Reader/05_Simple_file_reader_using_the_read_data_only_option.php b/samples/Reader/05_Simple_file_reader_using_the_read_data_only_option.php index 9d26607e7..668f86f3d 100644 --- a/samples/Reader/05_Simple_file_reader_using_the_read_data_only_option.php +++ b/samples/Reader/05_Simple_file_reader_using_the_read_data_only_option.php @@ -7,7 +7,7 @@ require __DIR__ . '/../Header.php'; $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $reader = IOFactory::createReader($inputFileType); $helper->log('Turning Formatting off for Load'); $reader->setReadDataOnly(true); diff --git a/samples/Reader/06_Simple_file_reader_loading_all_worksheets.php b/samples/Reader/06_Simple_file_reader_loading_all_worksheets.php index 247fef112..5507c52b2 100644 --- a/samples/Reader/06_Simple_file_reader_loading_all_worksheets.php +++ b/samples/Reader/06_Simple_file_reader_loading_all_worksheets.php @@ -7,7 +7,7 @@ require __DIR__ . '/../Header.php'; $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $reader = IOFactory::createReader($inputFileType); $helper->log('Loading all WorkSheets'); $reader->setLoadAllSheets(); diff --git a/samples/Reader/07_Simple_file_reader_loading_a_single_named_worksheet.php b/samples/Reader/07_Simple_file_reader_loading_a_single_named_worksheet.php index a78de2030..142a17f81 100644 --- a/samples/Reader/07_Simple_file_reader_loading_a_single_named_worksheet.php +++ b/samples/Reader/07_Simple_file_reader_loading_a_single_named_worksheet.php @@ -8,7 +8,7 @@ $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; $sheetname = 'Data Sheet #2'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $reader = IOFactory::createReader($inputFileType); $helper->log('Loading Sheet "' . $sheetname . '" only'); $reader->setLoadSheetsOnly($sheetname); diff --git a/samples/Reader/08_Simple_file_reader_loading_several_named_worksheets.php b/samples/Reader/08_Simple_file_reader_loading_several_named_worksheets.php index 0cc585180..66efc3e0f 100644 --- a/samples/Reader/08_Simple_file_reader_loading_several_named_worksheets.php +++ b/samples/Reader/08_Simple_file_reader_loading_several_named_worksheets.php @@ -8,7 +8,7 @@ $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; $sheetnames = ['Data Sheet #1', 'Data Sheet #3']; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $reader = IOFactory::createReader($inputFileType); $helper->log('Loading Sheet' . ((count($sheetnames) == 1) ? '' : 's') . ' "' . implode('" and "', $sheetnames) . '" only'); $reader->setLoadSheetsOnly($sheetnames); diff --git a/samples/Reader/09_Simple_file_reader_using_a_read_filter.php b/samples/Reader/09_Simple_file_reader_using_a_read_filter.php index beea8d1e8..5b3faa775 100644 --- a/samples/Reader/09_Simple_file_reader_using_a_read_filter.php +++ b/samples/Reader/09_Simple_file_reader_using_a_read_filter.php @@ -28,7 +28,7 @@ class MyReadFilter implements IReadFilter $filterSubset = new MyReadFilter(); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $helper->log('Filter range is A9:E15'); $reader = IOFactory::createReader($inputFileType); $helper->log('Loading Sheet "' . $sheetname . '" only'); diff --git a/samples/Reader/10_Simple_file_reader_using_a_configurable_read_filter.php b/samples/Reader/10_Simple_file_reader_using_a_configurable_read_filter.php index b5fecbff6..437fe6cff 100644 --- a/samples/Reader/10_Simple_file_reader_using_a_configurable_read_filter.php +++ b/samples/Reader/10_Simple_file_reader_using_a_configurable_read_filter.php @@ -40,7 +40,7 @@ class MyReadFilter implements IReadFilter $filterSubset = new MyReadFilter(9, 15, range('G', 'K')); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); $helper->log('Filter range is G9:K15'); $reader = IOFactory::createReader($inputFileType); $helper->log('Loading Sheet "' . $sheetname . '" only'); diff --git a/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php b/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php index d3de92e74..ec0113261 100644 --- a/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php +++ b/samples/Reader/11_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_1).php @@ -40,7 +40,7 @@ class ChunkReadFilter implements IReadFilter } } -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); // Create a new Reader of the type defined in $inputFileType $reader = IOFactory::createReader($inputFileType); diff --git a/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php b/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php index 8c023ca45..e8c4a6590 100644 --- a/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php +++ b/samples/Reader/12_Reading_a_workbook_in_chunks_using_a_configurable_read_filter_(version_2).php @@ -40,7 +40,7 @@ class ChunkReadFilter implements IReadFilter } } -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory with a defined reader type of ' . $inputFileType); // Create a new Reader of the type defined in $inputFileType $reader = IOFactory::createReader($inputFileType); diff --git a/samples/Reader/13_Simple_file_reader_for_multiple_CSV_files.php b/samples/Reader/13_Simple_file_reader_for_multiple_CSV_files.php index 9435f9721..7078a77e8 100644 --- a/samples/Reader/13_Simple_file_reader_for_multiple_CSV_files.php +++ b/samples/Reader/13_Simple_file_reader_for_multiple_CSV_files.php @@ -8,14 +8,14 @@ $inputFileNames = [__DIR__ . '/sampleData/example1.csv', __DIR__ . '/sampleData/ $reader = new Csv(); $inputFileName = array_shift($inputFileNames); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using Csv Reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using Csv Reader'); $spreadsheet = $reader->load($inputFileName); -$spreadsheet->getActiveSheet()->setTitle(/** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME)); +$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); foreach ($inputFileNames as $sheet => $inputFileName) { - $helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #' . ($sheet + 2) . ' using Csv Reader'); + $helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #' . ($sheet + 2) . ' using Csv Reader'); $reader->setSheetIndex($sheet + 1); $reader->loadIntoExisting($inputFileName, $spreadsheet); - $spreadsheet->getActiveSheet()->setTitle(/** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME)); + $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); } $helper->log($spreadsheet->getSheetCount() . ' worksheet' . (($spreadsheet->getSheetCount() == 1) ? '' : 's') . ' loaded'); diff --git a/samples/Reader/14_Reading_a_large_CSV_file_in_chunks_to_split_across_multiple_worksheets.php b/samples/Reader/14_Reading_a_large_CSV_file_in_chunks_to_split_across_multiple_worksheets.php index f33a9b486..82544f60a 100644 --- a/samples/Reader/14_Reading_a_large_CSV_file_in_chunks_to_split_across_multiple_worksheets.php +++ b/samples/Reader/14_Reading_a_large_CSV_file_in_chunks_to_split_across_multiple_worksheets.php @@ -40,7 +40,7 @@ class ChunkReadFilter implements IReadFilter } } -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using Csv reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using Csv reader'); // Create a new Reader of the type defined in $inputFileType $reader = new Csv(); diff --git a/samples/Reader/15_Simple_file_reader_for_tab_separated_value_file_using_the_Advanced_Value_Binder.php b/samples/Reader/15_Simple_file_reader_for_tab_separated_value_file_using_the_Advanced_Value_Binder.php index 2f63fd0de..891d95e53 100644 --- a/samples/Reader/15_Simple_file_reader_for_tab_separated_value_file_using_the_Advanced_Value_Binder.php +++ b/samples/Reader/15_Simple_file_reader_for_tab_separated_value_file_using_the_Advanced_Value_Binder.php @@ -11,10 +11,10 @@ Cell::setValueBinder(new AdvancedValueBinder()); $inputFileName = __DIR__ . '/sampleData/example1.tsv'; $reader = new Csv(); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using Csv reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using Csv reader'); $reader->setDelimiter("\t"); $spreadsheet = $reader->load($inputFileName); -$spreadsheet->getActiveSheet()->setTitle(/** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME)); +$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); $helper->log($spreadsheet->getSheetCount() . ' worksheet' . (($spreadsheet->getSheetCount() == 1) ? '' : 's') . ' loaded'); $loadedSheetNames = $spreadsheet->getSheetNames(); diff --git a/samples/Reader/16_Handling_loader_exceptions_using_TryCatch.php b/samples/Reader/16_Handling_loader_exceptions_using_TryCatch.php index d984b7b63..5b1029670 100644 --- a/samples/Reader/16_Handling_loader_exceptions_using_TryCatch.php +++ b/samples/Reader/16_Handling_loader_exceptions_using_TryCatch.php @@ -6,10 +6,10 @@ use PhpOffice\PhpSpreadsheet\Reader\Exception as ReaderException; require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/non-existing-file.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory to identify the format'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using IOFactory to identify the format'); try { $spreadsheet = IOFactory::load($inputFileName); } catch (ReaderException $e) { - $helper->log('Error loading file "' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); + $helper->log('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); } diff --git a/samples/Reader/17_Simple_file_reader_loading_several_named_worksheets.php b/samples/Reader/17_Simple_file_reader_loading_several_named_worksheets.php index 12c3c1131..7701c78e7 100644 --- a/samples/Reader/17_Simple_file_reader_loading_several_named_worksheets.php +++ b/samples/Reader/17_Simple_file_reader_loading_several_named_worksheets.php @@ -6,7 +6,7 @@ require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' using Xls reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' using Xls reader'); $reader = new Xls(); // Read the list of Worksheet Names from the Workbook file diff --git a/samples/Reader/18_Reading_list_of_worksheets_without_loading_entire_file.php b/samples/Reader/18_Reading_list_of_worksheets_without_loading_entire_file.php index 6d2c3db93..fb5b35224 100644 --- a/samples/Reader/18_Reading_list_of_worksheets_without_loading_entire_file.php +++ b/samples/Reader/18_Reading_list_of_worksheets_without_loading_entire_file.php @@ -6,7 +6,7 @@ require __DIR__ . '/../Header.php'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' information using Xls reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' information using Xls reader'); $reader = new Xls(); $worksheetNames = $reader->listWorksheetNames($inputFileName); diff --git a/samples/Reader/19_Reading_worksheet_information_without_loading_entire_file.php b/samples/Reader/19_Reading_worksheet_information_without_loading_entire_file.php index 369fff9ae..893daf49d 100644 --- a/samples/Reader/19_Reading_worksheet_information_without_loading_entire_file.php +++ b/samples/Reader/19_Reading_worksheet_information_without_loading_entire_file.php @@ -7,7 +7,7 @@ require __DIR__ . '/../Header.php'; $inputFileType = 'Xls'; $inputFileName = __DIR__ . '/sampleData/example1.xls'; -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' information using Xls reader'); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' information using Xls reader'); $reader = new Xls(); $worksheetData = $reader->listWorksheetInfo($inputFileName); diff --git a/samples/Reader/20_Reader_worksheet_hyperlink_image.php b/samples/Reader/20_Reader_worksheet_hyperlink_image.php index 95a9829ed..2b3f294a6 100644 --- a/samples/Reader/20_Reader_worksheet_hyperlink_image.php +++ b/samples/Reader/20_Reader_worksheet_hyperlink_image.php @@ -25,7 +25,7 @@ $drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); $drawing->setName('In-Memory image 1'); $drawing->setDescription('In-Memory image 1'); $drawing->setCoordinates('A1'); -$drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); +$drawing->setImageResource($gdImage); $drawing->setRenderingFunction( \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG ); diff --git a/samples/Reader/21_Reader_CSV_Long_Integers_with_String_Value_Binder.php b/samples/Reader/21_Reader_CSV_Long_Integers_with_String_Value_Binder.php index 34d99d0ac..99f5441c3 100644 --- a/samples/Reader/21_Reader_CSV_Long_Integers_with_String_Value_Binder.php +++ b/samples/Reader/21_Reader_CSV_Long_Integers_with_String_Value_Binder.php @@ -12,10 +12,10 @@ $inputFileType = 'Csv'; $inputFileName = __DIR__ . '/sampleData/longIntegers.csv'; $reader = IOFactory::createReader($inputFileType); -$helper->log('Loading file ' . /** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using IOFactory with a defined reader type of ' . $inputFileType); +$helper->log('Loading file ' . pathinfo($inputFileName, PATHINFO_BASENAME) . ' into WorkSheet #1 using IOFactory with a defined reader type of ' . $inputFileType); $spreadsheet = $reader->load($inputFileName); -$spreadsheet->getActiveSheet()->setTitle(/** @scrutinizer ignore-type */ pathinfo($inputFileName, PATHINFO_BASENAME)); +$spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); $helper->log($spreadsheet->getSheetCount() . ' worksheet' . (($spreadsheet->getSheetCount() == 1) ? '' : 's') . ' loaded'); $loadedSheetNames = $spreadsheet->getSheetNames(); diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 7e48617ea..4f564095c 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -5417,7 +5417,7 @@ class Calculation { $this->formulaError = $errorMessage; $this->cyclicReferenceStack->clear(); - $suppress = /** @scrutinizer ignore-deprecated */ $this->suppressFormulaErrors ?? $this->suppressFormulaErrorsNew; + $suppress = $this->suppressFormulaErrors ?? $this->suppressFormulaErrorsNew; if (!$suppress) { throw new Exception($errorMessage, $code, $exception); } diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 56b09082b..81169f4d5 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -685,7 +685,7 @@ class DateTime * * @return array|int|string Week Number */ - public static function WEEKNUM(mixed $dateValue = 1, $method = /** @scrutinizer ignore-deprecated */ self::STARTWEEK_SUNDAY): int|string|array + public static function WEEKNUM(mixed $dateValue = 1, $method = self::STARTWEEK_SUNDAY): int|string|array { return DateTimeExcel\Week::number($dateValue, $method); } diff --git a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php index e764f525a..e91c342cd 100644 --- a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php +++ b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php @@ -75,13 +75,13 @@ class Date $year = self::getYear($year, $baseYear); // must be int - Scrutinizer is wrong $month = self::getMonth($month); $day = self::getDay($day); - self::adjustYearMonth(/** @scrutinizer ignore-type */ $year, $month, $baseYear); + self::adjustYearMonth($year, $month, $baseYear); } catch (Exception $e) { return $e->getMessage(); } // Execute function - $excelDateValue = SharedDateHelper::formattedPHPToExcel(/** @scrutinizer ignore-type */ $year, $month, $day); + $excelDateValue = SharedDateHelper::formattedPHPToExcel($year, $month, $day); return Helpers::returnIn3FormatsFloat($excelDateValue); } diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php index 66df39b1a..2a846f032 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php @@ -558,7 +558,7 @@ class ConvertUOM } elseif ($fromUOM === $toUOM) { return $value / $toMultiplier; } elseif ($fromCategory === self::CATEGORY_TEMPERATURE) { - return self::convertTemperature($fromUOM, $toUOM, /** @scrutinizer ignore-type */ $value); + return self::convertTemperature($fromUOM, $toUOM, $value); } $baseValue = $value * (1.0 / self::$unitConversions[$fromCategory][$fromUOM]); diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php b/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php index 93294e230..56b1ba95d 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php @@ -223,7 +223,7 @@ class Conditional $conditions = self::buildConditions(1, ...$args); // Scrutinizer thinks first parameter of array_map can't be null. It is wrong. - return array_map(/** @scrutinizer ignore-type */ null, ...$conditions); + return array_map(null, ...$conditions); } /** @param array $args */ @@ -238,7 +238,7 @@ class Conditional ); } - return array_map(/** @scrutinizer ignore-type */ null, ...$conditions); + return array_map(null, ...$conditions); } /** @param array $args */ @@ -289,7 +289,7 @@ class Conditional ++$pairCount; } - return array_map(/** @scrutinizer ignore-type */ null, ...$database); + return array_map(null, ...$database); } private static function databaseFromRangeAndValue(array $range, array $valueRange = []): array @@ -301,7 +301,7 @@ class Conditional $valueRange = $range; } - $database = array_map(/** @scrutinizer ignore-type */ null, array_merge([self::CONDITION_COLUMN_NAME], $range), array_merge([self::VALUE_COLUMN_NAME], $valueRange)); + $database = array_map(null, array_merge([self::CONDITION_COLUMN_NAME], $range), array_merge([self::VALUE_COLUMN_NAME], $valueRange)); return $database; } diff --git a/src/PhpSpreadsheet/Calculation/TextData/Text.php b/src/PhpSpreadsheet/Calculation/TextData/Text.php index f5117e4b5..cca613f7c 100644 --- a/src/PhpSpreadsheet/Calculation/TextData/Text.php +++ b/src/PhpSpreadsheet/Calculation/TextData/Text.php @@ -189,7 +189,7 @@ class Text return '(' . $delimiters . ')'; } - return '(' . preg_quote(/** @scrutinizer ignore-type */ Functions::flattenSingleValue($delimiter), '/') . ')'; + return '(' . preg_quote(Functions::flattenSingleValue($delimiter), '/') . ')'; } private static function matchFlags(bool $matchMode): string diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index f4befaa15..a3f5ca0cf 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -491,7 +491,7 @@ class DataSeriesValues extends Properties if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { $this->dataValues = Functions::flattenArray($newDataValues); } else { - $newArray = array_values(array_shift(/** @scrutinizer ignore-type */ $newDataValues)); + $newArray = array_values(array_shift($newDataValues)); foreach ($newArray as $i => $newDataSet) { $newArray[$i] = [$newDataSet]; } diff --git a/src/PhpSpreadsheet/Collection/Cells.php b/src/PhpSpreadsheet/Collection/Cells.php index 5a48e8d0d..c0a1dbaa5 100644 --- a/src/PhpSpreadsheet/Collection/Cells.php +++ b/src/PhpSpreadsheet/Collection/Cells.php @@ -349,7 +349,7 @@ class Cells private function storeCurrentCell(): void { if ($this->currentCellIsDirty && isset($this->currentCoordinate, $this->currentCell)) { - $this->currentCell->/** @scrutinizer ignore-call */ detach(); + $this->currentCell->detach(); $stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell); if ($stored === false) { diff --git a/src/PhpSpreadsheet/Helper/Html.php b/src/PhpSpreadsheet/Helper/Html.php index a4ea39f87..6a265a961 100644 --- a/src/PhpSpreadsheet/Helper/Html.php +++ b/src/PhpSpreadsheet/Helper/Html.php @@ -628,7 +628,6 @@ class Html // Load the HTML file into the DOM object // Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup $prefix = ''; - /** @scrutinizer ignore-unhandled */ @$dom->loadHTML($prefix . $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); // Discard excess white space $dom->preserveWhiteSpace = false; diff --git a/src/PhpSpreadsheet/Helper/Sample.php b/src/PhpSpreadsheet/Helper/Sample.php index fb40dd884..3d53f1e05 100644 --- a/src/PhpSpreadsheet/Helper/Sample.php +++ b/src/PhpSpreadsheet/Helper/Sample.php @@ -129,7 +129,7 @@ class Sample } $callStartTime = microtime(true); $writer->save($path); - $this->logWrite($writer, $path, /** @scrutinizer ignore-type */ $callStartTime); + $this->logWrite($writer, $path, $callStartTime); if ($this->isCli() === false) { // @codeCoverageIgnoreStart echo 'Download ' . basename($path) . '
'; @@ -167,7 +167,7 @@ class Sample { $originalExtension = pathinfo($filename, PATHINFO_EXTENSION); - return $this->getTemporaryFolder() . '/' . str_replace('.' . /** @scrutinizer ignore-type */ $originalExtension, '.' . $extension, basename($filename)); + return $this->getTemporaryFolder() . '/' . str_replace('.' . $originalExtension, '.' . $extension, basename($filename)); } /** diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index 16da2f7bb..d5a565a55 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -551,7 +551,7 @@ class Csv extends BaseReader fclose($this->fileHandle); // Trust file extension if any - $extension = strtolower(/** @scrutinizer ignore-type */ pathinfo($filename, PATHINFO_EXTENSION)); + $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if (in_array($extension, ['csv', 'tsv'])) { return true; } diff --git a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php index dd082b276..4b7516587 100644 --- a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php +++ b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php @@ -95,7 +95,6 @@ class Styles private function readStyles(SimpleXMLElement $styleRegion, int $maxRow, int $maxCol): void { foreach ($styleRegion as $style) { - /** @scrutinizer ignore-call */ $styleAttributes = $style->attributes(); if ($styleAttributes !== null && ($styleAttributes['startRow'] <= $maxRow) && ($styleAttributes['startCol'] <= $maxCol)) { $cellRange = $this->readStyleRange($styleAttributes, $maxCol, $maxRow); @@ -112,7 +111,7 @@ class Styles if ($this->readDataOnly === false && $styleAttributes !== null) { // If readDataOnly is false, we set all formatting information $styleArray['numberFormat']['formatCode'] = $formatCode; - $styleArray = $this->readStyle($styleArray, $styleAttributes, /** @scrutinizer ignore-type */ $style); + $styleArray = $this->readStyle($styleArray, $styleAttributes, $style); } $this->spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); } diff --git a/src/PhpSpreadsheet/Reader/Ods.php b/src/PhpSpreadsheet/Reader/Ods.php index 5e06b673b..ceb345dc3 100644 --- a/src/PhpSpreadsheet/Reader/Ods.php +++ b/src/PhpSpreadsheet/Reader/Ods.php @@ -66,7 +66,6 @@ class Ods extends BaseReader if (isset($namespacesContent['manifest'])) { $manifest = $xml->children($namespacesContent['manifest']); foreach ($manifest as $manifestDataSet) { - /** @scrutinizer ignore-call */ $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']); if ($manifestAttributes && $manifestAttributes->{'full-path'} == '/') { $mimeType = (string) $manifestAttributes->{'media-type'}; @@ -549,7 +548,7 @@ class Ods extends BaseReader $dataValue = Date::PHPToExcel( strtotime( - '01-01-1970 ' . implode(':', /** @scrutinizer ignore-type */ sscanf($timeValue, 'PT%dH%dM%dS') ?? []) + '01-01-1970 ' . implode(':', sscanf($timeValue, 'PT%dH%dM%dS') ?? []) ) ); $formatting = NumberFormat::FORMAT_DATE_TIME4; diff --git a/src/PhpSpreadsheet/Reader/Ods/Properties.php b/src/PhpSpreadsheet/Reader/Ods/Properties.php index a6ccd7ff1..f56561082 100644 --- a/src/PhpSpreadsheet/Reader/Ods/Properties.php +++ b/src/PhpSpreadsheet/Reader/Ods/Properties.php @@ -21,14 +21,12 @@ class Properties $officeProperty = $xml->children($namespacesMeta['office']); foreach ($officeProperty as $officePropertyData) { if (isset($namespacesMeta['dc'])) { - /** @scrutinizer ignore-call */ $officePropertiesDC = $officePropertyData->children($namespacesMeta['dc']); $this->setCoreProperties($docProps, $officePropertiesDC); } $officePropertyMeta = null; if (isset($namespacesMeta['dc'])) { - /** @scrutinizer ignore-call */ $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); } $officePropertyMeta = $officePropertyMeta ?? []; diff --git a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php index ae602bab4..1fbddcb3c 100644 --- a/src/PhpSpreadsheet/Reader/Security/XmlScanner.php +++ b/src/PhpSpreadsheet/Reader/Security/XmlScanner.php @@ -74,7 +74,7 @@ class XmlScanner $xml = $this->toUtf8($xml); // Don't rely purely on libxml_disable_entity_loader() - $pattern = '/\\0?' . implode('\\0?', /** @scrutinizer ignore-type */ str_split($this->pattern)) . '\\0?/'; + $pattern = '/\\0?' . implode('\\0?', str_split($this->pattern)) . '\\0?/'; if (preg_match($pattern, $xml)) { throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 7f29194d9..053dc2be7 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -978,7 +978,6 @@ class Xlsx extends BaseReader if ($xmlSheetNS && $xmlSheetNS->mergeCells && $xmlSheetNS->mergeCells->mergeCell && !$this->readDataOnly) { foreach ($xmlSheetNS->mergeCells->mergeCell as $mergeCellx) { - /** @scrutinizer ignore-call */ $mergeCell = $mergeCellx->attributes(); $mergeRef = (string) ($mergeCell['ref'] ?? ''); if (str_contains($mergeRef, ':')) { @@ -993,7 +992,7 @@ class Xlsx extends BaseReader if ($xmlSheet !== false && isset($xmlSheet->extLst->ext)) { foreach ($xmlSheet->extLst->ext as $extlst) { - $extAttrs = $extlst->/** @scrutinizer ignore-call */ attributes() ?? []; + $extAttrs = $extlst->attributes() ?? []; $extUri = (string) ($extAttrs['uri'] ?? ''); if ($extUri !== '{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}') { continue; @@ -1003,7 +1002,7 @@ class Xlsx extends BaseReader $xmlSheet->addChild('dataValidations'); } - foreach ($extlst->/** @scrutinizer ignore-call */ children(Namespaces::DATA_VALIDATIONS1)->dataValidations->dataValidation as $item) { + foreach ($extlst->children(Namespaces::DATA_VALIDATIONS1)->dataValidations->dataValidation as $item) { $item = self::testSimpleXml($item); $node = self::testSimpleXml($xmlSheet->dataValidations)->addChild('dataValidation'); foreach ($item->attributes() ?? [] as $attr) { @@ -1475,7 +1474,6 @@ class Xlsx extends BaseReader } $xfrm = $twoCellAnchor->pic->spPr->children(Namespaces::DRAWINGML)->xfrm; $outerShdw = $twoCellAnchor->pic->spPr->children(Namespaces::DRAWINGML)->effectLst->outerShdw; - /** @scrutinizer ignore-call */ $editAs = $twoCellAnchor->attributes(); if (isset($editAs, $editAs['editAs'])) { $objDrawing->setEditAs($editAs['editAs']); diff --git a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php index 20824fea9..68086cc14 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php @@ -43,7 +43,7 @@ class AutoFilter $autoFilter->setRange($autoFilterRange); foreach ($this->worksheetXml->autoFilter->filterColumn as $filterColumn) { - $attributes = $filterColumn->/** @scrutinizer ignore-call */ attributes() ?? []; + $attributes = $filterColumn->attributes() ?? []; $column = $autoFilter->getColumnByOffset((int) ($attributes['colId'] ?? 0)); // Check for standard filters if ($filterColumn->filters) { @@ -57,7 +57,7 @@ class AutoFilter // Entries can be either filter elements foreach ($filterColumn->filters->filter as $filterRule) { // Operator is undefined, but always treated as EQUAL - $attr2 = $filterRule->/** @scrutinizer ignore-call */ attributes() ?? ['val' => '']; + $attr2 = $filterRule->attributes() ?? ['val' => '']; $column->createRule()->setRule('', (string) $attr2['val'])->setRuleType(Rule::AUTOFILTER_RULETYPE_FILTER); } @@ -79,7 +79,7 @@ class AutoFilter { foreach ($filters->dateGroupItem as $dateGroupItemx) { // Operator is undefined, but always treated as EQUAL - $dateGroupItem = $dateGroupItemx->/** @scrutinizer ignore-call */ attributes(); + $dateGroupItem = $dateGroupItemx->attributes(); if ($dateGroupItem !== null) { $column->createRule()->setRule( '', @@ -109,7 +109,7 @@ class AutoFilter $column->setJoin(Column::AUTOFILTER_COLUMN_JOIN_AND); } foreach ($customFilters->customFilter as $filterRule) { - $attr2 = $filterRule->/** @scrutinizer ignore-call */ attributes() ?? ['operator' => '', 'val' => '']; + $attr2 = $filterRule->attributes() ?? ['operator' => '', 'val' => '']; $column->createRule()->setRule( (string) $attr2['operator'], (string) $attr2['val'] @@ -125,7 +125,7 @@ class AutoFilter // We should only ever have one dynamic filter foreach ($filterColumn->dynamicFilter as $filterRule) { // Operator is undefined, but always treated as EQUAL - $attr2 = $filterRule->/** @scrutinizer ignore-call */ attributes() ?? []; + $attr2 = $filterRule->attributes() ?? []; $column->createRule()->setRule( '', (string) ($attr2['val'] ?? ''), @@ -147,7 +147,7 @@ class AutoFilter $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); // We should only ever have one top10 filter foreach ($filterColumn->top10 as $filterRule) { - $attr2 = $filterRule->/** @scrutinizer ignore-call */ attributes() ?? []; + $attr2 = $filterRule->attributes() ?? []; $column->createRule()->setRule( ( ((isset($attr2['percent'])) && ((string) $attr2['percent'] === '1')) diff --git a/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php b/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php index 69f922eca..41eab03c5 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php @@ -136,7 +136,6 @@ class ColumnAndRowAttributes extends BaseParserClass $columnAttributes = []; foreach ($worksheetCols->col as $columnx) { - /** @scrutinizer ignore-call */ $column = $columnx->attributes(); if ($column !== null) { $startColumn = Coordinate::stringFromColumnIndex((int) $column['min']); @@ -195,7 +194,6 @@ class ColumnAndRowAttributes extends BaseParserClass $rowAttributes = []; foreach ($worksheetRow as $rowx) { - /** @scrutinizer ignore-call */ $row = $rowx->attributes(); if ($row !== null) { if (isset($row['ht']) && !$readDataOnly) { diff --git a/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php b/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php index 669d93167..27025c1b1 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php @@ -76,12 +76,11 @@ class ConditionalStyles } foreach ($extLst->ext as $extlstcond) { - $extAttrs = $extlstcond->/** @scrutinizer ignore-call */ attributes() ?? []; + $extAttrs = $extlstcond->attributes() ?? []; $extUri = (string) ($extAttrs['uri'] ?? ''); if ($extUri !== '{78C0D931-6437-407d-A8EE-F0AAD7539E65}') { continue; } - /** @scrutinizer ignore-call */ $conditionalFormattingRuleXml = $extlstcond->children($this->ns['x14']); if (!$conditionalFormattingRuleXml->conditionalFormattings) { return []; diff --git a/src/PhpSpreadsheet/Reader/Xlsx/TableReader.php b/src/PhpSpreadsheet/Reader/Xlsx/TableReader.php index 5150bca72..a63c817d4 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/TableReader.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/TableReader.php @@ -65,7 +65,7 @@ class TableReader } foreach ($autoFilterXml->filterColumn as $filterColumn) { - $attributes = $filterColumn->/** @scrutinizer ignore-call */ attributes() ?? ['colId' => 0, 'hiddenButton' => 0]; + $attributes = $filterColumn->attributes() ?? ['colId' => 0, 'hiddenButton' => 0]; $column = $table->getColumnByOffset((int) $attributes['colId']); $column->setShowFilterButton(((string) $attributes['hiddenButton']) !== '1'); } @@ -78,7 +78,7 @@ class TableReader { $offset = 0; foreach ($tableColumnsXml->tableColumn as $tableColumn) { - $attributes = $tableColumn->/** @scrutinizer ignore-call */ attributes() ?? ['totalsRowLabel' => 0, 'totalsRowFunction' => 0]; + $attributes = $tableColumn->attributes() ?? ['totalsRowLabel' => 0, 'totalsRowFunction' => 0]; $column = $table->getColumnByOffset($offset++); if ($table->getShowTotalsRow()) { diff --git a/src/PhpSpreadsheet/Reader/Xml.php b/src/PhpSpreadsheet/Reader/Xml.php index 7c0611103..09baf3321 100644 --- a/src/PhpSpreadsheet/Reader/Xml.php +++ b/src/PhpSpreadsheet/Reader/Xml.php @@ -286,7 +286,7 @@ class Xml extends BaseReader if ( isset($this->loadSheetsOnly, $worksheet_ss['Name']) - && (!in_array($worksheet_ss['Name'], /** @scrutinizer ignore-type */ $this->loadSheetsOnly)) + && (!in_array($worksheet_ss['Name'], $this->loadSheetsOnly)) ) { continue; } diff --git a/src/PhpSpreadsheet/Reader/Xml/PageSettings.php b/src/PhpSpreadsheet/Reader/Xml/PageSettings.php index d3b4ccc09..8f9d4645d 100644 --- a/src/PhpSpreadsheet/Reader/Xml/PageSettings.php +++ b/src/PhpSpreadsheet/Reader/Xml/PageSettings.php @@ -59,7 +59,6 @@ class PageSettings if (isset($xmlX->WorksheetOptions->PageSetup)) { foreach ($xmlX->WorksheetOptions->PageSetup as $pageSetupData) { foreach ($pageSetupData as $pageSetupKey => $pageSetupValue) { - /** @scrutinizer ignore-call */ $pageSetupAttributes = $pageSetupValue->attributes(Namespaces::URN_EXCEL); if ($pageSetupAttributes !== null) { switch ($pageSetupKey) { diff --git a/src/PhpSpreadsheet/ReferenceHelper.php b/src/PhpSpreadsheet/ReferenceHelper.php index 6be6ab81e..5ec796708 100644 --- a/src/PhpSpreadsheet/ReferenceHelper.php +++ b/src/PhpSpreadsheet/ReferenceHelper.php @@ -86,11 +86,9 @@ class ReferenceHelper */ public static function cellSort(string $a, string $b): int { - /** @scrutinizer be-damned */ sscanf($a, '%[A-Z]%d', $ac, $ar); /** @var int $ar */ /** @var string $ac */ - /** @scrutinizer be-damned */ sscanf($b, '%[A-Z]%d', $bc, $br); /** @var int $br */ /** @var string $bc */ @@ -110,11 +108,9 @@ class ReferenceHelper */ public static function cellReverseSort(string $a, string $b): int { - /** @scrutinizer be-damned */ sscanf($a, '%[A-Z]%d', $ac, $ar); /** @var int $ar */ /** @var string $ac */ - /** @scrutinizer be-damned */ sscanf($b, '%[A-Z]%d', $bc, $br); /** @var int $br */ /** @var string $bc */ diff --git a/src/PhpSpreadsheet/Settings.php b/src/PhpSpreadsheet/Settings.php index d286afc68..9f2ef0cd8 100644 --- a/src/PhpSpreadsheet/Settings.php +++ b/src/PhpSpreadsheet/Settings.php @@ -133,7 +133,7 @@ class Settings * * @codeCoverageIgnore */ - public static function setLibXmlDisableEntityLoader(/** @scrutinizer ignore-unused */ $state): void + public static function setLibXmlDisableEntityLoader($state): void { // noop } diff --git a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php index 28c72302f..3c4e03c5a 100644 --- a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php +++ b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -162,7 +162,7 @@ class ChainedBlockStream } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) { $this->pos += $offset; // @phpstan-ignore-next-line - } elseif ($whence == SEEK_END && -$offset <= count(/** @scrutinizer ignore-type */ $this->data)) { + } elseif ($whence == SEEK_END && -$offset <= count($this->data)) { $this->pos = strlen($this->data) + $offset; } else { return false; diff --git a/src/PhpSpreadsheet/Shared/PasswordHasher.php b/src/PhpSpreadsheet/Shared/PasswordHasher.php index 7dd794038..e457d9157 100644 --- a/src/PhpSpreadsheet/Shared/PasswordHasher.php +++ b/src/PhpSpreadsheet/Shared/PasswordHasher.php @@ -99,7 +99,7 @@ class PasswordHasher $saltValue = base64_decode($salt); $encodedPassword = mb_convert_encoding($password, 'UCS-2LE', 'UTF-8'); - $hashValue = hash($phpAlgorithm, $saltValue . /** @scrutinizer ignore-type */ $encodedPassword, true); + $hashValue = hash($phpAlgorithm, $saltValue . $encodedPassword, true); for ($i = 0; $i < $spinCount; ++$i) { $hashValue = hash($phpAlgorithm, $hashValue . pack('L', $i), true); } diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index a75d95e4e..514a0f355 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -326,7 +326,7 @@ class StringHelper mb_substitute_character(65533); // Unicode substitution character // Phpstan does not think this can return false. $returnValue = mb_convert_encoding($textValue, 'UTF-8', 'UTF-8'); - mb_substitute_character(/** @scrutinizer ignore-type */ $subst); + mb_substitute_character($subst); return self::returnString($returnValue); } diff --git a/src/PhpSpreadsheet/Shared/XMLWriter.php b/src/PhpSpreadsheet/Shared/XMLWriter.php index c0d880e84..28a567fc1 100644 --- a/src/PhpSpreadsheet/Shared/XMLWriter.php +++ b/src/PhpSpreadsheet/Shared/XMLWriter.php @@ -57,7 +57,6 @@ class XMLWriter extends \XMLWriter // Unlink temporary files // There is nothing reasonable to do if unlink fails. if ($this->tempFileName != '') { - /** @scrutinizer ignore-unhandled */ @unlink($this->tempFileName); } } diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index db9c3353c..9c0bb170e 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -373,7 +373,7 @@ class Spreadsheet implements JsonSerializable { $extension = pathinfo($path, PATHINFO_EXTENSION); - return substr(/** @scrutinizer ignore-type */ $extension, 0); + return substr($extension, 0); } /** diff --git a/src/PhpSpreadsheet/Style/Border.php b/src/PhpSpreadsheet/Style/Border.php index 0dc4ab00c..006f64c26 100644 --- a/src/PhpSpreadsheet/Style/Border.php +++ b/src/PhpSpreadsheet/Style/Border.php @@ -98,7 +98,7 @@ class Border extends Supervisor /** @var Style */ $parent = $this->parent; - return $parent->/** @scrutinizer ignore-call */ getStyleArray([$this->parentPropertyName => $array]); + return $parent->getStyleArray([$this->parentPropertyName => $array]); } /** diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index 87a7cb59e..fdc0a971f 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -169,7 +169,7 @@ class Color extends Supervisor /** @var Style */ $parent = $this->parent; - return $parent->/** @scrutinizer ignore-call */ getStyleArray([$this->parentPropertyName => $array]); + return $parent->getStyleArray([$this->parentPropertyName => $array]); } /** diff --git a/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php b/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php index 7ce688dbb..3ad69db9e 100644 --- a/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php +++ b/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php @@ -44,7 +44,7 @@ class ConditionalFormattingRuleExtension } } - return implode('', /** @scrutinizer ignore-type */ $chars); + return implode('', $chars); } public static function parseExtLstXml(?SimpleXMLElement $extLstXml): array @@ -146,8 +146,7 @@ class ConditionalFormattingRuleExtension } $cfvoIndex = 0; foreach ($dataBarXml->cfvo as $cfvo) { - $f = (string) $cfvo->/** @scrutinizer ignore-call */ children($ns['xm'])->f; - /** @scrutinizer ignore-call */ + $f = (string) $cfvo->children($ns['xm'])->f; $attributes = $cfvo->attributes(); if (!($attributes)) { continue; diff --git a/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php b/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php index e07c73fa0..2ddf6e2c1 100644 --- a/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php +++ b/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php @@ -172,7 +172,7 @@ class CellValue extends WizardAbstract implements WizardInterface } // Scrutinizer ignores its own suggested workaround. - //$this->operand(1, /** @scrutinizer ignore-type */ ...$arguments); + //$this->operand(1, ...$arguments); if (count($arguments) < 2) { $this->operand(1, $arguments[0]); } else { diff --git a/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php b/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php index 5064df6a2..a81d9f480 100644 --- a/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php +++ b/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php @@ -67,7 +67,7 @@ class Expression extends WizardAbstract implements WizardInterface } // Scrutinizer ignores its own recommendation - //$this->expression(/** @scrutinizer ignore-type */ ...$arguments); + //$this->expression(...$arguments); $this->expression($arguments[0]); return $this; diff --git a/src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php b/src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php index 02abc2dbc..12f37c125 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php +++ b/src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php @@ -206,6 +206,6 @@ class DateFormatter private static function escapeQuotesCallback(array $matches): string { - return '\\' . implode('\\', /** @scrutinizer ignore-type */ str_split($matches[1])); + return '\\' . implode('\\', str_split($matches[1])); } } diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index f25b05065..2310e64ea 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -224,7 +224,7 @@ class BaseDrawing implements IComparable while ($iterator->valid()) { if ($iterator->current()->getHashCode() === $this->getHashCode()) { - $this->worksheet->getDrawingCollection()->offsetUnset(/** @scrutinizer ignore-type */ $iterator->key()); + $this->worksheet->getDrawingCollection()->offsetUnset($iterator->key()); $this->worksheet = null; break; diff --git a/src/PhpSpreadsheet/Worksheet/Column.php b/src/PhpSpreadsheet/Worksheet/Column.php index 3bd8128b2..47681425b 100644 --- a/src/PhpSpreadsheet/Worksheet/Column.php +++ b/src/PhpSpreadsheet/Worksheet/Column.php @@ -88,7 +88,6 @@ class Column $cellIterator = $this->getCellIterator($startRow, $endRow); $cellIterator->setIterateOnlyExistingCells(true); foreach ($cellIterator as $cell) { - /** @scrutinizer ignore-call */ $value = $cell->getValue(); if ($value === null && $nullValueCellIsEmpty === true) { continue; diff --git a/src/PhpSpreadsheet/Worksheet/Row.php b/src/PhpSpreadsheet/Worksheet/Row.php index eb81eb43b..ae05b0ffa 100644 --- a/src/PhpSpreadsheet/Worksheet/Row.php +++ b/src/PhpSpreadsheet/Worksheet/Row.php @@ -90,7 +90,6 @@ class Row $cellIterator = $this->getCellIterator($startColumn, $endColumn); $cellIterator->setIterateOnlyExistingCells(true); foreach ($cellIterator as $cell) { - /** @scrutinizer ignore-call */ $value = $cell->getValue(); if ($value === null && $nullValueCellIsEmpty === true) { continue; diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index 437cc77da..ae41e0b48 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -2712,7 +2712,7 @@ class Worksheet implements IComparable } elseif ($num > $highRow) { $num -= $numberOfRows; $cloneDimension = clone $rowDimension; - $cloneDimension->setRowIndex(/** @scrutinizer ignore-type */ $num); + $cloneDimension->setRowIndex($num); $holdRowDimensions[$num] = $cloneDimension; } } diff --git a/src/PhpSpreadsheet/Writer/Csv.php b/src/PhpSpreadsheet/Writer/Csv.php index 57685b8d1..d43feda9d 100644 --- a/src/PhpSpreadsheet/Writer/Csv.php +++ b/src/PhpSpreadsheet/Writer/Csv.php @@ -311,6 +311,6 @@ class Csv extends BaseWriter if ($this->outputEncoding != '') { $line = mb_convert_encoding($line, $this->outputEncoding); } - fwrite($fileHandle, /** @scrutinizer ignore-type */ $line); + fwrite($fileHandle, $line); } } diff --git a/src/PhpSpreadsheet/Writer/Xls/Escher.php b/src/PhpSpreadsheet/Writer/Xls/Escher.php index 89e2153d6..ec07a71aa 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Escher.php +++ b/src/PhpSpreadsheet/Writer/Xls/Escher.php @@ -62,10 +62,10 @@ class Escher switch ($this->object::class) { case SharedEscher::class: - if ($dggContainer = $this->object->/** @scrutinizer ignore-call */ getDggContainer()) { + if ($dggContainer = $this->object->getDggContainer()) { $writer = new self($dggContainer); $this->data = $writer->close(); - } elseif ($dgContainer = $this->object->/** @scrutinizer ignore-call */ getDgContainer()) { + } elseif ($dgContainer = $this->object->getDgContainer()) { $writer = new self($dgContainer); $this->data = $writer->close(); $this->spOffsets = $writer->getSpOffsets(); @@ -91,14 +91,13 @@ class Escher $dggData = pack( 'VVVV', - $this->object->/** @scrutinizer ignore-call */ getSpIdMax(), // maximum shape identifier increased by one - $this->object->/** @scrutinizer ignore-call */ getCDgSaved() + 1, // number of file identifier clusters increased by one - $this->object->/** @scrutinizer ignore-call */ getCSpSaved(), - $this->object->/** @scrutinizer ignore-call */ getCDgSaved() // count total number of drawings saved + $this->object->getSpIdMax(), // maximum shape identifier increased by one + $this->object->getCDgSaved() + 1, // number of file identifier clusters increased by one + $this->object->getCSpSaved(), + $this->object->getCDgSaved() // count total number of drawings saved ); // add file identifier clusters (one per drawing) - /** @scrutinizer ignore-call */ $IDCLs = $this->object->getIDCLs(); foreach ($IDCLs as $dgId => $maxReducedSpId) { @@ -109,7 +108,7 @@ class Escher $innerData .= $header . $dggData; // write the bstoreContainer - if ($bstoreContainer = $this->object->/** @scrutinizer ignore-call */ getBstoreContainer()) { + if ($bstoreContainer = $this->object->getBstoreContainer()) { $writer = new self($bstoreContainer); $innerData .= $writer->close(); } @@ -135,7 +134,7 @@ class Escher $innerData = ''; // treat the inner data - if ($BSECollection = $this->object->/** @scrutinizer ignore-call */ getBSECollection()) { + if ($BSECollection = $this->object->getBSECollection()) { foreach ($BSECollection as $BSE) { $writer = new self($BSE); $innerData .= $writer->close(); @@ -144,7 +143,7 @@ class Escher // write the record $recVer = 0xF; - $recInstance = count($this->object->/** @scrutinizer ignore-call */ getBSECollection()); + $recInstance = count($this->object->getBSECollection()); $recType = 0xF001; $length = strlen($innerData); @@ -163,7 +162,7 @@ class Escher $innerData = ''; // here we treat the inner data - if ($blip = $this->object->/** @scrutinizer ignore-call */ getBlip()) { + if ($blip = $this->object->getBlip()) { $writer = new self($blip); $innerData .= $writer->close(); } @@ -171,9 +170,7 @@ class Escher // initialize $data = ''; - /** @scrutinizer ignore-call */ $btWin32 = $this->object->getBlipType(); - /** @scrutinizer ignore-call */ $btMacOS = $this->object->getBlipType(); $data .= pack('CC', $btWin32, $btMacOS); @@ -194,7 +191,6 @@ class Escher // write the record $recVer = 0x2; - /** @scrutinizer ignore-call */ $recInstance = $this->object->getBlipType(); $recType = 0xF007; $length = strlen($data); @@ -213,7 +209,7 @@ class Escher // this is an atom record // write the record - switch ($this->object->/** @scrutinizer ignore-call */ getParent()->/** @scrutinizer ignore-call */ getBlipType()) { + switch ($this->object->getParent()->getBlipType()) { case BSE::BLIPTYPE_JPEG: // initialize $innerData = ''; @@ -224,7 +220,7 @@ class Escher $tag = 0xFF; // todo $innerData .= pack('C', $tag); - $innerData .= $this->object->/** @scrutinizer ignore-call */ getData(); + $innerData .= $this->object->getData(); $recVer = 0x0; $recInstance = 0x46A; @@ -251,7 +247,7 @@ class Escher $tag = 0xFF; // todo $innerData .= pack('C', $tag); - $innerData .= $this->object->/** @scrutinizer ignore-call */ getData(); + $innerData .= $this->object->getData(); $recVer = 0x0; $recInstance = 0x6E0; @@ -279,7 +275,6 @@ class Escher // write the dg $recVer = 0x0; - /** @scrutinizer ignore-call */ $recInstance = $this->object->getDgId(); $recType = 0xF008; $length = 8; @@ -290,11 +285,11 @@ class Escher $header = pack('vvV', $recVerInstance, $recType, $length); // number of shapes in this drawing (including group shape) - $countShapes = count($this->object->/** @scrutinizer ignore-call */ getSpgrContainerOrThrow()->getChildren()); - $innerData .= $header . pack('VV', $countShapes, $this->object->/** @scrutinizer ignore-call */ getLastSpId()); + $countShapes = count($this->object->getSpgrContainerOrThrow()->getChildren()); + $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); // write the spgrContainer - if ($spgrContainer = $this->object->/** @scrutinizer ignore-call */ getSpgrContainer()) { + if ($spgrContainer = $this->object->getSpgrContainer()) { $writer = new self($spgrContainer); $innerData .= $writer->close(); @@ -337,7 +332,7 @@ class Escher $spTypes = []; // treat the inner data - foreach ($this->object->/** @scrutinizer ignore-call */ getChildren() as $spContainer) { + foreach ($this->object->getChildren() as $spContainer) { $writer = new self($spContainer); $spData = $writer->close(); $innerData .= $spData; @@ -372,7 +367,7 @@ class Escher // build the data // write group shape record, if necessary? - if ($this->object->/** @scrutinizer ignore-call */ getSpgr()) { + if ($this->object->getSpgr()) { $recVer = 0x1; $recInstance = 0x0000; $recType = 0xF009; @@ -385,12 +380,10 @@ class Escher $data .= $header . pack('VVVV', 0, 0, 0, 0); } - /** @scrutinizer ignore-call */ $this->spTypes[] = ($this->object->getSpType()); // write the shape record $recVer = 0x2; - /** @scrutinizer ignore-call */ $recInstance = $this->object->getSpType(); // shape type $recType = 0xF00A; $length = 0x00000008; @@ -400,16 +393,16 @@ class Escher $header = pack('vvV', $recVerInstance, $recType, $length); - $data .= $header . pack('VV', $this->object->/** @scrutinizer ignore-call */ getSpId(), $this->object->/** @scrutinizer ignore-call */ getSpgr() ? 0x0005 : 0x0A00); + $data .= $header . pack('VV', $this->object->getSpId(), $this->object->getSpgr() ? 0x0005 : 0x0A00); // the options - if ($this->object->/** @scrutinizer ignore-call */ getOPTCollection()) { + if ($this->object->getOPTCollection()) { $optData = ''; $recVer = 0x3; - $recInstance = count($this->object->/** @scrutinizer ignore-call */ getOPTCollection()); + $recInstance = count($this->object->getOPTCollection()); $recType = 0xF00B; - foreach ($this->object->/** @scrutinizer ignore-call */ getOPTCollection() as $property => $value) { + foreach ($this->object->getOPTCollection() as $property => $value) { $optData .= pack('vV', $property, $value); } $length = strlen($optData); @@ -422,38 +415,34 @@ class Escher } // the client anchor - if ($this->object->/** @scrutinizer ignore-call */ getStartCoordinates()) { + if ($this->object->getStartCoordinates()) { $recVer = 0x0; $recInstance = 0x0; $recType = 0xF010; // start coordinates - [$column, $row] = Coordinate::indexesFromString($this->object->/** @scrutinizer ignore-call */ getStartCoordinates()); + [$column, $row] = Coordinate::indexesFromString($this->object->getStartCoordinates()); $c1 = $column - 1; $r1 = $row - 1; // start offsetX - /** @scrutinizer ignore-call */ $startOffsetX = $this->object->getStartOffsetX(); // start offsetY - /** @scrutinizer ignore-call */ $startOffsetY = $this->object->getStartOffsetY(); // end coordinates - [$column, $row] = Coordinate::indexesFromString($this->object->/** @scrutinizer ignore-call */ getEndCoordinates()); + [$column, $row] = Coordinate::indexesFromString($this->object->getEndCoordinates()); $c2 = $column - 1; $r2 = $row - 1; // end offsetX - /** @scrutinizer ignore-call */ $endOffsetX = $this->object->getEndOffsetX(); // end offsetY - /** @scrutinizer ignore-call */ $endOffsetY = $this->object->getEndOffsetY(); - $clientAnchorData = pack('vvvvvvvvv', $this->object->/** @scrutinizer ignore-call */ getSpFlag(), $c1, $startOffsetX, $r1, $startOffsetY, $c2, $endOffsetX, $r2, $endOffsetY); + $clientAnchorData = pack('vvvvvvvvv', $this->object->getSpFlag(), $c1, $startOffsetX, $r1, $startOffsetY, $c2, $endOffsetX, $r2, $endOffsetY); $length = strlen($clientAnchorData); @@ -465,7 +454,7 @@ class Escher } // the client data, just empty for now - if (!$this->object->/** @scrutinizer ignore-call */ getSpgr()) { + if (!$this->object->getSpgr()) { $clientDataData = ''; $recVer = 0x0; diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php index 22c2c78b0..db07ca0c3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php @@ -33,7 +33,7 @@ class CalculationFunctionListTest extends TestCase /** * @dataProvider providerGetFunctions */ - public function testGetFunctions(/** @scrutinizer ignore-unused */ string $category, array|string $functionCall): void + public function testGetFunctions(string $category, array|string $functionCall): void { self::assertIsCallable($functionCall); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php index 6df36d1f9..edee0db08 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php @@ -60,7 +60,6 @@ class DateValueTest extends TestCase $expectedResult = $this->parseTemplatedExpectation($expectedResult); } - /** @scrutinizer ignore-call */ $result = DateValue::fromString(...$args); self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php index 6270ac088..c439d0375 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php @@ -35,7 +35,6 @@ class DayTest extends TestCase */ public function testDirectCallToDAY(mixed $expectedResultExcel, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = DateParts::day(...$args); self::assertSame($expectedResultExcel, $result); } @@ -86,7 +85,6 @@ class DayTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = DateParts::day(...$args); self::assertSame($expectedResultOpenOffice, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php index 3e7881057..cf78f294c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php @@ -23,7 +23,6 @@ class Days360Test extends TestCase */ public function testDirectCallToDAYS360(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Days360::between(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php index 68781ffd0..c787aed98 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php @@ -18,7 +18,6 @@ class HourTest extends TestCase */ public function testDirectCallToHOUR(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = TimeParts::hour(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php index 7aee56b9a..b66fab6ab 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php @@ -35,7 +35,6 @@ class IsoWeekNumTest extends TestCase */ public function testDirectCallToISOWEEKNUM(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Week::isoWeekNumber(...$args); self::assertSame($expectedResult, $result); } @@ -114,7 +113,6 @@ class IsoWeekNumTest extends TestCase { SharedDate::setExcelCalendar(SharedDate::CALENDAR_MAC_1904); - /** @scrutinizer ignore-call */ $result = Week::isoWeekNumber(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php index 3c987452b..4e354faa2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php @@ -18,7 +18,6 @@ class MinuteTest extends TestCase */ public function testDirectCallToMINUTE(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = TimeParts::MINUTE(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php index fdb91fff2..d3434d1d9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php @@ -18,7 +18,6 @@ class MonthTest extends TestCase */ public function testDirectCallToMONTH(mixed $expectedResultExcel, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = DateParts::month(...$args); self::assertSame($expectedResultExcel, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MovedFunctionsTest.php index 9aba4adef..9843d145d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MovedFunctionsTest.php @@ -21,30 +21,30 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertTrue(/** @scrutinizer ignore-deprecated */ DateTime::isLeapYear(1904)); - self::assertSame('#VALUE!', /** @scrutinizer ignore-deprecated */ DateTime::getDateValue('XYZ')); - self::assertSame(61.0, /** @scrutinizer ignore-deprecated */ DateTime::getDateValue('1900-03-01')); - self::assertSame(61.0, /** @scrutinizer ignore-deprecated */ DateTime::DATE(1900, 3, 1)); - self::assertSame(365, /** @scrutinizer ignore-deprecated */ DateTime::DATEDIF('2016-01-01', '2016-12-31', 'YD')); - self::assertSame(61.0, /** @scrutinizer ignore-deprecated */ DateTime::DATEVALUE('1900-03-01')); - self::assertSame(28, /** @scrutinizer ignore-deprecated */ DateTime::DAYOFMONTH('1904-02-28')); - self::assertSame(364, /** @scrutinizer ignore-deprecated */ DateTime::DAYS('2007-12-31', '2007-1-1')); - self::assertSame(9, /** @scrutinizer ignore-deprecated */ DateTime::DAYS360('2007-1-1', '2007-1-10', false)); - self::assertSame(39493.0, /** @scrutinizer ignore-deprecated */ DateTime::EDATE('15-Jan-2008', 1)); - self::assertSame(39507.0, /** @scrutinizer ignore-deprecated */ DateTime::EOMONTH('15-Jan-2008', 1)); - self::assertSame(18, /** @scrutinizer ignore-deprecated */ DateTime::HOUROFDAY(0.75)); - self::assertSame(52, /** @scrutinizer ignore-deprecated */ DateTime::ISOWEEKNUM('2000-01-01')); - self::assertSame(24, /** @scrutinizer ignore-deprecated */ DateTime::MINUTE(0.6)); - self::assertSame(11, /** @scrutinizer ignore-deprecated */ DateTime::MONTHOFYEAR('11-Nov-1918')); - self::assertSame(8, /** @scrutinizer ignore-deprecated */ DateTime::NETWORKDAYS('1-Jan-2007', '10-Jan-2007')); - self::assertSame(35, /** @scrutinizer ignore-deprecated */ DateTime::SECOND('11:15:35')); - self::assertSame(0.5, /** @scrutinizer ignore-deprecated */ DateTime::TIME(12, 0, 0)); - self::assertSame(0.40625, /** @scrutinizer ignore-deprecated */ DateTime::TIMEVALUE('33:45')); - self::assertSame(5, /** @scrutinizer ignore-deprecated */ DateTime::WEEKDAY('24-Oct-1968')); - self::assertSame(52, /** @scrutinizer ignore-deprecated */ DateTime::WEEKNUM('21-Dec-2000')); - self::assertSame(39094.0, /** @scrutinizer ignore-deprecated */ DateTime::WORKDAY('1-Jan-2007', 9)); - self::assertSame(1904, /** @scrutinizer ignore-deprecated */ DateTime::YEAR('1904-02-28')); - self::assertSame(0.025, /** @scrutinizer ignore-deprecated */ DateTime::YEARFRAC('2007-01-10', '2007-01-01', 0)); + self::assertTrue(DateTime::isLeapYear(1904)); + self::assertSame('#VALUE!', DateTime::getDateValue('XYZ')); + self::assertSame(61.0, DateTime::getDateValue('1900-03-01')); + self::assertSame(61.0, DateTime::DATE(1900, 3, 1)); + self::assertSame(365, DateTime::DATEDIF('2016-01-01', '2016-12-31', 'YD')); + self::assertSame(61.0, DateTime::DATEVALUE('1900-03-01')); + self::assertSame(28, DateTime::DAYOFMONTH('1904-02-28')); + self::assertSame(364, DateTime::DAYS('2007-12-31', '2007-1-1')); + self::assertSame(9, DateTime::DAYS360('2007-1-1', '2007-1-10', false)); + self::assertSame(39493.0, DateTime::EDATE('15-Jan-2008', 1)); + self::assertSame(39507.0, DateTime::EOMONTH('15-Jan-2008', 1)); + self::assertSame(18, DateTime::HOUROFDAY(0.75)); + self::assertSame(52, DateTime::ISOWEEKNUM('2000-01-01')); + self::assertSame(24, DateTime::MINUTE(0.6)); + self::assertSame(11, DateTime::MONTHOFYEAR('11-Nov-1918')); + self::assertSame(8, DateTime::NETWORKDAYS('1-Jan-2007', '10-Jan-2007')); + self::assertSame(35, DateTime::SECOND('11:15:35')); + self::assertSame(0.5, DateTime::TIME(12, 0, 0)); + self::assertSame(0.40625, DateTime::TIMEVALUE('33:45')); + self::assertSame(5, DateTime::WEEKDAY('24-Oct-1968')); + self::assertSame(52, DateTime::WEEKNUM('21-Dec-2000')); + self::assertSame(39094.0, DateTime::WORKDAY('1-Jan-2007', 9)); + self::assertSame(1904, DateTime::YEAR('1904-02-28')); + self::assertSame(0.025, DateTime::YEARFRAC('2007-01-10', '2007-01-01', 0)); } public function testTodayAndNow(): void @@ -54,11 +54,11 @@ class MovedFunctionsTest extends TestCase do { $dtStart = new DateTimeImmutable(); $startSecond = $dtStart->format('s'); - $nowResult = /** @scrutinizer ignore-deprecated */ DateTime::DATETIMENOW(); - $todayResult = /** @scrutinizer ignore-deprecated */ DateTime::DATENOW(); + $nowResult = DateTime::DATETIMENOW(); + $todayResult = DateTime::DATENOW(); $dtEnd = new DateTimeImmutable(); $endSecond = $dtEnd->format('s'); } while ($startSecond !== $endSecond); - self::assertSame(/** @scrutinizer ignore-deprecated */ DateTime::DAYOFMONTH($nowResult), /** @scrutinizer ignore-deprecated */ DateTime::DAYOFMONTH($todayResult)); + self::assertSame(DateTime::DAYOFMONTH($nowResult), DateTime::DAYOFMONTH($todayResult)); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php index f440ecaef..72f9ccb60 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php @@ -17,7 +17,6 @@ class SecondTest extends TestCase */ public function testDirectCallToSECOND(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = TimeParts::second(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php index f188c1408..aca549142 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php @@ -35,7 +35,6 @@ class TimeValueTest extends TestCase */ public function testDirectCallToTIMEVALUE(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = TimeValue::fromString(...$args); self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php index cf487bfd0..a29dd09a1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php @@ -34,7 +34,6 @@ class WeekDayTest extends TestCase */ public function testDirectCallToWEEKDAY(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Week::day(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php index 555418ade..bff6ec619 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php @@ -35,7 +35,6 @@ class WeekNumTest extends TestCase */ public function testDirectCallToWEEKNUM(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Week::number(...$args); self::assertSame($expectedResult, $result); } @@ -114,7 +113,6 @@ class WeekNumTest extends TestCase { SharedDate::setExcelCalendar(SharedDate::CALENDAR_MAC_1904); - /** @scrutinizer ignore-call */ $result = Week::number(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php index e913a5619..6234900e5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php @@ -17,7 +17,6 @@ class YearTest extends TestCase */ public function testDirectCallToYEAR(mixed $expectedResultExcel, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = DateParts::year(...$args); self::assertSame($expectedResultExcel, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php index 28589bcdd..0577a341a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php @@ -32,7 +32,6 @@ class Bin2DecTest extends TestCase */ public function testDirectCallToBIN2DEC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertBinary::toDecimal(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Bin2DecTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertBinary::toDecimal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php index 45fb5de85..2ed3ed21f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php @@ -32,7 +32,6 @@ class Bin2HexTest extends TestCase */ public function testDirectCallToBIN2HEX(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertBinary::toHex(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Bin2HexTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertBinary::toDecimal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php index ecc6a033c..b15bbd3eb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php @@ -32,7 +32,6 @@ class Bin2OctTest extends TestCase */ public function testDirectCallToBIN2OCT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertBinary::toOctal(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Bin2OctTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertBinary::toDecimal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php index 93e2352f6..75dc792bf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php @@ -17,7 +17,6 @@ class ComplexTest extends TestCase */ public function testDirectCallToCOMPLEX(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Complex::complex(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php index 02212732f..13f74b353 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php @@ -31,7 +31,6 @@ class Dec2BinTest extends TestCase */ public function testDirectCallToDEC2BIN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toBinary(...$args); self::assertSame($expectedResult, $result); } @@ -115,7 +114,6 @@ class Dec2BinTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toBinary(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php index 3ea9ad782..7529d2782 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php @@ -31,7 +31,6 @@ class Dec2HexTest extends TestCase */ public function testDirectCallToDEC2HEX(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toHex(...$args); self::assertSame($expectedResult, $result); } @@ -115,7 +114,6 @@ class Dec2HexTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toHex(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php index 869b5b9a4..42252f5c7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php @@ -31,7 +31,6 @@ class Dec2OctTest extends TestCase */ public function testDirectCallToDEC2OCT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toOctal(...$args); self::assertSame($expectedResult, $result); } @@ -115,7 +114,6 @@ class Dec2OctTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertDecimal::toOctal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php index 6824a5e42..72c9ce4f6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php @@ -18,7 +18,6 @@ class DeltaTest extends TestCase */ public function testDirectCallToDELTA(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Compare::delta(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php index fa163bce6..515fe9e8f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php @@ -20,7 +20,6 @@ class ErfCTest extends TestCase */ public function testDirectCallToERFC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ErfC::ERFC(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php index 0f144bcdd..edc59284a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php @@ -19,7 +19,6 @@ class ErfPreciseTest extends TestCase */ public function testDirectCallToERFPRECISE(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Erf::ERFPRECISE(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php index b5c7c6384..e9d239238 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php @@ -20,7 +20,6 @@ class ErfTest extends TestCase */ public function testDirectCallToERF(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Erf::erf(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php index 768cc7129..dbf6c9c17 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php @@ -18,7 +18,6 @@ class GeStepTest extends TestCase */ public function testDirectCallToGESTEP(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Compare::geStep(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php index fca419fe6..4a3ee2558 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php @@ -32,7 +32,6 @@ class Hex2BinTest extends TestCase */ public function testDirectCallToHEX2BIN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertHex::toBinary(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Hex2BinTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertHex::toBinary(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php index d3822810f..ba0d5f8d0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php @@ -32,7 +32,6 @@ class Hex2DecTest extends TestCase */ public function testDirectCallToHEX2DEC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertHex::toDecimal(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Hex2DecTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertHex::toDecimal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php index b227f4872..4486271dd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php @@ -32,7 +32,6 @@ class Hex2OctTest extends TestCase */ public function testDirectCallToHEX2OCT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertHex::toOctal(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Hex2OctTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertHex::toOctal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php index ac879162c..8b76473a8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php @@ -20,7 +20,6 @@ class ImAbsTest extends TestCase */ public function testDirectCallToIMABS(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMABS(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php index ef8c2dde6..885a79280 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php @@ -26,7 +26,6 @@ class ImArgumentTest extends TestCase */ public function testDirectCallToIMARGUMENT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMARGUMENT(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php index a944227f4..f09e97ca7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php @@ -30,7 +30,6 @@ class ImConjugateTest extends TestCase */ public function testDirectCallToIMCONJUGATE(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCONJUGATE(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php index 26f721d68..6c7858636 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php @@ -30,7 +30,6 @@ class ImCosTest extends TestCase */ public function testDirectCallToIMCOS(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCOS(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php index a23fd7a04..cb4afbb53 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php @@ -30,7 +30,6 @@ class ImCoshTest extends TestCase */ public function testDirectCallToIMCOSH(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCOSH(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php index a79fb2f75..8237fa162 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php @@ -30,7 +30,6 @@ class ImCotTest extends TestCase */ public function testDirectCallToIMCOT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCOT(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php index 0e469566d..3c9d524eb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php @@ -30,7 +30,6 @@ class ImCscTest extends TestCase */ public function testDirectCallToIMCSC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCSC(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php index 57765ca6e..9d333cdfd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php @@ -30,7 +30,6 @@ class ImCschTest extends TestCase */ public function testDirectCallToIMCSCH(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMCSCH(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php index 635b566f5..6e6eee44a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php @@ -30,7 +30,6 @@ class ImDivTest extends TestCase */ public function testDirectCallToIMDIV(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexOperations::IMDIV(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php index 53d08ab6f..504f0ad85 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php @@ -30,7 +30,6 @@ class ImExpTest extends TestCase */ public function testDirectCallToIMEXP(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMEXP(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php index 9c4448b66..aa2b78bee 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php @@ -30,7 +30,6 @@ class ImLnTest extends TestCase */ public function testDirectCallToIMLN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMLN(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php index 7d0042999..12a9abf9b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php @@ -30,7 +30,6 @@ class ImLog10Test extends TestCase */ public function testDirectCallToIMLOG10(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMLOG10(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php index 19ed1c622..d6f79885c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php @@ -30,7 +30,6 @@ class ImLog2Test extends TestCase */ public function testDirectCallToIMLOG2(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMLOG2(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php index f4f80ee9e..276c6a95b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php @@ -30,7 +30,6 @@ class ImPowerTest extends TestCase */ public function testDirectCallToIMPOWER(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMPOWER(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php index 472cb7868..bf71c4556 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php @@ -30,7 +30,6 @@ class ImProductTest extends TestCase */ public function testDirectCallToIMPRODUCT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexOperations::IMPRODUCT(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php index 185073c35..8e69951a0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php @@ -26,7 +26,6 @@ class ImRealTest extends TestCase */ public function testDirectCallToIMREAL(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Complex::IMREAL(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php index 5a432cb8c..0bdb72e78 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php @@ -30,7 +30,6 @@ class ImSecTest extends TestCase */ public function testDirectCallToIMSEC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMSEC(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php index cc62f3114..ec4e55ac8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php @@ -30,7 +30,6 @@ class ImSechTest extends TestCase */ public function testDirectCallToIMSECH(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMSECH(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php index 678229d81..702398f44 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php @@ -30,7 +30,6 @@ class ImSinTest extends TestCase */ public function testDirectCallToIMSIN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMSIN(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php index 19fc93e7b..e200e38ce 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php @@ -30,7 +30,6 @@ class ImSinhTest extends TestCase */ public function testDirectCallToIMSINH(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMSINH(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php index c93918cdc..890fe480e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php @@ -30,7 +30,6 @@ class ImSqrtTest extends TestCase */ public function testDirectCallToIMSQRT(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMSQRT(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php index 4457dc60d..f33ec5e3a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php @@ -30,7 +30,6 @@ class ImSubTest extends TestCase */ public function testDirectCallToIMSUB(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexOperations::IMSUB(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php index 0dd9a1e0f..66508b99a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php @@ -30,7 +30,6 @@ class ImSumTest extends TestCase */ public function testDirectCallToIMSUM(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexOperations::IMSUM(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php index 1ed1b1934..15cb1298f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php @@ -30,7 +30,6 @@ class ImTanTest extends TestCase */ public function testDirectCallToIMTAN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ComplexFunctions::IMTAN(...$args); self::assertTrue( $this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION), diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php index 3f4e55b54..af26adf14 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php @@ -26,7 +26,6 @@ class ImaginaryTest extends TestCase */ public function testDirectCallToIMAGINARY(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = Complex::IMAGINARY(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedBitwiseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedBitwiseTest.php index 2a0652a28..28b2137d6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedBitwiseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedBitwiseTest.php @@ -17,10 +17,10 @@ class MovedBitwiseTest extends TestCase { public function testMovedFunctions(): void { - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ Engineering::BITAND(1, 3)); - self::assertEquals(3, /** @scrutinizer ignore-deprecated */ Engineering::BITOR(1, 3)); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ Engineering::BITXOR(1, 3)); - self::assertEquals(32, /** @scrutinizer ignore-deprecated */ Engineering::BITLSHIFT(8, 2)); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ Engineering::BITRSHIFT(8, 2)); + self::assertEquals(1, Engineering::BITAND(1, 3)); + self::assertEquals(3, Engineering::BITOR(1, 3)); + self::assertEquals(2, Engineering::BITXOR(1, 3)); + self::assertEquals(32, Engineering::BITLSHIFT(8, 2)); + self::assertEquals(2, Engineering::BITRSHIFT(8, 2)); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedFunctionsTest.php index f68ea1f2a..66120157d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/MovedFunctionsTest.php @@ -18,73 +18,73 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertEquals(178, /** @scrutinizer ignore-deprecated */ Engineering::BINTODEC(10110010)); - self::assertEquals('B2', /** @scrutinizer ignore-deprecated */ Engineering::BINTOHEX(10110010)); - self::assertEquals(144, /** @scrutinizer ignore-deprecated */ Engineering::BINTOOCT(1100100)); - self::assertEquals(101100101, /** @scrutinizer ignore-deprecated */ Engineering::DECTOBIN(357)); - self::assertEquals(165, /** @scrutinizer ignore-deprecated */ Engineering::DECTOHEX(357)); - self::assertEquals(545, /** @scrutinizer ignore-deprecated */ Engineering::DECTOOCT(357)); - self::assertEquals(1100100, /** @scrutinizer ignore-deprecated */ Engineering::HEXTOBIN(64)); - self::assertEquals(357, /** @scrutinizer ignore-deprecated */ Engineering::HEXTODEC(165)); - self::assertEquals(653, /** @scrutinizer ignore-deprecated */ Engineering::HEXTOOCT('01AB')); - self::assertEquals(1100100, /** @scrutinizer ignore-deprecated */ Engineering::OCTTOBIN(144)); - self::assertEquals(357, /** @scrutinizer ignore-deprecated */ Engineering::OCTTODEC(545)); - self::assertEquals('1AB', /** @scrutinizer ignore-deprecated */ Engineering::OCTTOHEX(653)); + self::assertEquals(178, Engineering::BINTODEC(10110010)); + self::assertEquals('B2', Engineering::BINTOHEX(10110010)); + self::assertEquals(144, Engineering::BINTOOCT(1100100)); + self::assertEquals(101100101, Engineering::DECTOBIN(357)); + self::assertEquals(165, Engineering::DECTOHEX(357)); + self::assertEquals(545, Engineering::DECTOOCT(357)); + self::assertEquals(1100100, Engineering::HEXTOBIN(64)); + self::assertEquals(357, Engineering::HEXTODEC(165)); + self::assertEquals(653, Engineering::HEXTOOCT('01AB')); + self::assertEquals(1100100, Engineering::OCTTOBIN(144)); + self::assertEquals(357, Engineering::OCTTODEC(545)); + self::assertEquals('1AB', Engineering::OCTTOHEX(653)); } public function testOthers(): void { - self::assertEqualsWithDelta(30596.33413506702, /** @scrutinizer ignore-deprecated */ Engineering::BESSELI(-12.5, 0), 1E-8); - self::assertEqualsWithDelta(0.146884054700421, /** @scrutinizer ignore-deprecated */ Engineering::BESSELJ(-12.5, 0), 1E-8); - self::assertEqualsWithDelta(2.20786908479938, /** @scrutinizer ignore-deprecated */ Engineering::BESSELK(0.125, 0), 1E-8); - self::assertEqualsWithDelta(-1.38968063456627, /** @scrutinizer ignore-deprecated */ Engineering::BESSELY(0.125, 0), 1E-8); - self::assertEqualsWithDelta(0.0, /** @scrutinizer ignore-deprecated */ Engineering::DELTA(-0.75, -1.5), 1E-8); - self::assertEqualsWithDelta(0.0112834155558496, /** @scrutinizer ignore-deprecated */ Engineering::ERF(0.01), 1E-8); - self::assertEqualsWithDelta(0.98871658444415, /** @scrutinizer ignore-deprecated */ Engineering::ERFC(0.01), 1E-8); - self::assertEqualsWithDelta(0.0112834155558496, /** @scrutinizer ignore-deprecated */ Engineering::ERFPRECISE(0.01), 1E-8); - self::assertEqualsWithDelta(1.0, /** @scrutinizer ignore-deprecated */ Engineering::GESTEP(-0.75, -1.5), 1E-8); + self::assertEqualsWithDelta(30596.33413506702, Engineering::BESSELI(-12.5, 0), 1E-8); + self::assertEqualsWithDelta(0.146884054700421, Engineering::BESSELJ(-12.5, 0), 1E-8); + self::assertEqualsWithDelta(2.20786908479938, Engineering::BESSELK(0.125, 0), 1E-8); + self::assertEqualsWithDelta(-1.38968063456627, Engineering::BESSELY(0.125, 0), 1E-8); + self::assertEqualsWithDelta(0.0, Engineering::DELTA(-0.75, -1.5), 1E-8); + self::assertEqualsWithDelta(0.0112834155558496, Engineering::ERF(0.01), 1E-8); + self::assertEqualsWithDelta(0.98871658444415, Engineering::ERFC(0.01), 1E-8); + self::assertEqualsWithDelta(0.0112834155558496, Engineering::ERFPRECISE(0.01), 1E-8); + self::assertEqualsWithDelta(1.0, Engineering::GESTEP(-0.75, -1.5), 1E-8); } public function testConversions(): void { - self::assertEqualsWithDelta(1.942559385723E-03, /** @scrutinizer ignore-deprecated */ Engineering::CONVERTUOM(1.0, 'ozm', 'sg'), 1E-8); - self::assertContains('Temperature', /** @scrutinizer ignore-deprecated */ Engineering::getConversionGroups()); - self::assertArrayHasKey('Weight and Mass', /** @scrutinizer ignore-deprecated */ Engineering::getConversionGroupUnits()); - self::assertEquals('Degrees Celsius', /** @scrutinizer ignore-deprecated */ Engineering::getConversionGroupUnitDetails('Temperature')['Temperature'][0]['description']); - self::assertEquals('yotta', /** @scrutinizer ignore-deprecated */ Engineering::getConversionMultipliers()['Y']['name']); - self::assertEquals(1024, /** @scrutinizer ignore-deprecated */ Engineering::getBinaryConversionMultipliers()['ki']['multiplier']); + self::assertEqualsWithDelta(1.942559385723E-03, Engineering::CONVERTUOM(1.0, 'ozm', 'sg'), 1E-8); + self::assertContains('Temperature', Engineering::getConversionGroups()); + self::assertArrayHasKey('Weight and Mass', Engineering::getConversionGroupUnits()); + self::assertEquals('Degrees Celsius', Engineering::getConversionGroupUnitDetails('Temperature')['Temperature'][0]['description']); + self::assertEquals('yotta', Engineering::getConversionMultipliers()['Y']['name']); + self::assertEquals(1024, Engineering::getBinaryConversionMultipliers()['ki']['multiplier']); } public function testImaginary(): void { $complexAssert = new ComplexAssert(); $complexAssert->setDelta(1.0E-8); - self::assertSame('3+4i', /** @scrutinizer ignore-deprecated */ Engineering::COMPLEX(3, 4)); - self::assertEqualsWithDelta(5.67, /** @scrutinizer ignore-deprecated */ Engineering::IMAGINARY('12.34+5.67j'), 1E-8); - self::assertEqualsWithDelta(12.34, /** @scrutinizer ignore-deprecated */ Engineering::IMREAL('12.34+5.67j'), 1E-8); - self::assertEqualsWithDelta(13.58029822942, /** @scrutinizer ignore-deprecated */ Engineering::IMABS('12.34+5.67j'), 1E-8); - self::assertEqualsWithDelta(0.43071059555, /** @scrutinizer ignore-deprecated */ Engineering::IMARGUMENT('12.34+5.67j'), 1E-8); - $complexAssert->runAssertComplexEquals('12.34-5.67j', /** @scrutinizer ignore-deprecated */ Engineering::IMCONJUGATE('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('141.319179436356+32.547610312508j', /** @scrutinizer ignore-deprecated */ Engineering::IMCOS('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('93502.0563713182121-65794.6618967782119j', /** @scrutinizer ignore-deprecated */ Engineering::IMCOSH('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('93502.0563713182121-65794.6618967782119j', /** @scrutinizer ignore-deprecated */ Engineering::IMCOSH('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('-0.0000104004141424230319-1.00002138037057154j', /** @scrutinizer ignore-deprecated */ Engineering::IMCOT('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('-0.00154774455592154432-0.00671986631601416928j', /** @scrutinizer ignore-deprecated */ Engineering::IMCSC('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('7.15308425027293823E-6+5.03341614148979354E-6j', /** @scrutinizer ignore-deprecated */ Engineering::IMCSCH('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('0.0961415519586104-0.00694248653276682j', /** @scrutinizer ignore-deprecated */ Engineering::IMDIV('12.34+5.67j', '123.45+67.89j')); - $complexAssert->runAssertComplexEquals('187004.11273906-131589.323796073j', /** @scrutinizer ignore-deprecated */ Engineering::IMEXP('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('2.60862008281875+0.430710595550204j', /** @scrutinizer ignore-deprecated */ Engineering::IMLN('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('3.76344325733562+0.621384040306436j', /** @scrutinizer ignore-deprecated */ Engineering::IMLOG2('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('1.13290930735019+0.187055234944717j', /** @scrutinizer ignore-deprecated */ Engineering::IMLOG10('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('120.1267+139.9356j', /** @scrutinizer ignore-deprecated */ Engineering::IMPOWER('12.34+5.67j', 2)); - $complexAssert->runAssertComplexEquals('6454.936089+8718.895647i', /** @scrutinizer ignore-deprecated */ Engineering::IMPRODUCT('12.34+5.67i', '123.45+67.89i', '5.67')); - $complexAssert->runAssertComplexEquals('0.00671973874162309199-0.00154764157870523791j', /** @scrutinizer ignore-deprecated */ Engineering::IMSEC('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('7.15308425036177674E-6+5.03341614116724074E-6j', /** @scrutinizer ignore-deprecated */ Engineering::IMSECH('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('-32.5483841590412+141.315819535092j', /** @scrutinizer ignore-deprecated */ Engineering::IMSIN('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('93502.0563677416700-65794.6618992949199j', /** @scrutinizer ignore-deprecated */ Engineering::IMSINH('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('3.60002071031685+0.787495469644252j', /** @scrutinizer ignore-deprecated */ Engineering::IMSQRT('12.34+5.67j')); - $complexAssert->runAssertComplexEquals('-111.11-62.22j', /** @scrutinizer ignore-deprecated */ Engineering::IMSUB('12.34+5.67j', '123.45+67.89j')); - $complexAssert->runAssertComplexEquals('135.79+73.56j', /** @scrutinizer ignore-deprecated */ Engineering::IMSUM('12.34+5.67j', '123.45+67.89j')); - $complexAssert->runAssertComplexEquals('-0.0000103999694261435177+0.999978619978377253j', /** @scrutinizer ignore-deprecated */ Engineering::IMTAN('12.34+5.67j')); + self::assertSame('3+4i', Engineering::COMPLEX(3, 4)); + self::assertEqualsWithDelta(5.67, Engineering::IMAGINARY('12.34+5.67j'), 1E-8); + self::assertEqualsWithDelta(12.34, Engineering::IMREAL('12.34+5.67j'), 1E-8); + self::assertEqualsWithDelta(13.58029822942, Engineering::IMABS('12.34+5.67j'), 1E-8); + self::assertEqualsWithDelta(0.43071059555, Engineering::IMARGUMENT('12.34+5.67j'), 1E-8); + $complexAssert->runAssertComplexEquals('12.34-5.67j', Engineering::IMCONJUGATE('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('141.319179436356+32.547610312508j', Engineering::IMCOS('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('93502.0563713182121-65794.6618967782119j', Engineering::IMCOSH('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('93502.0563713182121-65794.6618967782119j', Engineering::IMCOSH('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('-0.0000104004141424230319-1.00002138037057154j', Engineering::IMCOT('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('-0.00154774455592154432-0.00671986631601416928j', Engineering::IMCSC('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('7.15308425027293823E-6+5.03341614148979354E-6j', Engineering::IMCSCH('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('0.0961415519586104-0.00694248653276682j', Engineering::IMDIV('12.34+5.67j', '123.45+67.89j')); + $complexAssert->runAssertComplexEquals('187004.11273906-131589.323796073j', Engineering::IMEXP('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('2.60862008281875+0.430710595550204j', Engineering::IMLN('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('3.76344325733562+0.621384040306436j', Engineering::IMLOG2('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('1.13290930735019+0.187055234944717j', Engineering::IMLOG10('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('120.1267+139.9356j', Engineering::IMPOWER('12.34+5.67j', 2)); + $complexAssert->runAssertComplexEquals('6454.936089+8718.895647i', Engineering::IMPRODUCT('12.34+5.67i', '123.45+67.89i', '5.67')); + $complexAssert->runAssertComplexEquals('0.00671973874162309199-0.00154764157870523791j', Engineering::IMSEC('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('7.15308425036177674E-6+5.03341614116724074E-6j', Engineering::IMSECH('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('-32.5483841590412+141.315819535092j', Engineering::IMSIN('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('93502.0563677416700-65794.6618992949199j', Engineering::IMSINH('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('3.60002071031685+0.787495469644252j', Engineering::IMSQRT('12.34+5.67j')); + $complexAssert->runAssertComplexEquals('-111.11-62.22j', Engineering::IMSUB('12.34+5.67j', '123.45+67.89j')); + $complexAssert->runAssertComplexEquals('135.79+73.56j', Engineering::IMSUM('12.34+5.67j', '123.45+67.89j')); + $complexAssert->runAssertComplexEquals('-0.0000103999694261435177+0.999978619978377253j', Engineering::IMTAN('12.34+5.67j')); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php index fe0953d23..aee679ff4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php @@ -32,7 +32,6 @@ class Oct2BinTest extends TestCase */ public function testDirectCallToOCT2BIN(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertOctal::toBinary(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Oct2BinTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertOctal::toBinary(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php index c1e02fbc7..04412a190 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php @@ -32,7 +32,6 @@ class Oct2DecTest extends TestCase */ public function testDirectCallToOCT2DEC(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertOctal::toDecimal(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Oct2DecTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertOctal::toDecimal(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php index 1a43a4994..badafdf87 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php @@ -32,7 +32,6 @@ class Oct2HexTest extends TestCase */ public function testDirectCallToOCT2HEX(mixed $expectedResult, mixed ...$args): void { - /** @scrutinizer ignore-call */ $result = ConvertOctal::toHex(...$args); self::assertSame($expectedResult, $result); } @@ -116,7 +115,6 @@ class Oct2HexTest extends TestCase { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); - /** @scrutinizer ignore-call */ $result = ConvertOctal::toHex(...$args); self::assertSame($expectedResult, $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MovedFunctionsTest.php index e23def856..ced127a05 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MovedFunctionsTest.php @@ -18,52 +18,52 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertEqualsWithDelta(16.6666666666666, /** @scrutinizer ignore-deprecated */ Financial::ACCRINT('2008-03-01', '2008-08-31', '2008-05-01', 0.10, 1000, 2, 0), 1E-8); - self::assertEqualsWithDelta(20.547945205478999, /** @scrutinizer ignore-deprecated */ Financial::ACCRINTM('2008-04-01', '2008-06-15', 0.10, 1000, 3), 1E-8); - self::assertEqualsWithDelta(776, /** @scrutinizer ignore-deprecated */ Financial::AMORDEGRC(2400, '2008-08-19', '2008-12-31', 300, 1, 0.15, 1), 1E-8); - self::assertEqualsWithDelta(360, /** @scrutinizer ignore-deprecated */ Financial::AMORLINC(2400, '2008-08-19', '2008-12-31', 300, 1, 0.15, 1), 1E-8); - self::assertEqualsWithDelta(71, /** @scrutinizer ignore-deprecated */ Financial::COUPDAYBS('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(181, /** @scrutinizer ignore-deprecated */ Financial::COUPDAYS('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(110, /** @scrutinizer ignore-deprecated */ Financial::COUPDAYSNC('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(39217, /** @scrutinizer ignore-deprecated */ Financial::COUPNCD('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(4, /** @scrutinizer ignore-deprecated */ Financial::COUPNUM('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(39036, /** @scrutinizer ignore-deprecated */ Financial::COUPPCD('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); - self::assertEqualsWithDelta(-11135.232130750999, /** @scrutinizer ignore-deprecated */ Financial::CUMIPMT(0.0075, 360, 125000, 13, 24, 0), 1E-8); - self::assertEqualsWithDelta(-934.10712342088004, /** @scrutinizer ignore-deprecated */ Financial::CUMPRINC(0.0075, 360, 125000, 13, 24, 0), 1E-8); - self::assertEqualsWithDelta(186083.3333333334, /** @scrutinizer ignore-deprecated */ Financial::DB(1000000, 100000, 6, 1, 7), 1E-8); - self::assertEqualsWithDelta(0.13150684931507001, /** @scrutinizer ignore-deprecated */ Financial::DDB(2400, 300, 36500, 1), 1E-8); - self::assertEqualsWithDelta(0.052420213, /** @scrutinizer ignore-deprecated */ Financial::DISC('2007-01-25', '2007-06-15', 97.974999999999994, 100, 1), 1E-8); - self::assertEqualsWithDelta(2.5, /** @scrutinizer ignore-deprecated */ Financial::DOLLARDE(1.6, 4), 1E-8); - self::assertEqualsWithDelta(1.24, /** @scrutinizer ignore-deprecated */ Financial::DOLLARFR(1.6, 4), 1E-8); - self::assertEqualsWithDelta(0.053542667370758003, /** @scrutinizer ignore-deprecated */ Financial::EFFECT(0.052499999999999998, 4), 1E-8); - self::assertEqualsWithDelta(2581.4033740600998, /** @scrutinizer ignore-deprecated */ Financial::FV(0.005, 10, -200, -500, 1), 1E-8); - self::assertEqualsWithDelta(1.3308899999999999, /** @scrutinizer ignore-deprecated */ Financial::FVSCHEDULE(1, [0.089999999999999997, 0.11, 0.10000000000000001]), 1E-8); - self::assertEqualsWithDelta(0.05768, /** @scrutinizer ignore-deprecated */ Financial::INTRATE('2008-02-15', '2008-05-15', 1000000, 1014420, 2), 1E-8); - self::assertEqualsWithDelta(-22.858787457480013, /** @scrutinizer ignore-deprecated */ Financial::IPMT(0.0085, 3, 3, 8000), 1E-8); - self::assertEqualsWithDelta(-0.02124484827341, /** @scrutinizer ignore-deprecated */ Financial::IRR([-70000, 12000, 15000, 18000, 21000]), 1E-8); - self::assertEqualsWithDelta(-66111.111111111, /** @scrutinizer ignore-deprecated */ Financial::ISPMT(0.0085, 1, 36, 8000000), 1E-8); - self::assertEqualsWithDelta(0.12609413036591, /** @scrutinizer ignore-deprecated */ Financial::MIRR([-120000, [39000, 30000, 21000, 37000, 46000]], 0.10, 0.12), 1E-8); - self::assertEqualsWithDelta(0.052500319868356002, /** @scrutinizer ignore-deprecated */ Financial::NOMINAL(0.053543, 4), 1E-8); - self::assertEqualsWithDelta(59.673865674295001, /** @scrutinizer ignore-deprecated */ Financial::NPER(0.01, -100, -1000, 10000, 1), 1E-8); - self::assertEqualsWithDelta(1188.4434123352, /** @scrutinizer ignore-deprecated */ Financial::NPV(0.10, -10000, 3000, 4200, 6800), 1E-8); - self::assertEqualsWithDelta(10.33803507, /** @scrutinizer ignore-deprecated */ Financial::PDURATION(0.04, 10000, 15000), 1E-8); - self::assertEqualsWithDelta(-1037.032089359164, /** @scrutinizer ignore-deprecated */ Financial::PMT(0.08 / 12, 10, 10000), 1E-8); - self::assertEqualsWithDelta(-75.623186008367, /** @scrutinizer ignore-deprecated */ Financial::PPMT(0.10 / 12, 1, 2 * 12, 2000), 1E-8); - self::assertEqualsWithDelta(94.6343616213221, /** @scrutinizer ignore-deprecated */ Financial::PRICE('15-Feb-2008', '15-Nov-2017', 0.0575, 0.065, 100, 2, 0), 1E-8); - self::assertEqualsWithDelta(90.0, /** @scrutinizer ignore-deprecated */ Financial::PRICEDISC('01-Apr-2017', '31-Mar-2021', 0.025, 100), 1E-8); - self::assertEqualsWithDelta(99.98449887555694, /** @scrutinizer ignore-deprecated */ Financial::PRICEMAT('15-Feb-2008', '13-Apr-2008', '11-Nov-2007', 0.061, 0.061, 0), 1E-8); - self::assertEqualsWithDelta(-52990.70632392715, /** @scrutinizer ignore-deprecated */ Financial::PV(0.05 / 12, 60, 1000), 1E-8); - self::assertEqualsWithDelta(0.0077014724882014003, /** @scrutinizer ignore-deprecated */ Financial::RATE(48, -200, 8000), 1E-8); - self::assertEqualsWithDelta(1014584.6544071021, /** @scrutinizer ignore-deprecated */ Financial::RECEIVED('15-Feb-2008', '15-May-2008', 1000000, 0.0575, 2), 1E-8); - self::assertEqualsWithDelta(0.04137974399241062, /** @scrutinizer ignore-deprecated */ Financial::RRI(10, 10000, 15000), 1E-8); - self::assertEqualsWithDelta(1800, /** @scrutinizer ignore-deprecated */ Financial::SLN(10000, 1000, 5), 1E-8); - self::assertEqualsWithDelta(3000, /** @scrutinizer ignore-deprecated */ Financial::SYD(10000, 1000, 5, 1), 1E-8); - self::assertEqualsWithDelta(0.094151494, /** @scrutinizer ignore-deprecated */ Financial::TBILLEQ('31-Mar-2008', '1-Jun-2008', 0.0914), 1E-8); - self::assertEqualsWithDelta(98.45, /** @scrutinizer ignore-deprecated */ Financial::TBILLPRICE('31-Mar-2008', '1-Jun-2008', 0.09), 1E-8); - self::assertEqualsWithDelta(0.09141696292534264, /** @scrutinizer ignore-deprecated */ Financial::TBILLYIELD('31-Mar-2008', '1-Jun-2008', 98.45), 1E-8); - self::assertEqualsWithDelta(0.77868869226873, /** @scrutinizer ignore-deprecated */ Financial::XIRR([4000, -46000], ['2015-04-01', '2019-06-27'], 0.1), 1E-8); - self::assertEqualsWithDelta(772830.7339573108, /** @scrutinizer ignore-deprecated */ Financial::XNPV(0.10, [0, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000], ['2018-06-30', '2018-12-31', '2019-12-31', '2020-12-31', '2021-12-31', '2022-12-31', '2023-12-31', '2024-12-31', '2025-12-31', '2026-12-31', '2027-12-31']), 1E-8); - self::assertEqualsWithDelta(0.05282257198685834, /** @scrutinizer ignore-deprecated */ Financial::YIELDDISC('16-Feb-2008', '1-Mar-2008', 99.795, 100, 2), 1E-8); - self::assertEqualsWithDelta(0.06095433369153867, /** @scrutinizer ignore-deprecated */ Financial::YIELDMAT('15-Mar-2008', '3-Nov-2008', '8-Nov-2007', 0.0625, 100.0123, 0), 1E-8); + self::assertEqualsWithDelta(16.6666666666666, Financial::ACCRINT('2008-03-01', '2008-08-31', '2008-05-01', 0.10, 1000, 2, 0), 1E-8); + self::assertEqualsWithDelta(20.547945205478999, Financial::ACCRINTM('2008-04-01', '2008-06-15', 0.10, 1000, 3), 1E-8); + self::assertEqualsWithDelta(776, Financial::AMORDEGRC(2400, '2008-08-19', '2008-12-31', 300, 1, 0.15, 1), 1E-8); + self::assertEqualsWithDelta(360, Financial::AMORLINC(2400, '2008-08-19', '2008-12-31', 300, 1, 0.15, 1), 1E-8); + self::assertEqualsWithDelta(71, Financial::COUPDAYBS('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(181, Financial::COUPDAYS('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(110, Financial::COUPDAYSNC('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(39217, Financial::COUPNCD('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(4, Financial::COUPNUM('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(39036, Financial::COUPPCD('25-Jan-2007', '15-Nov-2008', 2, 1), 1E-8); + self::assertEqualsWithDelta(-11135.232130750999, Financial::CUMIPMT(0.0075, 360, 125000, 13, 24, 0), 1E-8); + self::assertEqualsWithDelta(-934.10712342088004, Financial::CUMPRINC(0.0075, 360, 125000, 13, 24, 0), 1E-8); + self::assertEqualsWithDelta(186083.3333333334, Financial::DB(1000000, 100000, 6, 1, 7), 1E-8); + self::assertEqualsWithDelta(0.13150684931507001, Financial::DDB(2400, 300, 36500, 1), 1E-8); + self::assertEqualsWithDelta(0.052420213, Financial::DISC('2007-01-25', '2007-06-15', 97.974999999999994, 100, 1), 1E-8); + self::assertEqualsWithDelta(2.5, Financial::DOLLARDE(1.6, 4), 1E-8); + self::assertEqualsWithDelta(1.24, Financial::DOLLARFR(1.6, 4), 1E-8); + self::assertEqualsWithDelta(0.053542667370758003, Financial::EFFECT(0.052499999999999998, 4), 1E-8); + self::assertEqualsWithDelta(2581.4033740600998, Financial::FV(0.005, 10, -200, -500, 1), 1E-8); + self::assertEqualsWithDelta(1.3308899999999999, Financial::FVSCHEDULE(1, [0.089999999999999997, 0.11, 0.10000000000000001]), 1E-8); + self::assertEqualsWithDelta(0.05768, Financial::INTRATE('2008-02-15', '2008-05-15', 1000000, 1014420, 2), 1E-8); + self::assertEqualsWithDelta(-22.858787457480013, Financial::IPMT(0.0085, 3, 3, 8000), 1E-8); + self::assertEqualsWithDelta(-0.02124484827341, Financial::IRR([-70000, 12000, 15000, 18000, 21000]), 1E-8); + self::assertEqualsWithDelta(-66111.111111111, Financial::ISPMT(0.0085, 1, 36, 8000000), 1E-8); + self::assertEqualsWithDelta(0.12609413036591, Financial::MIRR([-120000, [39000, 30000, 21000, 37000, 46000]], 0.10, 0.12), 1E-8); + self::assertEqualsWithDelta(0.052500319868356002, Financial::NOMINAL(0.053543, 4), 1E-8); + self::assertEqualsWithDelta(59.673865674295001, Financial::NPER(0.01, -100, -1000, 10000, 1), 1E-8); + self::assertEqualsWithDelta(1188.4434123352, Financial::NPV(0.10, -10000, 3000, 4200, 6800), 1E-8); + self::assertEqualsWithDelta(10.33803507, Financial::PDURATION(0.04, 10000, 15000), 1E-8); + self::assertEqualsWithDelta(-1037.032089359164, Financial::PMT(0.08 / 12, 10, 10000), 1E-8); + self::assertEqualsWithDelta(-75.623186008367, Financial::PPMT(0.10 / 12, 1, 2 * 12, 2000), 1E-8); + self::assertEqualsWithDelta(94.6343616213221, Financial::PRICE('15-Feb-2008', '15-Nov-2017', 0.0575, 0.065, 100, 2, 0), 1E-8); + self::assertEqualsWithDelta(90.0, Financial::PRICEDISC('01-Apr-2017', '31-Mar-2021', 0.025, 100), 1E-8); + self::assertEqualsWithDelta(99.98449887555694, Financial::PRICEMAT('15-Feb-2008', '13-Apr-2008', '11-Nov-2007', 0.061, 0.061, 0), 1E-8); + self::assertEqualsWithDelta(-52990.70632392715, Financial::PV(0.05 / 12, 60, 1000), 1E-8); + self::assertEqualsWithDelta(0.0077014724882014003, Financial::RATE(48, -200, 8000), 1E-8); + self::assertEqualsWithDelta(1014584.6544071021, Financial::RECEIVED('15-Feb-2008', '15-May-2008', 1000000, 0.0575, 2), 1E-8); + self::assertEqualsWithDelta(0.04137974399241062, Financial::RRI(10, 10000, 15000), 1E-8); + self::assertEqualsWithDelta(1800, Financial::SLN(10000, 1000, 5), 1E-8); + self::assertEqualsWithDelta(3000, Financial::SYD(10000, 1000, 5, 1), 1E-8); + self::assertEqualsWithDelta(0.094151494, Financial::TBILLEQ('31-Mar-2008', '1-Jun-2008', 0.0914), 1E-8); + self::assertEqualsWithDelta(98.45, Financial::TBILLPRICE('31-Mar-2008', '1-Jun-2008', 0.09), 1E-8); + self::assertEqualsWithDelta(0.09141696292534264, Financial::TBILLYIELD('31-Mar-2008', '1-Jun-2008', 98.45), 1E-8); + self::assertEqualsWithDelta(0.77868869226873, Financial::XIRR([4000, -46000], ['2015-04-01', '2019-06-27'], 0.1), 1E-8); + self::assertEqualsWithDelta(772830.7339573108, Financial::XNPV(0.10, [0, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000], ['2018-06-30', '2018-12-31', '2019-12-31', '2020-12-31', '2021-12-31', '2022-12-31', '2023-12-31', '2024-12-31', '2025-12-31', '2026-12-31', '2027-12-31']), 1E-8); + self::assertEqualsWithDelta(0.05282257198685834, Financial::YIELDDISC('16-Feb-2008', '1-Mar-2008', 99.795, 100, 2), 1E-8); + self::assertEqualsWithDelta(0.06095433369153867, Financial::YIELDMAT('15-Mar-2008', '3-Nov-2008', '8-Nov-2007', 0.0625, 100.0123, 0), 1E-8); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/DeprecatedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/DeprecatedFunctionsTest.php index 864faf58a..39155c909 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/DeprecatedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/DeprecatedFunctionsTest.php @@ -18,27 +18,27 @@ class DeprecatedFunctionsTest extends TestCase { public function testDeprecated(): void { - self::assertSame('#DIV/0!', /** @scrutinizer ignore-deprecated */ Functions::DIV0()); - self::assertSame('#N/A', /** @scrutinizer ignore-deprecated */ Functions::errorType()); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isBlank()); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isErr('#DIV/0!')); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isError('#DIV/0!')); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isEven(2)); + self::assertSame('#DIV/0!', Functions::DIV0()); + self::assertSame('#N/A', Functions::errorType()); + self::assertTrue(Functions::isBlank()); + self::assertTrue(Functions::isErr('#DIV/0!')); + self::assertTrue(Functions::isError('#DIV/0!')); + self::assertTrue(Functions::isEven(2)); // isFormula needs more complicated test - see next method - self::assertFalse(/** @scrutinizer ignore-deprecated */ Functions::isNa()); - self::assertFalse(/** @scrutinizer ignore-deprecated */ Functions::isLogical()); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isNonText(2)); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isNumber(2)); - self::assertFalse(/** @scrutinizer ignore-deprecated */ Functions::isOdd(2)); - self::assertFalse(/** @scrutinizer ignore-deprecated */ Functions::isText(2)); - self::assertSame('#N/A', /** @scrutinizer ignore-deprecated */ Functions::NA()); - self::assertSame('#NAME?', /** @scrutinizer ignore-deprecated */ Functions::NAME()); - self::assertSame('#NUM!', /** @scrutinizer ignore-deprecated */ Functions::NAN()); - self::assertSame(1, /** @scrutinizer ignore-deprecated */ Functions::n(true)); - self::assertSame('#NULL!', /** @scrutinizer ignore-deprecated */ Functions::null()); - self::assertSame('#REF!', /** @scrutinizer ignore-deprecated */ Functions::REF()); - self::assertSame(1, /** @scrutinizer ignore-deprecated */ Functions::type(7)); - self::assertSame('#VALUE!', /** @scrutinizer ignore-deprecated */ Functions::VALUE()); + self::assertFalse(Functions::isNa()); + self::assertFalse(Functions::isLogical()); + self::assertTrue(Functions::isNonText(2)); + self::assertTrue(Functions::isNumber(2)); + self::assertFalse(Functions::isOdd(2)); + self::assertFalse(Functions::isText(2)); + self::assertSame('#N/A', Functions::NA()); + self::assertSame('#NAME?', Functions::NAME()); + self::assertSame('#NUM!', Functions::NAN()); + self::assertSame(1, Functions::n(true)); + self::assertSame('#NULL!', Functions::null()); + self::assertSame('#REF!', Functions::REF()); + self::assertSame(1, Functions::type(7)); + self::assertSame('#VALUE!', Functions::VALUE()); } public function testIsFormula(): void @@ -47,7 +47,7 @@ class DeprecatedFunctionsTest extends TestCase $sheet = $spreadsheet->getActiveSheet(); $cell = $sheet->getCell('A1'); $cell->setValue('=1'); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Functions::isFormula('A1', $cell)); + self::assertTrue(Functions::isFormula('A1', $cell)); $spreadsheet->disconnectWorksheets(); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/DeprecatedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/DeprecatedFunctionsTest.php index 4d0c1a814..fe40cbdc2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/DeprecatedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/DeprecatedFunctionsTest.php @@ -17,16 +17,16 @@ class DeprecatedFunctionsTest extends TestCase { public function testDeprecated(): void { - self::assertFalse(/** @scrutinizer ignore-deprecated */ Logical::false()); - self::assertFalse(/** @scrutinizer ignore-deprecated */ Logical::logicalAnd(true, false)); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Logical::NOT(false)); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Logical::logicalOr(true, false)); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Logical::logicalXor(true, false)); - self::assertTrue(/** @scrutinizer ignore-deprecated */ Logical::true()); - self::assertFalse(/** @scrutinizer ignore-deprecated */ Logical::statementIf(false)); - self::assertSame('error', /** @scrutinizer ignore-deprecated */ Logical::IFERROR('#VALUE!', 'error')); - self::assertSame('#VALUE!', /** @scrutinizer ignore-deprecated */ Logical::IFNA('#VALUE!', 'error')); - self::assertSame('two', /** @scrutinizer ignore-deprecated */ Logical::IFS(false, 'one', true, 'two', true, 'three')); - self::assertSame(31, /** @scrutinizer ignore-deprecated */ Logical::statementSwitch(30, 10, 11, 20, 21, 30, 31, 40, 41)); + self::assertFalse(Logical::false()); + self::assertFalse(Logical::logicalAnd(true, false)); + self::assertTrue(Logical::NOT(false)); + self::assertTrue(Logical::logicalOr(true, false)); + self::assertTrue(Logical::logicalXor(true, false)); + self::assertTrue(Logical::true()); + self::assertFalse(Logical::statementIf(false)); + self::assertSame('error', Logical::IFERROR('#VALUE!', 'error')); + self::assertSame('#VALUE!', Logical::IFNA('#VALUE!', 'error')); + self::assertSame('two', Logical::IFS(false, 'one', true, 'two', true, 'three')); + self::assertSame(31, Logical::statementSwitch(30, 10, 11, 20, 21, 30, 31, 40, 41)); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php index 3ea20cac3..ed91c1936 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php @@ -127,7 +127,7 @@ class IndirectTest extends AllSetupTeardown $sheet = $this->getSheet(); $sheet->getCell('A1')->setValue('A2'); $sheet->getCell('A2')->setValue('This is it'); - $result = /** @scrutinizer ignore-deprecated */ \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT('A2', $sheet->getCell('A1')); + $result = \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT('A2', $sheet->getCell('A1')); $result = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenSingleValue($result); self::assertSame('This is it', $result); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MovedFunctionsTest.php index b96ad342c..860c3e4db 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MovedFunctionsTest.php @@ -20,18 +20,18 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertSame('$G$3', /** @scrutinizer ignore-deprecated */ LookupRef::cellAddress(3, 7)); - self::assertSame(3, /** @scrutinizer ignore-deprecated */ LookupRef::COLUMN('C5')); - self::assertSame(2, /** @scrutinizer ignore-deprecated */ LookupRef::COLUMNS([[1, 2], [3, 5], [7, 9]])); - self::assertSame(30, /** @scrutinizer ignore-deprecated */ LookupRef::CHOOSE(3, 10, 20, 30, 40)); - self::assertSame(ExcelError::REF(), /** @scrutinizer ignore-deprecated */ LookupRef::FORMULATEXT('A1')); - self::assertSame(ExcelError::REF(), /** @scrutinizer ignore-deprecated */ LookupRef::HYPERLINK('https://phpspreadsheet.readthedocs.io/en/latest/', 'Read the Docs')); - self::assertSame(60, /** @scrutinizer ignore-deprecated */ LookupRef::INDEX([[10, 20, 30], [40, 50, 60], [70, 80, 90]], 2, 3)); - self::assertSame(3, /** @scrutinizer ignore-deprecated */ LookupRef::MATCH(3, [1, 10, 3, 8], 0)); - self::assertSame('#VALUE!', /** @scrutinizer ignore-deprecated */ LookupRef::OFFSET(null)); - self::assertSame(5, /** @scrutinizer ignore-deprecated */ LookupRef::ROW('C5')); - self::assertSame(3, /** @scrutinizer ignore-deprecated */ LookupRef::ROWS([[1, 2], [3, 5], [7, 9]])); - self::assertSame([[1, 2], [3, 4]], /** @scrutinizer ignore-deprecated */ LookupRef::TRANSPOSE([[1, 3], [2, 4]])); + self::assertSame('$G$3', LookupRef::cellAddress(3, 7)); + self::assertSame(3, LookupRef::COLUMN('C5')); + self::assertSame(2, LookupRef::COLUMNS([[1, 2], [3, 5], [7, 9]])); + self::assertSame(30, LookupRef::CHOOSE(3, 10, 20, 30, 40)); + self::assertSame(ExcelError::REF(), LookupRef::FORMULATEXT('A1')); + self::assertSame(ExcelError::REF(), LookupRef::HYPERLINK('https://phpspreadsheet.readthedocs.io/en/latest/', 'Read the Docs')); + self::assertSame(60, LookupRef::INDEX([[10, 20, 30], [40, 50, 60], [70, 80, 90]], 2, 3)); + self::assertSame(3, LookupRef::MATCH(3, [1, 10, 3, 8], 0)); + self::assertSame('#VALUE!', LookupRef::OFFSET(null)); + self::assertSame(5, LookupRef::ROW('C5')); + self::assertSame(3, LookupRef::ROWS([[1, 2], [3, 5], [7, 9]])); + self::assertSame([[1, 2], [3, 4]], LookupRef::TRANSPOSE([[1, 3], [2, 4]])); } public function testLookup(): void @@ -49,7 +49,7 @@ class MovedFunctionsTest extends TestCase [1.290, 1.71, 0], ]; $expectedResult = 100; - $result = /** @scrutinizer ignore-deprecated */ LookupRef::VLOOKUP(1, $densityGrid, 3, true); + $result = LookupRef::VLOOKUP(1, $densityGrid, 3, true); self::assertSame($expectedResult, $result); $orderGrid = [ ['Order ID', 10247, 10249, 10250, 10251, 10252, 10253], @@ -57,7 +57,7 @@ class MovedFunctionsTest extends TestCase ['Quantity', 12, 9, 10, 6, 20, 40], ]; $expectedResult = 16.80; - $result = /** @scrutinizer ignore-deprecated */ LookupRef::HLOOKUP(10251, $orderGrid, 2, false); + $result = LookupRef::HLOOKUP(10251, $orderGrid, 2, false); self::assertSame($expectedResult, $result); $array1 = [ [4.14], @@ -74,7 +74,7 @@ class MovedFunctionsTest extends TestCase ['blue'], ]; $expectedResult = 'orange'; - $result = /** @scrutinizer ignore-deprecated */ LookupRef::LOOKUP(4.19, $array1, $array2); + $result = LookupRef::LOOKUP(4.19, $array1, $array2); self::assertSame($expectedResult, $result); } @@ -84,7 +84,7 @@ class MovedFunctionsTest extends TestCase // Some old tests called function directly using array of strings; // ensure these work as before. $expectedResult = '#REF!'; - $result = /** @scrutinizer ignore-deprecated */ LookupRef::HLOOKUP( + $result = LookupRef::HLOOKUP( 'Selection column', ['Selection column', 'Value to retrieve'], 5, @@ -92,7 +92,7 @@ class MovedFunctionsTest extends TestCase ); self::assertSame($expectedResult, $result); $expectedResult = 'Value to retrieve'; - $result = /** @scrutinizer ignore-deprecated */ LookupRef::HLOOKUP( + $result = LookupRef::HLOOKUP( 'Selection column', ['Selection column', 'Value to retrieve'], 2, diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MovedFunctionsTest.php index 91e0a92f8..659581776 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MovedFunctionsTest.php @@ -17,99 +17,95 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertSame(1, /** @scrutinizer ignore-deprecated */ MathTrig::builtinABS(1)); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinACOS(1), 1E-9); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinACOSH(1), 1E-9); - self::assertEqualsWithDelta(3.04192400109863, /** @scrutinizer ignore-deprecated */ MathTrig::ACOT(-10), 1E-9); - self::assertEqualsWithDelta(-0.20273255405408, /** @scrutinizer ignore-deprecated */ MathTrig::ACOTH(-5), 1E-9); - self::assertSame(49, /** @scrutinizer ignore-deprecated */ MathTrig::ARABIC('XLIX')); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinASIN(0), 1E-9); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinASINH(0), 1E-9); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinATAN(0), 1E-9); - self::assertEqualsWithDelta(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinATANH(0), 1E-9); - self::assertEqualsWithDelta('#DIV/0!', /** @scrutinizer ignore-deprecated */ MathTrig::ATAN2(0, 0), 1E-9); - self::assertEquals('12', /** @scrutinizer ignore-deprecated */ MathTrig::BASE(10, 8)); - self::assertEquals(-6, /** @scrutinizer ignore-deprecated */ MathTrig::CEILING(-4.5, -2)); - self::assertEquals(15, /** @scrutinizer ignore-deprecated */ MathTrig::COMBIN(6, 2)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::builtinCOS(0)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::builtinCOSH(0)); - self::assertEquals('#DIV/0!', /** @scrutinizer ignore-deprecated */ MathTrig::COT(0)); - self::assertEquals('#DIV/0!', /** @scrutinizer ignore-deprecated */ MathTrig::COTH(0)); - self::assertEquals('#DIV/0!', /** @scrutinizer ignore-deprecated */ MathTrig::CSC(0)); - self::assertEquals('#DIV/0!', /** @scrutinizer ignore-deprecated */ MathTrig::CSCH(0)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinDEGREES(0)); - self::assertEquals(6, /** @scrutinizer ignore-deprecated */ MathTrig::EVEN(4.5)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::builtinEXP(0)); - self::assertEquals(6, /** @scrutinizer ignore-deprecated */ MathTrig::FACT(3)); - self::assertEquals(105, /** @scrutinizer ignore-deprecated */ MathTrig::FACTDOUBLE(7)); - self::assertEquals(-6, /** @scrutinizer ignore-deprecated */ MathTrig::FLOOR(-4.5, 2)); - self::assertEquals(0.23, /** @scrutinizer ignore-deprecated */ MathTrig::FLOORMATH(0.234, 0.01)); - self::assertEquals(-4, /** @scrutinizer ignore-deprecated */ MathTrig::FLOORPRECISE(-2.5, 2)); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ MathTrig::GCD(4, 6)); - self::assertEquals(-9, /** @scrutinizer ignore-deprecated */ MathTrig::INT(-8.3)); - self::assertEquals(12, /** @scrutinizer ignore-deprecated */ MathTrig::LCM(4, 6)); - self::assertEqualswithDelta(2.302585, /** @scrutinizer ignore-deprecated */ MathTrig::builtinLN(10), 1E-6); - self::assertEqualswithDelta(0.306762486567556, /** @scrutinizer ignore-deprecated */ MathTrig::logBase(1.5, 3.75), 1E-6); - self::assertEqualswithDelta(0.301030, /** @scrutinizer ignore-deprecated */ MathTrig::builtinLOG10(2), 1E-6); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::MDETERM([1])); + self::assertSame(1, MathTrig::builtinABS(1)); + self::assertEqualsWithDelta(0, MathTrig::builtinACOS(1), 1E-9); + self::assertEqualsWithDelta(0, MathTrig::builtinACOSH(1), 1E-9); + self::assertEqualsWithDelta(3.04192400109863, MathTrig::ACOT(-10), 1E-9); + self::assertEqualsWithDelta(-0.20273255405408, MathTrig::ACOTH(-5), 1E-9); + self::assertSame(49, MathTrig::ARABIC('XLIX')); + self::assertEqualsWithDelta(0, MathTrig::builtinASIN(0), 1E-9); + self::assertEqualsWithDelta(0, MathTrig::builtinASINH(0), 1E-9); + self::assertEqualsWithDelta(0, MathTrig::builtinATAN(0), 1E-9); + self::assertEqualsWithDelta(0, MathTrig::builtinATANH(0), 1E-9); + self::assertEqualsWithDelta('#DIV/0!', MathTrig::ATAN2(0, 0), 1E-9); + self::assertEquals('12', MathTrig::BASE(10, 8)); + self::assertEquals(-6, MathTrig::CEILING(-4.5, -2)); + self::assertEquals(15, MathTrig::COMBIN(6, 2)); + self::assertEquals(1, MathTrig::builtinCOS(0)); + self::assertEquals(1, MathTrig::builtinCOSH(0)); + self::assertEquals('#DIV/0!', MathTrig::COT(0)); + self::assertEquals('#DIV/0!', MathTrig::COTH(0)); + self::assertEquals('#DIV/0!', MathTrig::CSC(0)); + self::assertEquals('#DIV/0!', MathTrig::CSCH(0)); + self::assertEquals(0, MathTrig::builtinDEGREES(0)); + self::assertEquals(6, MathTrig::EVEN(4.5)); + self::assertEquals(1, MathTrig::builtinEXP(0)); + self::assertEquals(6, MathTrig::FACT(3)); + self::assertEquals(105, MathTrig::FACTDOUBLE(7)); + self::assertEquals(-6, MathTrig::FLOOR(-4.5, 2)); + self::assertEquals(0.23, MathTrig::FLOORMATH(0.234, 0.01)); + self::assertEquals(-4, MathTrig::FLOORPRECISE(-2.5, 2)); + self::assertEquals(2, MathTrig::GCD(4, 6)); + self::assertEquals(-9, MathTrig::INT(-8.3)); + self::assertEquals(12, MathTrig::LCM(4, 6)); + self::assertEqualswithDelta(2.302585, MathTrig::builtinLN(10), 1E-6); + self::assertEqualswithDelta(0.306762486567556, MathTrig::logBase(1.5, 3.75), 1E-6); + self::assertEqualswithDelta(0.301030, MathTrig::builtinLOG10(2), 1E-6); + self::assertEquals(1, MathTrig::MDETERM([1])); self::assertEquals( [[2, 2], [2, 1]], - /** @scrutinizer ignore-deprecated */ MathTrig::MINVERSE([[-0.5, 1.0], [1.0, -1.0]]) ); self::assertEquals( [[23], [53]], - /** @scrutinizer ignore-deprecated */ MathTrig::MMULT([[1, 2], [3, 4]], [[7], [8]]) ); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::MOD(5, 2)); - self::assertEquals(6, /** @scrutinizer ignore-deprecated */ MathTrig::MROUND(7.3, 3)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::MULTINOMIAL(1)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::numberOrNan(0)); - self::assertEquals(5, /** @scrutinizer ignore-deprecated */ MathTrig::ODD(4.5)); - self::assertEquals(8, /** @scrutinizer ignore-deprecated */ MathTrig::POWER(2, 3)); - self::assertEquals(8, /** @scrutinizer ignore-deprecated */ MathTrig::PRODUCT(1, 2, 4)); - self::assertEquals(8, /** @scrutinizer ignore-deprecated */ MathTrig::QUOTIENT(17, 2)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinRADIANS(0)); - self::assertGreaterThanOrEqual(0, /** @scrutinizer ignore-deprecated */ MathTrig::RAND()); - self::assertEquals('I', /** @scrutinizer ignore-deprecated */ MathTrig::ROMAN(1)); - self::assertEquals(3.3, /** @scrutinizer ignore-deprecated */ MathTrig::builtinROUND(3.27, 1)); - self::assertEquals(662, /** @scrutinizer ignore-deprecated */ MathTrig::ROUNDDOWN(662.79, 0)); - self::assertEquals(663, /** @scrutinizer ignore-deprecated */ MathTrig::ROUNDUP(662.79, 0)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::SEC(0)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::SECH(0)); - self::assertEquals(3780, /** @scrutinizer ignore-deprecated */ MathTrig::SERIESSUM(5, 1, 1, [1, 1, 0, 1, 1])); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::SIGN(79.2)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinSIN(0)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinSINH(0)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinSQRT(0)); - self::assertEqualswithDelta(3.54490770181103, /** @scrutinizer ignore-deprecated */ MathTrig::SQRTPI(4), 1E-6); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::SUBTOTAL(2, [0, 0])); - self::assertEquals(7, /** @scrutinizer ignore-deprecated */ MathTrig::SUM(1, 2, 4)); - self::assertEquals(4, /** @scrutinizer ignore-deprecated */ MathTrig::SUMIF([[2], [4]], '>2')); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ MathTrig::SUMIFS( + self::assertEquals(1, MathTrig::MOD(5, 2)); + self::assertEquals(6, MathTrig::MROUND(7.3, 3)); + self::assertEquals(1, MathTrig::MULTINOMIAL(1)); + self::assertEquals(0, MathTrig::numberOrNan(0)); + self::assertEquals(5, MathTrig::ODD(4.5)); + self::assertEquals(8, MathTrig::POWER(2, 3)); + self::assertEquals(8, MathTrig::PRODUCT(1, 2, 4)); + self::assertEquals(8, MathTrig::QUOTIENT(17, 2)); + self::assertEquals(0, MathTrig::builtinRADIANS(0)); + self::assertGreaterThanOrEqual(0, MathTrig::RAND()); + self::assertEquals('I', MathTrig::ROMAN(1)); + self::assertEquals(3.3, MathTrig::builtinROUND(3.27, 1)); + self::assertEquals(662, MathTrig::ROUNDDOWN(662.79, 0)); + self::assertEquals(663, MathTrig::ROUNDUP(662.79, 0)); + self::assertEquals(1, MathTrig::SEC(0)); + self::assertEquals(1, MathTrig::SECH(0)); + self::assertEquals(3780, MathTrig::SERIESSUM(5, 1, 1, [1, 1, 0, 1, 1])); + self::assertEquals(1, MathTrig::SIGN(79.2)); + self::assertEquals(0, MathTrig::builtinSIN(0)); + self::assertEquals(0, MathTrig::builtinSINH(0)); + self::assertEquals(0, MathTrig::builtinSQRT(0)); + self::assertEqualswithDelta(3.54490770181103, MathTrig::SQRTPI(4), 1E-6); + self::assertEquals(0, MathTrig::SUBTOTAL(2, [0, 0])); + self::assertEquals(7, MathTrig::SUM(1, 2, 4)); + self::assertEquals(4, MathTrig::SUMIF([[2], [4]], '>2')); + self::assertEquals(2, MathTrig::SUMIFS( [[1], [1], [1]], [['Y'], ['Y'], ['N']], '=Y', [['H'], ['H'], ['H']], '=H' )); - self::assertEquals(17, /** @scrutinizer ignore-deprecated */ MathTrig::SUMPRODUCT([1, 2, 3], [5, 0, 4])); - self::assertEquals(21, /** @scrutinizer ignore-deprecated */ MathTrig::SUMSQ(1, 2, 4)); - self::assertEquals(-20, /** @scrutinizer ignore-deprecated */ MathTrig::SUMX2MY2([1, 2], [3, 4])); - self::assertEquals(30, /** @scrutinizer ignore-deprecated */ MathTrig::SUMX2PY2([1, 2], [3, 4])); - self::assertEquals(8, /** @scrutinizer ignore-deprecated */ MathTrig::SUMXMY2([1, 2], [3, 4])); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinTAN(0)); - self::assertEquals(0, /** @scrutinizer ignore-deprecated */ MathTrig::builtinTANH(0)); - self::assertEquals(70, /** @scrutinizer ignore-deprecated */ MathTrig::TRUNC(79.2, -1)); - self::assertEquals(1, /** @scrutinizer ignore-deprecated */ MathTrig::returnSign(79.2)); - self::assertEquals(80, /** @scrutinizer ignore-deprecated */ MathTrig::getEven(79.2)); + self::assertEquals(17, MathTrig::SUMPRODUCT([1, 2, 3], [5, 0, 4])); + self::assertEquals(21, MathTrig::SUMSQ(1, 2, 4)); + self::assertEquals(-20, MathTrig::SUMX2MY2([1, 2], [3, 4])); + self::assertEquals(30, MathTrig::SUMX2PY2([1, 2], [3, 4])); + self::assertEquals(8, MathTrig::SUMXMY2([1, 2], [3, 4])); + self::assertEquals(0, MathTrig::builtinTAN(0)); + self::assertEquals(0, MathTrig::builtinTANH(0)); + self::assertEquals(70, MathTrig::TRUNC(79.2, -1)); + self::assertEquals(1, MathTrig::returnSign(79.2)); + self::assertEquals(80, MathTrig::getEven(79.2)); $nullVal = null; - /** @scrutinizer ignore-deprecated */ MathTrig::nullFalseTrueToNumber($nullVal); self::assertSame(0, $nullVal); $nullVal = true; - /** @scrutinizer ignore-deprecated */ MathTrig::nullFalseTrueToNumber($nullVal); self::assertSame(1, $nullVal); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandArrayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandArrayTest.php index 3b5f73025..57d65082c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandArrayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandArrayTest.php @@ -19,7 +19,7 @@ class RandArrayTest extends AllSetupTeardown $result = MathTrig\Random::randArray($rows, $cols, $min, $max, true); self::assertIsArray($result); - self::assertCount($rows, /** @scrutinizer ignore-type */ $result); + self::assertCount($rows, $result); self::assertIsArray($result[0]); self::assertCount($cols, $result[0]); @@ -42,7 +42,7 @@ class RandArrayTest extends AllSetupTeardown $result = MathTrig\Random::randArray($rows, $cols, $min, $max, false); self::assertIsArray($result); - self::assertCount($rows, /** @scrutinizer ignore-type */ $result); + self::assertCount($rows, $result); self::assertIsArray($result[0]); self::assertCount($cols, $result[0]); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php index 059723616..bd0f8a701 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php @@ -58,9 +58,9 @@ class RandBetweenTest extends AllSetupTeardown $formula = "=RandBetween({$argument1}, {$argument2})"; $result = $calculation->_calculateFormulaValue($formula); self::assertIsArray($result); - self::assertCount($expectedRows, /** @scrutinizer ignore-type */ $result); + self::assertCount($expectedRows, $result); self::assertIsArray($result[0]); - self::assertCount($expectedColumns, /** @scrutinizer ignore-type */ $result[0]); + self::assertCount($expectedColumns, $result[0]); } public static function providerRandBetweenArray(): array diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MovedFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MovedFunctionsTest.php index 6b0b8c628..f44c9f49c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MovedFunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MovedFunctionsTest.php @@ -17,79 +17,79 @@ class MovedFunctionsTest extends TestCase { public function testMovedFunctions(): void { - self::assertEqualsWithDelta(1.020408163265, /** @scrutinizer ignore-deprecated */ Statistical::AVEDEV([4, 5, 6, 7, 5, 4, 3]), 1E-8); - self::assertEqualsWithDelta(11, /** @scrutinizer ignore-deprecated */ Statistical::AVERAGE([10, 7, 9, 27, 2]), 1E-8); - self::assertEqualsWithDelta(7.0, /** @scrutinizer ignore-deprecated */ Statistical::AVERAGEA([10, 7, 9, 2]), 1E-8); - self::assertEqualsWithDelta(14000, /** @scrutinizer ignore-deprecated */ Statistical::AVERAGEIF([1 => 7000, 14000, 21000, 28000], '<23000'), 1E-8); - self::assertEqualsWithDelta(0.4059136, /** @scrutinizer ignore-deprecated */ Statistical::BETADIST(0.4, 4, 5), 1E-8); - self::assertEqualsWithDelta(1.862243320728, /** @scrutinizer ignore-deprecated */ Statistical::BETAINV(0.52, 3, 4, 1, 3), 1E-8); - self::assertEqualsWithDelta(0.706399436132, /** @scrutinizer ignore-deprecated */ Statistical::BINOMDIST(3, 8, 0.35, true), 1E-8); - self::assertEqualsWithDelta(0.964294972685, /** @scrutinizer ignore-deprecated */ Statistical::CHIDIST(3, 9), 1E-8); - self::assertEqualsWithDelta(8.383430828608, /** @scrutinizer ignore-deprecated */ Statistical::CHIINV(0.3, 7), 1E-8); - self::assertEqualsWithDelta(0.692951912734, /** @scrutinizer ignore-deprecated */ Statistical::CONFIDENCE(0.05, 2.5, 50), 1E-8); - self::assertEqualsWithDelta(0.997054485502, /** @scrutinizer ignore-deprecated */ Statistical::CORREL([3, 2, 4, 5, 6], [9, 7, 12, 15, 17]), 1E-8); - self::assertEqualsWithDelta(4, /** @scrutinizer ignore-deprecated */ Statistical::COUNT(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); - self::assertEqualsWithDelta(5, /** @scrutinizer ignore-deprecated */ Statistical::COUNTA(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::COUNTBLANK(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::COUNTIF(['apples', 'oranges', 'peaches', 'apples'], 'apples'), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::COUNTIFS(['Y', 'Y', 'N'], '=Y'), 1E-8); - self::assertEqualsWithDelta(5.2, /** @scrutinizer ignore-deprecated */ Statistical::COVAR([3, 2, 4, 5, 6], [9, 7, 12, 15, 17]), 1E-8); - self::assertEqualsWithDelta(32, /** @scrutinizer ignore-deprecated */ Statistical::CRITBINOM(100, 0.3, 0.7), 1E-8); - self::assertEqualsWithDelta(48, /** @scrutinizer ignore-deprecated */ Statistical::DEVSQ(4, 5, 8, 7, 11, 4, 3), 1E-8); - self::assertEqualsWithDelta(1.353352832366, /** @scrutinizer ignore-deprecated */ Statistical::EXPONDIST(0.2, 10, false), 1E-8); - self::assertEqualsWithDelta(0.001223791709, /** @scrutinizer ignore-deprecated */ Statistical::FDIST2(15.2069, 6, 4, false), 1E-8); - self::assertEqualsWithDelta(-1.472219489583, /** @scrutinizer ignore-deprecated */ Statistical::FISHER(-0.9), 1E-8); - self::assertEqualsWithDelta(-0.197375320225, /** @scrutinizer ignore-deprecated */ Statistical::FISHERINV(-0.2), 1E-8); - self::assertEqualsWithDelta(10.607253086419, /** @scrutinizer ignore-deprecated */ Statistical::FORECAST(30, [6, 7, 9, 15, 21], [20, 28, 31, 38, 40]), 1E-8); - self::assertEqualsWithDelta(1.329340388179, /** @scrutinizer ignore-deprecated */ Statistical::GAMMAFunction(2.5), 1E-8); - self::assertEqualsWithDelta(0.03263913041829, /** @scrutinizer ignore-deprecated */ Statistical::GAMMADIST(10.00001131, 9, 2, false), 1E-8); - self::assertEqualsWithDelta(10.0000111914377, /** @scrutinizer ignore-deprecated */ Statistical::GAMMAINV(0.068094, 9, 2), 1E-8); - self::assertEqualsWithDelta(2.453736570842, /** @scrutinizer ignore-deprecated */ Statistical::GAMMALN(4.5), 1E-8); - self::assertEqualsWithDelta(0.4772498680518, /** @scrutinizer ignore-deprecated */ Statistical::GAUSS(2), 1E-8); - self::assertEqualsWithDelta(5.47698696965696, /** @scrutinizer ignore-deprecated */ Statistical::GEOMEAN(4, 5, 8, 7, 11, 4, 3), 1E-8); - self::assertEqualsWithDelta([[[32618.203773539713], [47729.42261474774], [69841.30085621739], [102197.07337883231], [149542.48674004572], [218821.87621459525]]], /** @scrutinizer ignore-deprecated */ Statistical::GROWTH([33100, 47300, 69000, 102000, 150000, 220000], [11, 12, 13, 14, 15, 16]), 1E-8); - self::assertEqualsWithDelta(5.028375962062, /** @scrutinizer ignore-deprecated */ Statistical::HARMEAN(4, 5, 8, 7, 11, 4, 3), 1E-8); - self::assertEqualsWithDelta(0.3632610939112, /** @scrutinizer ignore-deprecated */ Statistical::HYPGEOMDIST(1, 4, 8, 20), 1E-8); - self::assertEqualsWithDelta(25.0, /** @scrutinizer ignore-deprecated */ Statistical::INTERCEPT([5, 10, 15, 20], [12, 9, 6, 3]), 1E-8); - self::assertEqualsWithDelta(-0.1517996372084, /** @scrutinizer ignore-deprecated */ Statistical::KURT([3, 4, 5, 2, 3, 4, 5, 6, 4, 7]), 1E-8); - self::assertEqualsWithDelta(5, /** @scrutinizer ignore-deprecated */ Statistical::LARGE([3, 4, 5, 2, 3, 4, 5, 6, 4, 7], 3), 1E-8); - self::assertEqualsWithDelta([1.0, 0.0], /** @scrutinizer ignore-deprecated */ Statistical::LINEST([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], false, false), 1E-8); - self::assertEqualsWithDelta([1.000174230092, 1.0], /** @scrutinizer ignore-deprecated */ Statistical::LOGEST([1, 2, 3, 4, 5], [1, 10, 100, 1000, 10000], false, false), 1E-8); - self::assertEqualsWithDelta(4.000025209777, /** @scrutinizer ignore-deprecated */ Statistical::LOGINV(0.039084, 3.5, 1.2), 1E-8); - self::assertEqualsWithDelta(0.0390835557068, /** @scrutinizer ignore-deprecated */ Statistical::LOGNORMDIST(4, 3.5, 1.2), 1E-8); - self::assertEqualsWithDelta(0.0390835557068, /** @scrutinizer ignore-deprecated */ Statistical::LOGNORMDIST2(4, 3.5, 1.2, true), 1E-8); - self::assertEqualsWithDelta(27, /** @scrutinizer ignore-deprecated */ Statistical::MAX(10, 7, 9, 27, 2), 1E-8); - self::assertEqualsWithDelta(10, /** @scrutinizer ignore-deprecated */ Statistical::MAXA(10, 7, 9, '17', 2), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::MAXIFS([1, 2, 3], ['Y', 'Y', 'N'], '=Y', ['H', 'H', 'H'], '=H'), 1E-8); - self::assertEqualsWithDelta(8.0, /** @scrutinizer ignore-deprecated */ Statistical::MEDIAN(1, 4.5, 7, 8, 9, 13, 14), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::MIN(10, 7, 9, 27, 2), 1E-8); - self::assertEqualsWithDelta(-7, /** @scrutinizer ignore-deprecated */ Statistical::MINA(10, '-9', -7, '17', 2), 1E-8); - self::assertEqualsWithDelta(1, /** @scrutinizer ignore-deprecated */ Statistical::MINIFS([1, 2, 3], ['Y', 'Y', 'N'], '=Y', ['H', 'H', 'H'], '=H'), 1E-8); - self::assertEqualsWithDelta(4.1, /** @scrutinizer ignore-deprecated */ Statistical::MODE(5.6, 4.1, 4.1, 3, 2, 4.1), 1E-8); - self::assertEqualsWithDelta(0.05504866037517786, /** @scrutinizer ignore-deprecated */ Statistical::NEGBINOMDIST(10, 5, 0.25), 1E-8); - self::assertEqualsWithDelta(0.05504866037517786, /** @scrutinizer ignore-deprecated */ Statistical::NEGBINOMDIST(10, 5, 0.25), 1E-8); - self::assertEqualsWithDelta(0.9087887802741, /** @scrutinizer ignore-deprecated */ Statistical::NORMDIST(42, 40, 1.5, true), 1E-8); - self::assertEqualsWithDelta(42.000002008416, /** @scrutinizer ignore-deprecated */ Statistical::NORMINV(0.908789, 40, 1.5), 1E-8); - self::assertEqualsWithDelta(0.908788780274, /** @scrutinizer ignore-deprecated */ Statistical::NORMSDIST(1.333333333333), 1E-8); - self::assertEqualsWithDelta(0.164010074676, /** @scrutinizer ignore-deprecated */ Statistical::NORMSDIST2(1.333333333333, false), 1E-8); - self::assertEqualsWithDelta(1.9, /** @scrutinizer ignore-deprecated */ Statistical::PERCENTILE([1, 2, 3, 4], 0.3), 1E-8); - self::assertEqualsWithDelta(0.667, /** @scrutinizer ignore-deprecated */ Statistical::PERCENTRANK([1, 2, 3, 4], 3), 1E-8); - self::assertEqualsWithDelta(20, /** @scrutinizer ignore-deprecated */ Statistical::PERMUT(5, 2), 1E-8); - self::assertEqualsWithDelta(0.12465201948308113, /** @scrutinizer ignore-deprecated */ Statistical::POISSON(2, 5, true), 1E-8); - self::assertEqualsWithDelta(3.5, /** @scrutinizer ignore-deprecated */ Statistical::QUARTILE([1, 2, 4, 7, 8, 9, 10, 12], 1), 1E-8); - self::assertEqualsWithDelta(2, /** @scrutinizer ignore-deprecated */ Statistical::RANK(3.5, [7, 3.5, 3.5, 2, 1]), 1E-8); - self::assertEqualsWithDelta(0.057950191571, /** @scrutinizer ignore-deprecated */ Statistical::RSQ([2, 3, 9, 1, 8, 7, 5], [6, 5, 11, 7, 5, 4, 4]), 1E-8); - self::assertEqualsWithDelta(0.359543071407, /** @scrutinizer ignore-deprecated */ Statistical::SKEW([3, 4, 5, 2, 3, 4, 5, 6, 4, 7]), 1E-8); - self::assertEqualsWithDelta(0.6, /** @scrutinizer ignore-deprecated */ Statistical::SLOPE([3, 6, 9, 12], [5, 10, 15, 20]), 1E-8); - self::assertEqualsWithDelta(3, /** @scrutinizer ignore-deprecated */ Statistical::SMALL([1, 4, 8, 3, 7, 12, 54, 8, 23], 2), 1E-8); - self::assertEqualsWithDelta(1.333333333333, /** @scrutinizer ignore-deprecated */ Statistical::STANDARDIZE(42, 40, 1.5), 1E-8); - self::assertEqualsWithDelta(27.463915719843, /** @scrutinizer ignore-deprecated */ Statistical::STDEV([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); - self::assertEqualsWithDelta(0.577350269190, /** @scrutinizer ignore-deprecated */ Statistical::STDEVA([true, false, 1]), 1E-8); - self::assertEqualsWithDelta(26.0545581424825, /** @scrutinizer ignore-deprecated */ Statistical::STDEVP([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); - self::assertEqualsWithDelta(0.471404520791, /** @scrutinizer ignore-deprecated */ Statistical::STDEVPA([true, false, 1]), 1E-8); - self::assertEqualsWithDelta(3.305718950210, /** @scrutinizer ignore-deprecated */ Statistical::STEYX([2, 3, 9, 1, 8, 7, 5], [6, 5, 11, 7, 5, 4, 4]), 1E-8); - self::assertEqualsWithDelta(0.027322464988, /** @scrutinizer ignore-deprecated */ Statistical::TDIST(1.959999998, 60, 1), 1E-8); - self::assertEqualsWithDelta(1.960041187127, /** @scrutinizer ignore-deprecated */ Statistical::TINV(0.05464, 60), 1E-8); + self::assertEqualsWithDelta(1.020408163265, Statistical::AVEDEV([4, 5, 6, 7, 5, 4, 3]), 1E-8); + self::assertEqualsWithDelta(11, Statistical::AVERAGE([10, 7, 9, 27, 2]), 1E-8); + self::assertEqualsWithDelta(7.0, Statistical::AVERAGEA([10, 7, 9, 2]), 1E-8); + self::assertEqualsWithDelta(14000, Statistical::AVERAGEIF([1 => 7000, 14000, 21000, 28000], '<23000'), 1E-8); + self::assertEqualsWithDelta(0.4059136, Statistical::BETADIST(0.4, 4, 5), 1E-8); + self::assertEqualsWithDelta(1.862243320728, Statistical::BETAINV(0.52, 3, 4, 1, 3), 1E-8); + self::assertEqualsWithDelta(0.706399436132, Statistical::BINOMDIST(3, 8, 0.35, true), 1E-8); + self::assertEqualsWithDelta(0.964294972685, Statistical::CHIDIST(3, 9), 1E-8); + self::assertEqualsWithDelta(8.383430828608, Statistical::CHIINV(0.3, 7), 1E-8); + self::assertEqualsWithDelta(0.692951912734, Statistical::CONFIDENCE(0.05, 2.5, 50), 1E-8); + self::assertEqualsWithDelta(0.997054485502, Statistical::CORREL([3, 2, 4, 5, 6], [9, 7, 12, 15, 17]), 1E-8); + self::assertEqualsWithDelta(4, Statistical::COUNT(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); + self::assertEqualsWithDelta(5, Statistical::COUNTA(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); + self::assertEqualsWithDelta(2, Statistical::COUNTBLANK(['0.1.A' => 0, '0.2.A' => 2, '0.3.A' => '', '0.4.A' => null, '0.5.A' => 5, '0.6.A' => 6.1]), 1E-8); + self::assertEqualsWithDelta(2, Statistical::COUNTIF(['apples', 'oranges', 'peaches', 'apples'], 'apples'), 1E-8); + self::assertEqualsWithDelta(2, Statistical::COUNTIFS(['Y', 'Y', 'N'], '=Y'), 1E-8); + self::assertEqualsWithDelta(5.2, Statistical::COVAR([3, 2, 4, 5, 6], [9, 7, 12, 15, 17]), 1E-8); + self::assertEqualsWithDelta(32, Statistical::CRITBINOM(100, 0.3, 0.7), 1E-8); + self::assertEqualsWithDelta(48, Statistical::DEVSQ(4, 5, 8, 7, 11, 4, 3), 1E-8); + self::assertEqualsWithDelta(1.353352832366, Statistical::EXPONDIST(0.2, 10, false), 1E-8); + self::assertEqualsWithDelta(0.001223791709, Statistical::FDIST2(15.2069, 6, 4, false), 1E-8); + self::assertEqualsWithDelta(-1.472219489583, Statistical::FISHER(-0.9), 1E-8); + self::assertEqualsWithDelta(-0.197375320225, Statistical::FISHERINV(-0.2), 1E-8); + self::assertEqualsWithDelta(10.607253086419, Statistical::FORECAST(30, [6, 7, 9, 15, 21], [20, 28, 31, 38, 40]), 1E-8); + self::assertEqualsWithDelta(1.329340388179, Statistical::GAMMAFunction(2.5), 1E-8); + self::assertEqualsWithDelta(0.03263913041829, Statistical::GAMMADIST(10.00001131, 9, 2, false), 1E-8); + self::assertEqualsWithDelta(10.0000111914377, Statistical::GAMMAINV(0.068094, 9, 2), 1E-8); + self::assertEqualsWithDelta(2.453736570842, Statistical::GAMMALN(4.5), 1E-8); + self::assertEqualsWithDelta(0.4772498680518, Statistical::GAUSS(2), 1E-8); + self::assertEqualsWithDelta(5.47698696965696, Statistical::GEOMEAN(4, 5, 8, 7, 11, 4, 3), 1E-8); + self::assertEqualsWithDelta([[[32618.203773539713], [47729.42261474774], [69841.30085621739], [102197.07337883231], [149542.48674004572], [218821.87621459525]]], Statistical::GROWTH([33100, 47300, 69000, 102000, 150000, 220000], [11, 12, 13, 14, 15, 16]), 1E-8); + self::assertEqualsWithDelta(5.028375962062, Statistical::HARMEAN(4, 5, 8, 7, 11, 4, 3), 1E-8); + self::assertEqualsWithDelta(0.3632610939112, Statistical::HYPGEOMDIST(1, 4, 8, 20), 1E-8); + self::assertEqualsWithDelta(25.0, Statistical::INTERCEPT([5, 10, 15, 20], [12, 9, 6, 3]), 1E-8); + self::assertEqualsWithDelta(-0.1517996372084, Statistical::KURT([3, 4, 5, 2, 3, 4, 5, 6, 4, 7]), 1E-8); + self::assertEqualsWithDelta(5, Statistical::LARGE([3, 4, 5, 2, 3, 4, 5, 6, 4, 7], 3), 1E-8); + self::assertEqualsWithDelta([1.0, 0.0], Statistical::LINEST([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], false, false), 1E-8); + self::assertEqualsWithDelta([1.000174230092, 1.0], Statistical::LOGEST([1, 2, 3, 4, 5], [1, 10, 100, 1000, 10000], false, false), 1E-8); + self::assertEqualsWithDelta(4.000025209777, Statistical::LOGINV(0.039084, 3.5, 1.2), 1E-8); + self::assertEqualsWithDelta(0.0390835557068, Statistical::LOGNORMDIST(4, 3.5, 1.2), 1E-8); + self::assertEqualsWithDelta(0.0390835557068, Statistical::LOGNORMDIST2(4, 3.5, 1.2, true), 1E-8); + self::assertEqualsWithDelta(27, Statistical::MAX(10, 7, 9, 27, 2), 1E-8); + self::assertEqualsWithDelta(10, Statistical::MAXA(10, 7, 9, '17', 2), 1E-8); + self::assertEqualsWithDelta(2, Statistical::MAXIFS([1, 2, 3], ['Y', 'Y', 'N'], '=Y', ['H', 'H', 'H'], '=H'), 1E-8); + self::assertEqualsWithDelta(8.0, Statistical::MEDIAN(1, 4.5, 7, 8, 9, 13, 14), 1E-8); + self::assertEqualsWithDelta(2, Statistical::MIN(10, 7, 9, 27, 2), 1E-8); + self::assertEqualsWithDelta(-7, Statistical::MINA(10, '-9', -7, '17', 2), 1E-8); + self::assertEqualsWithDelta(1, Statistical::MINIFS([1, 2, 3], ['Y', 'Y', 'N'], '=Y', ['H', 'H', 'H'], '=H'), 1E-8); + self::assertEqualsWithDelta(4.1, Statistical::MODE(5.6, 4.1, 4.1, 3, 2, 4.1), 1E-8); + self::assertEqualsWithDelta(0.05504866037517786, Statistical::NEGBINOMDIST(10, 5, 0.25), 1E-8); + self::assertEqualsWithDelta(0.05504866037517786, Statistical::NEGBINOMDIST(10, 5, 0.25), 1E-8); + self::assertEqualsWithDelta(0.9087887802741, Statistical::NORMDIST(42, 40, 1.5, true), 1E-8); + self::assertEqualsWithDelta(42.000002008416, Statistical::NORMINV(0.908789, 40, 1.5), 1E-8); + self::assertEqualsWithDelta(0.908788780274, Statistical::NORMSDIST(1.333333333333), 1E-8); + self::assertEqualsWithDelta(0.164010074676, Statistical::NORMSDIST2(1.333333333333, false), 1E-8); + self::assertEqualsWithDelta(1.9, Statistical::PERCENTILE([1, 2, 3, 4], 0.3), 1E-8); + self::assertEqualsWithDelta(0.667, Statistical::PERCENTRANK([1, 2, 3, 4], 3), 1E-8); + self::assertEqualsWithDelta(20, Statistical::PERMUT(5, 2), 1E-8); + self::assertEqualsWithDelta(0.12465201948308113, Statistical::POISSON(2, 5, true), 1E-8); + self::assertEqualsWithDelta(3.5, Statistical::QUARTILE([1, 2, 4, 7, 8, 9, 10, 12], 1), 1E-8); + self::assertEqualsWithDelta(2, Statistical::RANK(3.5, [7, 3.5, 3.5, 2, 1]), 1E-8); + self::assertEqualsWithDelta(0.057950191571, Statistical::RSQ([2, 3, 9, 1, 8, 7, 5], [6, 5, 11, 7, 5, 4, 4]), 1E-8); + self::assertEqualsWithDelta(0.359543071407, Statistical::SKEW([3, 4, 5, 2, 3, 4, 5, 6, 4, 7]), 1E-8); + self::assertEqualsWithDelta(0.6, Statistical::SLOPE([3, 6, 9, 12], [5, 10, 15, 20]), 1E-8); + self::assertEqualsWithDelta(3, Statistical::SMALL([1, 4, 8, 3, 7, 12, 54, 8, 23], 2), 1E-8); + self::assertEqualsWithDelta(1.333333333333, Statistical::STANDARDIZE(42, 40, 1.5), 1E-8); + self::assertEqualsWithDelta(27.463915719843, Statistical::STDEV([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); + self::assertEqualsWithDelta(0.577350269190, Statistical::STDEVA([true, false, 1]), 1E-8); + self::assertEqualsWithDelta(26.0545581424825, Statistical::STDEVP([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); + self::assertEqualsWithDelta(0.471404520791, Statistical::STDEVPA([true, false, 1]), 1E-8); + self::assertEqualsWithDelta(3.305718950210, Statistical::STEYX([2, 3, 9, 1, 8, 7, 5], [6, 5, 11, 7, 5, 4, 4]), 1E-8); + self::assertEqualsWithDelta(0.027322464988, Statistical::TDIST(1.959999998, 60, 1), 1E-8); + self::assertEqualsWithDelta(1.960041187127, Statistical::TINV(0.05464, 60), 1E-8); $trendExpected = [[ [133953.33333333334], [134971.51515151517], @@ -106,13 +106,13 @@ class MovedFunctionsTest extends TestCase ]]; $trendArg1 = [133890, 135000, 135790, 137300, 138130, 139100, 139900, 141120, 141890, 143230, 144000, 145290]; $trendArg2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - self::assertEqualsWithDelta($trendExpected, /** @scrutinizer ignore-deprecated */ Statistical::TREND($trendArg1, $trendArg2), 1E-8); - self::assertEqualsWithDelta(3.777777777778, /** @scrutinizer ignore-deprecated */ Statistical::TRIMMEAN([4, 5, 6, 7, 2, 3, 4, 5, 1, 2, 3], 0.2), 1E-8); - self::assertEqualsWithDelta(754.266666666667, /** @scrutinizer ignore-deprecated */ Statistical::VARFunc([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); - self::assertEqualsWithDelta(754.266666666667, /** @scrutinizer ignore-deprecated */ Statistical::VARA([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); - self::assertEqualsWithDelta(678.84, /** @scrutinizer ignore-deprecated */ Statistical::VARP([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); - self::assertEqualsWithDelta(0.222222222222, /** @scrutinizer ignore-deprecated */ Statistical::VARPA([true, false, 1]), 1E-8); - self::assertEqualsWithDelta(0.929581390070, /** @scrutinizer ignore-deprecated */ Statistical::WEIBULL(105, 20, 100, true), 1E-8); - self::assertEqualsWithDelta(0.090574196851, /** @scrutinizer ignore-deprecated */ Statistical::ZTEST([3, 6, 7, 8, 6, 5, 4, 2, 1, 9], 4), 1E-8); + self::assertEqualsWithDelta($trendExpected, Statistical::TREND($trendArg1, $trendArg2), 1E-8); + self::assertEqualsWithDelta(3.777777777778, Statistical::TRIMMEAN([4, 5, 6, 7, 2, 3, 4, 5, 1, 2, 3], 0.2), 1E-8); + self::assertEqualsWithDelta(754.266666666667, Statistical::VARFunc([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); + self::assertEqualsWithDelta(754.266666666667, Statistical::VARA([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); + self::assertEqualsWithDelta(678.84, Statistical::VARP([1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303, 1299]), 1E-8); + self::assertEqualsWithDelta(0.222222222222, Statistical::VARPA([true, false, 1]), 1E-8); + self::assertEqualsWithDelta(0.929581390070, Statistical::WEIBULL(105, 20, 100, true), 1E-8); + self::assertEqualsWithDelta(0.090574196851, Statistical::ZTEST([3, 6, 7, 8, 6, 5, 4, 2, 1, 9], 4), 1E-8); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DeprecatedTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DeprecatedTest.php index d6e50de05..8c37822d9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DeprecatedTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DeprecatedTest.php @@ -17,31 +17,31 @@ class DeprecatedTest extends TestCase { public function testDeprecated(): void { - self::assertSame('x', /** @scrutinizer ignore-deprecated */ TextData::TRIMNONPRINTABLE('x')); - self::assertSame('x y', /** @scrutinizer ignore-deprecated */ TextData::TRIMSPACES('x y')); - self::assertSame(48, /** @scrutinizer ignore-deprecated */ TextData::ASCIICODE('0')); - self::assertSame('abc', /** @scrutinizer ignore-deprecated */ TextData::CONCATENATE('a', 'b', 'c')); - self::assertSame('$1.00', /** @scrutinizer ignore-deprecated */ TextData::DOLLAR(1)); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ TextData::SEARCHSENSITIVE('b', 'abc')); - self::assertEquals(2, /** @scrutinizer ignore-deprecated */ TextData::SEARCHINSENSITIVE('b', 'abc')); - self::assertSame('1.00', /** @scrutinizer ignore-deprecated */ TextData::FIXEDFORMAT(1)); - self::assertSame('xyz', /** @scrutinizer ignore-deprecated */ TextData::LEFT('xyzw', 3)); - self::assertSame('yz', /** @scrutinizer ignore-deprecated */ TextData::MID('xyzw', 2, 2)); - self::assertSame('zw', /** @scrutinizer ignore-deprecated */ TextData::RIGHT('xyzw', 2)); - self::assertSame(4, /** @scrutinizer ignore-deprecated */ TextData::STRINGLENGTH('xyzw')); - self::assertSame('xyzw', /** @scrutinizer ignore-deprecated */ TextData::LOWERCASE('Xyzw')); - self::assertSame('XYZW', /** @scrutinizer ignore-deprecated */ TextData::UPPERCASE('Xyzw')); - self::assertSame('Xyzw', /** @scrutinizer ignore-deprecated */ TextData::PROPERCASE('xyzw')); - self::assertSame('xabw', /** @scrutinizer ignore-deprecated */ TextData::REPLACE('xyzw', 2, 2, 'ab')); - self::assertSame('xyzw', /** @scrutinizer ignore-deprecated */ TextData::TEXTFORMAT('xyzw', '@')); - self::assertEquals(3, /** @scrutinizer ignore-deprecated */ TextData::VALUE('3')); - self::assertEquals(3, /** @scrutinizer ignore-deprecated */ TextData::NUMBERVALUE('3')); - self::assertTrue(/** @scrutinizer ignore-deprecated */ TextData::EXACT('3', '3')); - self::assertSame('a,b,c', /** @scrutinizer ignore-deprecated */ TextData::TEXTJOIN(',', true, 'a', 'b', 'c')); - self::assertSame('aaa', /** @scrutinizer ignore-deprecated */ TextData::builtinREPT('a', 3)); - self::assertSame('ayxw', /** @scrutinizer ignore-deprecated */ TextData::SUBSTITUTE('xyxw', 'x', 'a', 1)); - self::assertSame('1', /** @scrutinizer ignore-deprecated */ TextData::CHARACTER('49')); - self::assertSame('0', /** @scrutinizer ignore-deprecated */ TextData::CHARACTER('48')); - self::assertSame('xyz', /** @scrutinizer ignore-deprecated */ TextData::RETURNSTRING('xyz')); + self::assertSame('x', TextData::TRIMNONPRINTABLE('x')); + self::assertSame('x y', TextData::TRIMSPACES('x y')); + self::assertSame(48, TextData::ASCIICODE('0')); + self::assertSame('abc', TextData::CONCATENATE('a', 'b', 'c')); + self::assertSame('$1.00', TextData::DOLLAR(1)); + self::assertEquals(2, TextData::SEARCHSENSITIVE('b', 'abc')); + self::assertEquals(2, TextData::SEARCHINSENSITIVE('b', 'abc')); + self::assertSame('1.00', TextData::FIXEDFORMAT(1)); + self::assertSame('xyz', TextData::LEFT('xyzw', 3)); + self::assertSame('yz', TextData::MID('xyzw', 2, 2)); + self::assertSame('zw', TextData::RIGHT('xyzw', 2)); + self::assertSame(4, TextData::STRINGLENGTH('xyzw')); + self::assertSame('xyzw', TextData::LOWERCASE('Xyzw')); + self::assertSame('XYZW', TextData::UPPERCASE('Xyzw')); + self::assertSame('Xyzw', TextData::PROPERCASE('xyzw')); + self::assertSame('xabw', TextData::REPLACE('xyzw', 2, 2, 'ab')); + self::assertSame('xyzw', TextData::TEXTFORMAT('xyzw', '@')); + self::assertEquals(3, TextData::VALUE('3')); + self::assertEquals(3, TextData::NUMBERVALUE('3')); + self::assertTrue(TextData::EXACT('3', '3')); + self::assertSame('a,b,c', TextData::TEXTJOIN(',', true, 'a', 'b', 'c')); + self::assertSame('aaa', TextData::builtinREPT('a', 3)); + self::assertSame('ayxw', TextData::SUBSTITUTE('xyxw', 'x', 'a', 1)); + self::assertSame('1', TextData::CHARACTER('49')); + self::assertSame('0', TextData::CHARACTER('48')); + self::assertSame('xyz', TextData::RETURNSTRING('xyz')); } } diff --git a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php index 9385a1a95..e479e2ade 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php @@ -86,7 +86,7 @@ class FunctionsTest extends TestCase public function testDeprecatedIsFormula(): void { - $result = /** @scrutinizer ignore-deprecated */ Functions::isFormula('="STRING"'); + $result = Functions::isFormula('="STRING"'); self::assertEquals(ExcelError::REF(), $result); } diff --git a/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php b/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php index c67145b25..1f1d85ee3 100644 --- a/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php +++ b/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php @@ -246,7 +246,7 @@ class CoordinateTest extends TestCase $cellRange = null; // @phpstan-ignore-next-line - Coordinate::buildRange(/** @scrutinizer ignore-type */ $cellRange); + Coordinate::buildRange($cellRange); } public function testBuildRangeInvalid2(): void diff --git a/tests/PhpSpreadsheetTests/Chart/GridlinesLineStyleTest.php b/tests/PhpSpreadsheetTests/Chart/GridlinesLineStyleTest.php index f4e011539..9251d25db 100644 --- a/tests/PhpSpreadsheetTests/Chart/GridlinesLineStyleTest.php +++ b/tests/PhpSpreadsheetTests/Chart/GridlinesLineStyleTest.php @@ -352,7 +352,7 @@ class GridlinesLineStyleTest extends AbstractFunctional $majorGridlines, $minorGridlines // minorGridlines ); - $majorGridlines2 = /** @scrutinizer ignore-deprecated */ $chart->getMajorGridlines(); + $majorGridlines2 = $chart->getMajorGridlines(); self::assertNotNull($majorGridlines2); self::assertEquals($width, $majorGridlines2->getLineStyleProperty('width')); self::assertEquals($compound, $majorGridlines2->getLineStyleProperty('compound')); @@ -368,7 +368,7 @@ class GridlinesLineStyleTest extends AbstractFunctional self::assertEquals('sm', $majorGridlines2->getLineStyleProperty(['arrow', 'end', 'w'])); self::assertEquals('lg', $majorGridlines2->getLineStyleProperty(['arrow', 'end', 'len'])); - $minorGridlines2 = /** @scrutinizer ignore-deprecated */ $chart->getMinorGridlines(); + $minorGridlines2 = $chart->getMinorGridlines(); self::assertNotNull($minorGridlines2); self::assertSame('00FF00', $minorGridlines2->getLineColorProperty('value')); self::assertSame(30, $minorGridlines2->getLineColorProperty('alpha')); diff --git a/tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php b/tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php index 393af1f88..711f87e24 100644 --- a/tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php +++ b/tests/PhpSpreadsheetTests/Functional/DrawingImageHyperlinkTest.php @@ -27,7 +27,7 @@ class DrawingImageHyperlinkTest extends AbstractFunctional $drawing->setName('In-Memory image 1'); $drawing->setDescription('In-Memory image 1'); $drawing->setCoordinates('A1'); - $drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); + $drawing->setImageResource($gdImage); $drawing->setRenderingFunction( MemoryDrawing::RENDERING_JPEG ); diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/XlsTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/XlsTest.php index 78b9539e4..4cdfc06f6 100644 --- a/tests/PhpSpreadsheetTests/Reader/Xls/XlsTest.php +++ b/tests/PhpSpreadsheetTests/Reader/Xls/XlsTest.php @@ -80,9 +80,8 @@ class XlsTest extends AbstractFunctional foreach ($row->getCellIterator() as $cellx) { /** @var Cell */ $cell = $cellx; - /** @scrutinizer ignore-call */ $valOld = $cell->getFormattedValue(); - $valNew = $newsheet->getCell($cell->/** @scrutinizer ignore-call */ getCoordinate())->getFormattedValue(); + $valNew = $newsheet->getCell($cell->getCoordinate())->getFormattedValue(); self::assertEquals($valOld, $valNew); } } diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilter2Test.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilter2Test.php index be67423f8..e14c6a24a 100644 --- a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilter2Test.php +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilter2Test.php @@ -38,14 +38,13 @@ class AutoFilter2Test extends TestCase self::assertCount(1, $columns); $column = $columns['A'] ?? null; self::assertNotNull($column); - /** @scrutinizer ignore-call */ $ruleset = $column->getRules(); self::assertCount(1, $ruleset); $rule = $ruleset[0]; self::assertSame(Rule::AUTOFILTER_RULETYPE_DATEGROUP, $rule->getRuleType()); $value = $rule->getValue(); self::assertIsArray($value); - self::assertCount(6, /** @scrutinizer ignore-type */ $value); + self::assertCount(6, $value); self::assertSame('2002', $value['year']); self::assertSame('', $value['month']); self::assertSame('', $value['day']); @@ -70,7 +69,6 @@ class AutoFilter2Test extends TestCase self::assertCount(1, $columns); $column = $columns['A'] ?? null; self::assertNotNull($column); - /** @scrutinizer ignore-call */ $ruleset = $column->getRules(); self::assertCount(1, $ruleset); $rule = $ruleset[0]; @@ -95,7 +93,6 @@ class AutoFilter2Test extends TestCase self::assertCount(1, $columns); $column = $columns['A'] ?? null; self::assertNotNull($column); - /** @scrutinizer ignore-call */ $ruleset = $column->getRules(); self::assertCount(1, $ruleset); $rule = $ruleset[0]; diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/RibbonTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/RibbonTest.php index 6a47b27d5..5a2037def 100644 --- a/tests/PhpSpreadsheetTests/Reader/Xlsx/RibbonTest.php +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/RibbonTest.php @@ -26,7 +26,7 @@ class RibbonTest extends AbstractFunctional self::assertSame('customUI/customUI.xml', $target); $data = $spreadsheet->getRibbonXMLData('data'); self::assertIsString($data); - self::assertSame(1522, strlen(/** @scrutinizer ignore-type */ $data)); + self::assertSame(1522, strlen($data)); $vbaCode = (string) $spreadsheet->getMacrosCode(); self::assertSame(13312, strlen($vbaCode)); self::assertNull($spreadsheet->getRibbonBinObjects()); @@ -60,7 +60,7 @@ class RibbonTest extends AbstractFunctional self::assertSame('customUI/customUI.xml', $target); $data = $spreadsheet->getRibbonXMLData('data'); self::assertIsString($data); - self::assertSame(1522, strlen(/** @scrutinizer ignore-type */ $data)); + self::assertSame(1522, strlen($data)); $vbaCode = (string) $spreadsheet->getMacrosCode(); self::assertSame(13312, strlen($vbaCode)); $spreadsheet->discardMacros(); diff --git a/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php b/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php index 33dba1328..ef9608b13 100644 --- a/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php +++ b/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php @@ -59,7 +59,7 @@ class XmlTest extends TestCase $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); $xmlReader = new Xml(); - $spreadsheet = /** @scrutinizer ignore-unhandled */ @$xmlReader->load('tests/data/Reader/Xml/CorruptedXmlFile.xml'); + $spreadsheet = @$xmlReader->load('tests/data/Reader/Xml/CorruptedXmlFile.xml'); self::assertNotSame('', $spreadsheet->getID()); } @@ -68,7 +68,7 @@ class XmlTest extends TestCase $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); $xmlReader = new Xml(); - $names = /** @scrutinizer ignore-unhandled */ @$xmlReader->listWorksheetNames('tests/data/Reader/Xml/CorruptedXmlFile.xml'); + $names = @$xmlReader->listWorksheetNames('tests/data/Reader/Xml/CorruptedXmlFile.xml'); self::assertNotEmpty($names); } @@ -77,7 +77,7 @@ class XmlTest extends TestCase $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); $xmlReader = new Xml(); - $info = /** @scrutinizer ignore-unhandled */ @$xmlReader->listWorksheetInfo('tests/data/Reader/Xml/CorruptedXmlFile.xml'); + $info = @$xmlReader->listWorksheetInfo('tests/data/Reader/Xml/CorruptedXmlFile.xml'); self::assertNotEmpty($info); } } diff --git a/tests/PhpSpreadsheetTests/Worksheet/ByColumnAndRowTest.php b/tests/PhpSpreadsheetTests/Worksheet/ByColumnAndRowTest.php index ca74c6cc9..2d07fb6c9 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ByColumnAndRowTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ByColumnAndRowTest.php @@ -18,7 +18,6 @@ class ByColumnAndRowTest extends TestCase $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); - /** @scrutinizer ignore-deprecated */ $sheet->setCellValueByColumnAndRow(2, 2, 2); self::assertSame(2, $sheet->getCell('B2')->getValue()); $spreadsheet->disconnectWorksheets(); @@ -29,7 +28,6 @@ class ByColumnAndRowTest extends TestCase $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); - /** @scrutinizer ignore-deprecated */ $sheet->setCellValueExplicitByColumnAndRow(2, 2, '="PHP Rules"', DataType::TYPE_STRING); self::assertSame('="PHP Rules"', $sheet->getCell('B2')->getValue()); self::assertSame(DataType::TYPE_STRING, $sheet->getCell('B2')->getDataType()); @@ -41,12 +39,12 @@ class ByColumnAndRowTest extends TestCase $spreadsheet = new Spreadsheet(); $sheet = $spreadsheet->getActiveSheet(); - $cellExists = /** @scrutinizer ignore-deprecated */ $sheet->cellExistsByColumnAndRow(2, 2); + $cellExists = $sheet->cellExistsByColumnAndRow(2, 2); self::assertFalse($cellExists); $sheet->setCellValue('B2', 2); - $cellExists = /** @scrutinizer ignore-deprecated */ $sheet->cellExistsByColumnAndRow(2, 2); + $cellExists = $sheet->cellExistsByColumnAndRow(2, 2); self::assertTrue($cellExists); $spreadsheet->disconnectWorksheets(); } @@ -57,7 +55,7 @@ class ByColumnAndRowTest extends TestCase $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B2', 2); - $cell = /** @scrutinizer ignore-deprecated */ $sheet->getCellByColumnAndRow(2, 2); + $cell = $sheet->getCellByColumnAndRow(2, 2); self::assertSame('B2', $cell->getCoordinate()); self::assertSame(2, $cell->getValue()); $spreadsheet->disconnectWorksheets(); @@ -72,10 +70,10 @@ class ByColumnAndRowTest extends TestCase $sheet->fromArray($data, null, 'B2', true); $sheet->getStyle('B2:C3')->getFont()->setBold(true); - $rangeStyle = /** @scrutinizer ignore-deprecated */ $sheet->getStyleByColumnAndRow(2, 2, 3, 3); + $rangeStyle = $sheet->getStyleByColumnAndRow(2, 2, 3, 3); self::assertTrue($rangeStyle->getFont()->getBold()); - $cellStyle = /** @scrutinizer ignore-deprecated */ $sheet->getStyleByColumnAndRow(2, 2); + $cellStyle = $sheet->getStyleByColumnAndRow(2, 2); self::assertTrue($cellStyle->getFont()->getBold()); $spreadsheet->disconnectWorksheets(); } @@ -86,7 +84,6 @@ class ByColumnAndRowTest extends TestCase $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValue('B2', 2); - /** @scrutinizer ignore-deprecated */ $sheet->setBreakByColumnAndRow(2, 2, Worksheet::BREAK_COLUMN); $breaks = $sheet->getBreaks(); @@ -103,7 +100,6 @@ class ByColumnAndRowTest extends TestCase $data = [['A', 'B'], ['C', 'D']]; $sheet->fromArray($data, null, 'B2', true); - /** @scrutinizer ignore-deprecated */ $sheet->mergeCellsByColumnAndRow(2, 2, 3, 3); $mergeRanges = $sheet->getMergeCells(); self::assertArrayHasKey('B2:C3', $mergeRanges); @@ -122,7 +118,6 @@ class ByColumnAndRowTest extends TestCase $mergeRanges = $sheet->getMergeCells(); self::assertArrayHasKey('B2:C3', $mergeRanges); - /** @scrutinizer ignore-deprecated */ $sheet->unmergeCellsByColumnAndRow(2, 2, 3, 3); $mergeRanges = $sheet->getMergeCells(); self::assertEmpty($mergeRanges); @@ -137,7 +132,6 @@ class ByColumnAndRowTest extends TestCase $data = [['A', 'B'], ['C', 'D']]; $sheet->fromArray($data, null, 'B2', true); - /** @scrutinizer ignore-deprecated */ $sheet->protectCellsByColumnAndRow(2, 2, 3, 3, 'secret', false); $protectedRanges = $sheet->getProtectedCells(); self::assertArrayHasKey('B2:C3', $protectedRanges); @@ -156,7 +150,6 @@ class ByColumnAndRowTest extends TestCase $protectedRanges = $sheet->getProtectedCells(); self::assertArrayHasKey('B2:C3', $protectedRanges); - /** @scrutinizer ignore-deprecated */ $sheet->unprotectCellsByColumnAndRow(2, 2, 3, 3); $protectedRanges = $sheet->getProtectedCells(); self::assertEmpty($protectedRanges); @@ -171,7 +164,6 @@ class ByColumnAndRowTest extends TestCase $data = [['A', 'B'], ['C', 'D']]; $sheet->fromArray($data, null, 'B2', true); - /** @scrutinizer ignore-deprecated */ $sheet->setAutoFilterByColumnAndRow(2, 2, 3, 3); $autoFilter = $sheet->getAutoFilter(); self::assertInstanceOf(AutoFilter::class, $autoFilter); @@ -187,7 +179,6 @@ class ByColumnAndRowTest extends TestCase $data = [['A', 'B'], ['C', 'D']]; $sheet->fromArray($data, null, 'B2', true); - /** @scrutinizer ignore-deprecated */ $sheet->freezePaneByColumnAndRow(2, 2); $freezePane = $sheet->getFreezePane(); self::assertSame('B2', $freezePane); @@ -204,7 +195,7 @@ class ByColumnAndRowTest extends TestCase ->getComment('B2') ->getText()->createTextRun('My Test Comment'); - $comment = /** @scrutinizer ignore-deprecated */ $sheet->getCommentByColumnAndRow(2, 2); + $comment = $sheet->getCommentByColumnAndRow(2, 2); self::assertInstanceOf(Comment::class, $comment); self::assertSame('My Test Comment', $comment->getText()->getPlainText()); $spreadsheet->disconnectWorksheets(); diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php index faf446d88..b57accb1d 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php @@ -42,12 +42,11 @@ class ColumnCellIteratorTest extends TestCase $values = []; foreach ($iterator as $key => $ColumnCell) { self::assertNotNull($ColumnCell); - /** @scrutinizer ignore-call */ $values[] = $ColumnCell->getValue(); self::assertEquals($ColumnCellIndexResult++, $key); self::assertInstanceOf(Cell::class, $ColumnCell); } - $transposed = array_map(/** @scrutinizer ignore-type */ null, ...self::CELL_VALUES); + $transposed = array_map(null, ...self::CELL_VALUES); self::assertSame($transposed[0], $values); $spreadsheet->disconnectWorksheets(); } @@ -63,7 +62,6 @@ class ColumnCellIteratorTest extends TestCase $values = []; foreach ($iterator as $key => $ColumnCell) { self::assertNotNull($ColumnCell); - /** @scrutinizer ignore-call */ $values[] = $ColumnCell->getValue(); self::assertEquals($ColumnCellIndexResult++, $key); self::assertInstanceOf(Cell::class, $ColumnCell); @@ -85,7 +83,6 @@ class ColumnCellIteratorTest extends TestCase while ($iterator->valid()) { $current = $iterator->current(); self::assertNotNull($current); - /** @scrutinizer ignore-call */ $cell = $current->getCoordinate(); $values[] = $sheet->getCell($cell)->getValue(); $iterator->prev(); diff --git a/tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php b/tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php index 668a6b5c6..4ab1ca2e2 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/DrawingTest.php @@ -28,7 +28,7 @@ class DrawingTest extends TestCase $drawing->setName('In-Memory image 1'); $drawing->setDescription('In-Memory image 1'); $drawing->setCoordinates('A1'); - $drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); + $drawing->setImageResource($gdImage); $drawing->setRenderingFunction( MemoryDrawing::RENDERING_JPEG ); diff --git a/tests/PhpSpreadsheetTests/Worksheet/MemoryDrawingTest.php b/tests/PhpSpreadsheetTests/Worksheet/MemoryDrawingTest.php index 313f85656..307496143 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/MemoryDrawingTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/MemoryDrawingTest.php @@ -26,7 +26,7 @@ class MemoryDrawingTest extends TestCase $drawing->setName($name); $drawing->setDescription('In-Memory image 1'); $drawing->setCoordinates('A1'); - $drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); + $drawing->setImageResource($gdImage); $drawing->setRenderingFunction(MemoryDrawing::RENDERING_PNG); $drawing->setMimeType(MemoryDrawing::MIMETYPE_PNG); diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php index d3980afa0..08736e3c8 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php @@ -42,7 +42,6 @@ class RowCellIteratorTest extends TestCase $values = []; foreach ($iterator as $key => $RowCell) { self::assertNotNull($RowCell); - /** @scrutinizer ignore-call */ $values[] = $RowCell->getValue(); self::assertEquals($RowCellIndexResult++, $key); self::assertInstanceOf(Cell::class, $RowCell); @@ -62,7 +61,6 @@ class RowCellIteratorTest extends TestCase $values = []; foreach ($iterator as $key => $RowCell) { self::assertNotNull($RowCell); - /** @scrutinizer ignore-call */ $values[] = $RowCell->getValue(); self::assertEquals($RowCellIndexResult++, $key); self::assertInstanceOf(Cell::class, $RowCell); @@ -84,7 +82,6 @@ class RowCellIteratorTest extends TestCase while ($iterator->valid()) { $current = $iterator->current(); self::assertNotNull($current); - /** @scrutinizer ignore-call */ $cell = $current->getCoordinate(); $values[] = $sheet->getCell($cell)->getValue(); $iterator->prev(); diff --git a/tests/PhpSpreadsheetTests/Writer/Html/MemoryDrawingOffsetTest.php b/tests/PhpSpreadsheetTests/Writer/Html/MemoryDrawingOffsetTest.php index ac6353cf2..ab2baea81 100644 --- a/tests/PhpSpreadsheetTests/Writer/Html/MemoryDrawingOffsetTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Html/MemoryDrawingOffsetTest.php @@ -24,7 +24,7 @@ class MemoryDrawingOffsetTest extends TestCase $image = imagecreatefromstring($image); self::assertNotFalse($image, 'unable to create image from string'); $drawing = new MemoryDrawing(); - $drawing->setImageResource(/** @scrutinizer ignore-type */ $image) + $drawing->setImageResource($image) ->setResizeProportional(false) //是否保持比例 ->setWidthAndHeight($w, $h) //图片宽高,原始尺寸 100*100 ->setOffsetX($x) diff --git a/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php b/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php index eb5308a9c..26c55a056 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php @@ -588,7 +588,7 @@ class DrawingsTest extends AbstractFunctional $drawing->setCoordinates2('D' . ((4 * $i) + 4)); $drawing->setEditAs($mode); - $drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage); + $drawing->setImageResource($gdImage); $drawing->setRenderingFunction( MemoryDrawing::RENDERING_JPEG ); diff --git a/tests/PhpSpreadsheetTests/Writer/Xlsx/MemoryDrawingTest.php b/tests/PhpSpreadsheetTests/Writer/Xlsx/MemoryDrawingTest.php index 885d599f3..67380e1ba 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xlsx/MemoryDrawingTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xlsx/MemoryDrawingTest.php @@ -56,7 +56,7 @@ class MemoryDrawingTest extends AbstractFunctional if ($gdImage === false) { self::fail('unexpected failure in imagecreatefromstring'); } else { - self::assertTrue(self::checkTransparent(/** @scrutinizer ignore-type */ $gdImage)); + self::assertTrue(self::checkTransparent($gdImage)); } } else { self::fail('Unexpected drawing not in Drawing class');