Files
PhpSpreadsheet/bin/generate-document
MarkBaker e0e5a81d69 Move documentation builder to infra so that it isn't included in non --dev composer downloads
Unit test for locale builder
Add new function stubs (as dummy) to Calculation list of functions
2021-05-28 22:35:37 +02:00

26 lines
907 B
PHP
Executable File

#!/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);
}