Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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