diff --git a/generator/composer.json b/generator/composer.json index 6016c6d9..d4c11301 100644 --- a/generator/composer.json +++ b/generator/composer.json @@ -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", diff --git a/generator/composer.lock b/generator/composer.lock index 8a27fd8c..f2a9e1eb 100644 --- a/generator/composer.lock +++ b/generator/composer.lock @@ -4,265 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "67d69047dcb7c1c66fab69c541961259", + "content-hash": "bd5e44c6f5e095f3aad94746c650977f", "packages": [ - { - "name": "markbaker/complex", - "version": "1.4.7", - "source": { - "type": "git", - "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000", - "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000", - "shasum": "" - }, - "require": { - "php": "^5.6.0|^7.0.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", - "phpcompatibility/php-compatibility": "^8.0", - "phpdocumentor/phpdocumentor": "2.*", - "phploc/phploc": "2.*", - "phpmd/phpmd": "2.*", - "phpunit/phpunit": "^4.8.35|^5.4.0", - "sebastian/phpcpd": "2.*", - "squizlabs/php_codesniffer": "^3.3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Complex\\": "classes/src/" - }, - "files": [ - "classes/src/functions/abs.php", - "classes/src/functions/acos.php", - "classes/src/functions/acosh.php", - "classes/src/functions/acot.php", - "classes/src/functions/acoth.php", - "classes/src/functions/acsc.php", - "classes/src/functions/acsch.php", - "classes/src/functions/argument.php", - "classes/src/functions/asec.php", - "classes/src/functions/asech.php", - "classes/src/functions/asin.php", - "classes/src/functions/asinh.php", - "classes/src/functions/atan.php", - "classes/src/functions/atanh.php", - "classes/src/functions/conjugate.php", - "classes/src/functions/cos.php", - "classes/src/functions/cosh.php", - "classes/src/functions/cot.php", - "classes/src/functions/coth.php", - "classes/src/functions/csc.php", - "classes/src/functions/csch.php", - "classes/src/functions/exp.php", - "classes/src/functions/inverse.php", - "classes/src/functions/ln.php", - "classes/src/functions/log2.php", - "classes/src/functions/log10.php", - "classes/src/functions/negative.php", - "classes/src/functions/pow.php", - "classes/src/functions/rho.php", - "classes/src/functions/sec.php", - "classes/src/functions/sech.php", - "classes/src/functions/sin.php", - "classes/src/functions/sinh.php", - "classes/src/functions/sqrt.php", - "classes/src/functions/tan.php", - "classes/src/functions/tanh.php", - "classes/src/functions/theta.php", - "classes/src/operations/add.php", - "classes/src/operations/subtract.php", - "classes/src/operations/multiply.php", - "classes/src/operations/divideby.php", - "classes/src/operations/divideinto.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mark Baker", - "email": "mark@lange.demon.co.uk" - } - ], - "description": "PHP Class for working with complex numbers", - "homepage": "https://github.com/MarkBaker/PHPComplex", - "keywords": [ - "complex", - "mathematics" - ], - "time": "2018-10-13T23:28:42+00:00" - }, - { - "name": "markbaker/matrix", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/MarkBaker/PHPMatrix.git", - "reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/5348c5a67e3b75cd209d70103f916a93b1f1ed21", - "reference": "5348c5a67e3b75cd209d70103f916a93b1f1ed21", - "shasum": "" - }, - "require": { - "php": "^5.6.0|^7.0.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "dev-master", - "phpcompatibility/php-compatibility": "dev-master", - "phploc/phploc": "^4", - "phpmd/phpmd": "dev-master", - "phpunit/phpunit": "^5.7", - "sebastian/phpcpd": "^3.0", - "squizlabs/php_codesniffer": "^3.0@dev" - }, - "type": "library", - "autoload": { - "psr-4": { - "Matrix\\": "classes/src/" - }, - "files": [ - "classes/src/functions/adjoint.php", - "classes/src/functions/antidiagonal.php", - "classes/src/functions/cofactors.php", - "classes/src/functions/determinant.php", - "classes/src/functions/diagonal.php", - "classes/src/functions/identity.php", - "classes/src/functions/inverse.php", - "classes/src/functions/minors.php", - "classes/src/functions/trace.php", - "classes/src/functions/transpose.php", - "classes/src/operations/add.php", - "classes/src/operations/directsum.php", - "classes/src/operations/subtract.php", - "classes/src/operations/multiply.php", - "classes/src/operations/divideby.php", - "classes/src/operations/divideinto.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mark Baker", - "email": "mark@lange.demon.co.uk" - } - ], - "description": "PHP Class for working with matrices", - "homepage": "https://github.com/MarkBaker/PHPMatrix", - "keywords": [ - "mathematics", - "matrix", - "vector" - ], - "time": "2019-10-06T11:29:25+00:00" - }, - { - "name": "phpoffice/phpspreadsheet", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "1648dc9ebef6ebe0c5a172e16cf66732918416e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/1648dc9ebef6ebe0c5a172e16cf66732918416e0", - "reference": "1648dc9ebef6ebe0c5a172e16cf66732918416e0", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-dom": "*", - "ext-fileinfo": "*", - "ext-gd": "*", - "ext-iconv": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-xml": "*", - "ext-xmlreader": "*", - "ext-xmlwriter": "*", - "ext-zip": "*", - "ext-zlib": "*", - "markbaker/complex": "^1.4", - "markbaker/matrix": "^1.2", - "php": "^7.1", - "psr/simple-cache": "^1.0" - }, - "require-dev": { - "dompdf/dompdf": "^0.8.3", - "friendsofphp/php-cs-fixer": "^2.16", - "jpgraph/jpgraph": "^4.0", - "mpdf/mpdf": "^8.0", - "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^7.5", - "squizlabs/php_codesniffer": "^3.5", - "tecnickcom/tcpdf": "^6.3" - }, - "suggest": { - "dompdf/dompdf": "Option for rendering PDF with PDF Writer", - "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", - "mpdf/mpdf": "Option for rendering PDF with PDF Writer", - "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" - }, - "type": "library", - "autoload": { - "psr-4": { - "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Maarten Balliauw", - "homepage": "https://blog.maartenballiauw.be" - }, - { - "name": "Mark Baker", - "homepage": "https://markbakeruk.net" - }, - { - "name": "Franck Lefevre", - "homepage": "https://rootslabs.net" - }, - { - "name": "Erik Tilt" - }, - { - "name": "Adrien Crivelli" - } - ], - "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", - "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", - "keywords": [ - "OpenXML", - "excel", - "gnumeric", - "ods", - "php", - "spreadsheet", - "xls", - "xlsx" - ], - "time": "2019-12-01T23:13:51+00:00" - }, { "name": "psr/container", "version": "1.0.0", @@ -312,54 +55,6 @@ ], "time": "2017-02-14T16:28:37+00:00" }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "time": "2017-10-23T01:57:42+00:00" - }, { "name": "symfony/console", "version": "v4.4.1", diff --git a/generator/src/FileCreator.php b/generator/src/FileCreator.php index 31646b2e..b4e5c29f 100644 --- a/generator/src/FileCreator.php +++ b/generator/src/FileCreator.php @@ -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