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)
{
$ruleValues = [];
$val = $maxVal = null;
$callBack = [__CLASS__, self::DATE_FUNCTIONS[$dynamicRuleType]]; // What if not found?
// Calculate start/end dates for the required date range based on current date
// 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('A2')->setValue('=TODAY()');
@ -45,8 +45,7 @@ class AutoFilterQuarterTest extends TestCase
$sheet = $spreadsheet->getActiveSheet();
$dtStart = new DateTimeImmutable();
$startDay = (int) $dtStart->format('d');
$startMonth = (int) $dtStart->format('m');
self::setCells($sheet, $startMonth);
self::setCells($sheet);
$maxRow = 9;
$autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter();

View File

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

View File

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