Skip to content

Commit

Permalink
Applying PSR2 code standards
Browse files Browse the repository at this point in the history
  • Loading branch information
emerham committed Jun 3, 2019
1 parent 1e5f935 commit cbc08c2
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/QnaParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private function parseQnaBotQuestions(array $qnaData): array
];
}
}

return $workSheets;
}

Expand All @@ -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);
}
}
Expand All @@ -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;
}
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit cbc08c2

Please sign in to comment.