p2 project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
907 B

#!/usr/bin/env php
<?php
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheetInfra\DocumentGenerator;
require_once 'vendor/autoload.php';
try {
$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)
);
} catch (ReflectionException $e) {
fwrite(STDERR, (string) $e);
exit(1);
}