Skip to content

Commit 0fd5b81

Browse files
authored
Merge pull request #184 from Kharhamel/fix/composer
removed a useless composer dependency
2 parents eb13cdb + efd6526 commit 0fd5b81

File tree

3 files changed

+1
-341
lines changed

3 files changed

+1
-341
lines changed

generator/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"require": {
1010
"php": ">=7.1",
1111
"ext-simplexml": "*",
12-
"phpoffice/phpspreadsheet": "^1.4",
1312
"ext-json": "^1.5",
1413
"symfony/console": "^4.1.4",
1514
"symfony/process": "^4.1",

generator/composer.lock

Lines changed: 1 addition & 306 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generator/src/FileCreator.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,10 @@
33
namespace Safe;
44

55
use function array_merge;
6-
use Complex\Exception;
76
use function file_exists;
8-
use PhpOffice\PhpSpreadsheet\Spreadsheet;
9-
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
107

118
class FileCreator
129
{
13-
/**
14-
* This function generate an xls file
15-
*
16-
* @param string[] $protoFunctions
17-
* @param string $path
18-
*/
19-
public function generateXlsFile(array $protoFunctions, string $path): void
20-
{
21-
$spreadsheet = new Spreadsheet();
22-
$numb = 1;
23-
24-
$sheet = $spreadsheet->getActiveSheet();
25-
$sheet->setCellValue('A1', 'Function name');
26-
$sheet->setCellValue('B1', 'Status');
27-
28-
foreach ($protoFunctions as $protoFunction) {
29-
if ($protoFunction) {
30-
if (strpos($protoFunction, '=') === false && strpos($protoFunction, 'json') === false) {
31-
$status = 'classic';
32-
} elseif (strpos($protoFunction, 'json')) {
33-
$status = 'json';
34-
} else {
35-
$status = 'opt';
36-
}
37-
$sheet->setCellValue('A'.$numb, $protoFunction);
38-
$sheet->setCellValue('B'.$numb++, $status);
39-
}
40-
}
41-
$writer = new Xlsx($spreadsheet);
42-
$writer->save($path);
43-
}
4410

4511
/**
4612
* This function generate an improved php lib function in a php file

0 commit comments

Comments
 (0)