Skip to content

Commit

Permalink
Merge pull request #184 from Kharhamel/fix/composer
Browse files Browse the repository at this point in the history
removed a useless composer dependency
  • Loading branch information
Kharhamel authored Jan 10, 2020
2 parents eb13cdb + efd6526 commit 0fd5b81
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 341 deletions.
1 change: 0 additions & 1 deletion generator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"require": {
"php": ">=7.1",
"ext-simplexml": "*",
"phpoffice/phpspreadsheet": "^1.4",
"ext-json": "^1.5",
"symfony/console": "^4.1.4",
"symfony/process": "^4.1",
Expand Down
307 changes: 1 addition & 306 deletions generator/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions generator/src/FileCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,10 @@
namespace Safe;

use function array_merge;
use Complex\Exception;
use function file_exists;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

class FileCreator
{
/**
* This function generate an xls file
*
* @param string[] $protoFunctions
* @param string $path
*/
public function generateXlsFile(array $protoFunctions, string $path): void
{
$spreadsheet = new Spreadsheet();
$numb = 1;

$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Function name');
$sheet->setCellValue('B1', 'Status');

foreach ($protoFunctions as $protoFunction) {
if ($protoFunction) {
if (strpos($protoFunction, '=') === false && strpos($protoFunction, 'json') === false) {
$status = 'classic';
} elseif (strpos($protoFunction, 'json')) {
$status = 'json';
} else {
$status = 'opt';
}
$sheet->setCellValue('A'.$numb, $protoFunction);
$sheet->setCellValue('B'.$numb++, $status);
}
}
$writer = new Xlsx($spreadsheet);
$writer->save($path);
}

/**
* This function generate an improved php lib function in a php file
Expand Down

0 comments on commit 0fd5b81

Please # to comment.