2020-02-21 05:56:43 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
2020-02-23 03:30:18 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
2020-02-21 05:56:43 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\DocumentGenerator;
|
|
|
|
|
2020-05-17 09:51:13 +00:00
|
|
|
require_once 'vendor/autoload.php';
|
2020-02-21 05:56:43 +00:00
|
|
|
|
|
|
|
try {
|
2020-02-23 03:30:18 +00:00
|
|
|
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions');
|
|
|
|
$phpSpreadsheetFunctionsProperty->setAccessible(true);
|
|
|
|
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
|
|
|
|
ksort($phpSpreadsheetFunctions);
|
|
|
|
|
|
|
|
file_put_contents(__DIR__ . '/../docs/references/function-list-by-category.md',
|
|
|
|
DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions)
|
|
|
|
);
|
|
|
|
file_put_contents(__DIR__ . '/../docs/references/function-list-by-name.md',
|
|
|
|
DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions)
|
|
|
|
);
|
2020-02-21 05:56:43 +00:00
|
|
|
} catch (ReflectionException $e) {
|
2020-05-17 09:51:13 +00:00
|
|
|
fwrite(STDERR, (string) $e);
|
2020-02-21 05:56:43 +00:00
|
|
|
exit(1);
|
|
|
|
}
|