Skip to content

Commit

Permalink
Move documentation builder to infra so that it isn't included in non …
Browse files Browse the repository at this point in the history
…`--dev` composer downloads

Unit test for locale builder
Add new function stubs (as dummy) to Calculation list of functions
  • Loading branch information
MarkBaker authored and MarkBaker committed May 28, 2021
1 parent 290c125 commit e0e5a81
Show file tree
Hide file tree
Showing 23 changed files with 320 additions and 226 deletions.
5 changes: 3 additions & 2 deletions bin/generate-document
Expand Up @@ -2,12 +2,13 @@
<?php

use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\DocumentGenerator;
use PhpOffice\PhpSpreadsheetInfra\DocumentGenerator;

require_once 'vendor/autoload.php';

try {
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))
->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty->setAccessible(true);
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
ksort($phpSpreadsheetFunctions);
Expand Down
8 changes: 5 additions & 3 deletions bin/generate-locales
Expand Up @@ -7,14 +7,16 @@ use PhpOffice\PhpSpreadsheetInfra\LocaleGenerator;
require_once 'vendor/autoload.php';

try {
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))
->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty->setAccessible(true);
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();

$localeGenerator = new LocaleGenerator(
__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/',
realpath(__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/'),
'Translations.xlsx',
$phpSpreadsheetFunctions
$phpSpreadsheetFunctions,
true
);
$localeGenerator->generateLocales();
} catch (\Exception $e) {
Expand Down
195 changes: 0 additions & 195 deletions build/buildFunctionLists.php

This file was deleted.

@@ -1,6 +1,6 @@
<?php

namespace PhpOffice\PhpSpreadsheet;
namespace PhpOffice\PhpSpreadsheetInfra;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
Expand Down

0 comments on commit e0e5a81

Please sign in to comment.