From cbc08c2a3a9a1867abf67815c34e52cf6b3284e9 Mon Sep 17 00:00:00 2001 From: Matthew Brabham Date: Mon, 3 Jun 2019 12:14:30 -0700 Subject: [PATCH] Applying PSR2 code standards --- src/QnaParser.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/QnaParser.php b/src/QnaParser.php index 9c68d54..b390abd 100644 --- a/src/QnaParser.php +++ b/src/QnaParser.php @@ -86,6 +86,7 @@ private function parseQnaBotQuestions(array $qnaData): array ]; } } + return $workSheets; } @@ -110,8 +111,10 @@ private function createSheet(array $sheetData, Spreadsheet &$workBook) $myTempSheet = $workBook->createSheet(); $myTempSheet->setTitle($group); } catch (Exception $exception) { - printf("Failed to create a new sheet: %exception", - $exception); + printf( + "Failed to create a new sheet: %exception", + $exception + ); exit(1); } } @@ -120,11 +123,17 @@ private function createSheet(array $sheetData, Spreadsheet &$workBook) } foreach ($qna as $section) { $myTempSheet = $workBook->getSheetByName($group); - $myTempSheet->setCellValueByColumnAndRow(1, $row, - $section['q']); + $myTempSheet->setCellValueByColumnAndRow( + 1, + $row, + $section['q'] + ); $row += 1; - $myTempSheet->setCellValueByColumnAndRow(2, $row, - $section['a']); + $myTempSheet->setCellValueByColumnAndRow( + 2, + $row, + $section['a'] + ); $row += 1; } } @@ -141,8 +150,10 @@ private function saveWorkbook(string $outPutFile, Xlsx $writer) try { $writer->save($outPutFile); } catch (Exception $exception) { - echo sprintf("Failed to save Workbook %s", - $exception); + echo sprintf( + "Failed to save Workbook %s", + $exception + ); exit(1); } }