Scrutinizer

Fix 5 minor errors.
This commit is contained in:
Owen Leibman 2021-06-02 21:49:12 -07:00
parent 300ea99e93
commit 4ab6439de1
4 changed files with 2 additions and 6 deletions

View File

@ -689,7 +689,6 @@ class AutoFilter
private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn) private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
{ {
$ruleValues = []; $ruleValues = [];
$val = $maxVal = null;
$callBack = [__CLASS__, self::DATE_FUNCTIONS[$dynamicRuleType]]; // What if not found? $callBack = [__CLASS__, self::DATE_FUNCTIONS[$dynamicRuleType]]; // What if not found?
// Calculate start/end dates for the required date range based on current date // Calculate start/end dates for the required date range based on current date
// Val is lowest permitted value. // Val is lowest permitted value.

View File

@ -20,7 +20,7 @@ class AutoFilterQuarterTest extends TestCase
]; ];
} }
private static function setCells(Worksheet $sheet, int $startMonth): void private static function setCells(Worksheet $sheet): void
{ {
$sheet->getCell('A1')->setValue('Date'); $sheet->getCell('A1')->setValue('Date');
$sheet->getCell('A2')->setValue('=TODAY()'); $sheet->getCell('A2')->setValue('=TODAY()');
@ -45,8 +45,7 @@ class AutoFilterQuarterTest extends TestCase
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
$dtStart = new DateTimeImmutable(); $dtStart = new DateTimeImmutable();
$startDay = (int) $dtStart->format('d'); $startDay = (int) $dtStart->format('d');
$startMonth = (int) $dtStart->format('m'); self::setCells($sheet);
self::setCells($sheet, $startMonth);
$maxRow = 9; $maxRow = 9;
$autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter(); $autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter();

View File

@ -46,7 +46,6 @@ class AutoFilterWeekTest extends TestCase
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
$dtStart = new DateTimeImmutable(); $dtStart = new DateTimeImmutable();
$startDay = (int) $dtStart->format('d'); $startDay = (int) $dtStart->format('d');
$startMonth = (int) $dtStart->format('m');
self::setCells($sheet); self::setCells($sheet);
$maxRow = 9; $maxRow = 9;

View File

@ -84,7 +84,6 @@ class AutoFilterYearTest extends TestCase
$startDay = (int) $dtStart->format('d'); $startDay = (int) $dtStart->format('d');
$startMonth = (int) $dtStart->format('m'); $startMonth = (int) $dtStart->format('m');
$sheet->getCell('A1')->setValue('Date'); $sheet->getCell('A1')->setValue('Date');
$year = (int) $dtStart->format('Y');
$sheet->getCell('A2')->setValue('=TODAY()'); $sheet->getCell('A2')->setValue('=TODAY()');
$sheet->getCell('A3')->setValue('=DATE(YEAR(A2), 12, 31)'); $sheet->getCell('A3')->setValue('=DATE(YEAR(A2), 12, 31)');
$sheet->getCell('A4')->setValue('=A3 + 1'); $sheet->getCell('A4')->setValue('=A3 + 1');