mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 12:44:20 +01:00
Create Testcoverage and upgrade Symfomy and PHP
* Some tests * More tests! * Tests 3 * Move getScores from Candidate to Quiz * Add some suggestions for future refactoring * - **Add Gedmo doctrine-extensions and Stof bundle integration** - Added `stof/doctrine-extensions-bundle` and `gedmo/doctrine-extensions` dependencies. - Integrated `Timestampable` behavior for `Created` fields in entities. - Updated `bundles.php` to register StofDoctrineExtensionsBundle. - Added configuration for the Stof bundle. - Simplified `SeasonVoter` with `match` expression and added new tests. - Minor fixes and adjustments across various files. * WIP * All the tests * Base64 tests * Symfomny 7.4.0 * Update * Update recipe * PHP 8.5 * Rector changes * More 8.5 * Things
This commit is contained in:
@@ -55,6 +55,10 @@ class QuizSpreadsheetService
|
||||
/** @throws SpreadsheetDataException */
|
||||
public function xlsxToQuiz(Quiz $quiz, File $file): void
|
||||
{
|
||||
if (!$this->isSpreadsheetFile($file)) {
|
||||
throw new \InvalidArgumentException('File must be a valid XLSX spreadsheet');
|
||||
}
|
||||
|
||||
$spreadsheet = $this->readSheet($file);
|
||||
$sheet = $spreadsheet->getSheet($spreadsheet->getFirstSheetIndex());
|
||||
|
||||
@@ -112,7 +116,10 @@ class QuizSpreadsheetService
|
||||
}
|
||||
}
|
||||
|
||||
public function quizToXlsx(Quiz $quiz): void {}
|
||||
public function quizToXlsx(Quiz $quiz): void
|
||||
{
|
||||
throw new \Exception('Not implemented');
|
||||
}
|
||||
|
||||
private function toXlsx(Spreadsheet $spreadsheet): \Closure
|
||||
{
|
||||
@@ -120,4 +127,9 @@ class QuizSpreadsheetService
|
||||
|
||||
return static fn () => $writer->save('php://output');
|
||||
}
|
||||
|
||||
private function isSpreadsheetFile(File $file): bool
|
||||
{
|
||||
return 'xlsx' === $file->getExtension();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user