generate-document 904 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env php
  2. <?php
  3. use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
  4. use PhpOffice\PhpSpreadsheet\DocumentGenerator;
  5. require_once __DIR__ . '/../src/Bootstrap.php';
  6. try {
  7. $phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions');
  8. $phpSpreadsheetFunctionsProperty->setAccessible(true);
  9. $phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
  10. ksort($phpSpreadsheetFunctions);
  11. file_put_contents(__DIR__ . '/../docs/references/function-list-by-category.md',
  12. DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions)
  13. );
  14. file_put_contents(__DIR__ . '/../docs/references/function-list-by-name.md',
  15. DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions)
  16. );
  17. } catch (ReflectionException $e) {
  18. fwrite(STDERR, (string)$e);
  19. exit(1);
  20. }