@@ -437,7 +437,7 @@ |
||
437 | 437 | return in_array(strtolower($cellValue), explode(',', strtolower(trim($formula1, '"'))), true); |
438 | 438 | |
439 | 439 | } else if (strpos($formula1, ':') > 0) { // values list cells |
440 | - $match_formula = '=MATCH('.$this->getCoordinate().','.$formula1.',0)'; |
|
440 | + $match_formula = '=MATCH(' . $this->getCoordinate() . ',' . $formula1 . ',0)'; |
|
441 | 441 | |
442 | 442 | try { |
443 | 443 | $result = Calculation::getInstance( |
@@ -423,15 +423,17 @@ |
||
423 | 423 | $cellValue = $this->getValue(); |
424 | 424 | $cellValidation = $this->getDataValidation(); |
425 | 425 | |
426 | - if (!$cellValidation->getAllowBlank() && (is_null($cellValue) || $cellValue == "")) |
|
427 | - return false; |
|
426 | + if (!$cellValidation->getAllowBlank() && (is_null($cellValue) || $cellValue == "")) { |
|
427 | + return false; |
|
428 | + } |
|
428 | 429 | |
429 | 430 | // TODO: write check on all cases |
430 | 431 | switch ($cellValidation->getType()) { |
431 | 432 | case Cell\DataValidation::TYPE_LIST: |
432 | 433 | $formula1 = $cellValidation->getFormula1(); |
433 | - if (empty($formula1)) |
|
434 | - break; |
|
434 | + if (empty($formula1)) { |
|
435 | + break; |
|
436 | + } |
|
435 | 437 | |
436 | 438 | if ($formula1[0] == '"') { // inline values list |
437 | 439 | return in_array(strtolower($cellValue), explode(',', strtolower(trim($formula1, '"'))), true); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $testCell = $sheet->getCell('A1'); |
333 | 333 | |
334 | 334 | $validation = $testCell->getDataValidation(); |
335 | - $validation->setType( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST ); |
|
335 | + $validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST); |
|
336 | 336 | |
337 | 337 | // blank value |
338 | 338 | $testCell->setValue(""); |
@@ -352,11 +352,11 @@ discard block |
||
352 | 352 | $sheet->getCell('B1')->setValue(5); |
353 | 353 | $sheet->getCell('B2')->setValue(6); |
354 | 354 | $sheet->getCell('B3')->setValue(7); |
355 | - $testCell = $sheet->getCell('A1'); // redefine $testCell, because it has broken coordinates after using other cells |
|
355 | + $testCell = $sheet->getCell('A1'); // redefine $testCell, because it has broken coordinates after using other cells |
|
356 | 356 | $validation->setFormula1('B1:B3'); |
357 | 357 | $testCell->setValue("10"); |
358 | 358 | self::assertEquals(false, $testCell->hasValidValue(), "cell value ('10') is not allowed"); |
359 | - $testCell = $sheet->getCell('A1'); // redefine $testCell, because it has broken coordinates after using other cells |
|
359 | + $testCell = $sheet->getCell('A1'); // redefine $testCell, because it has broken coordinates after using other cells |
|
360 | 360 | $testCell->setValue("5"); |
361 | 361 | self::assertEquals(true, $testCell->hasValidValue(), "cell value ('5') has to be allowed"); |
362 | 362 | } |