diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 0eeaaa3b67..fb50aeaf51 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -3,6 +3,7 @@ $finder = PhpCsFixer\Finder::create() ->exclude('vendor') ->notPath('src/PhpSpreadsheet/Writer/ZipStream3.php') + ->name('/(\.php|^generate-document|^generate-locales)$/') ->in(__DIR__); $config = new PhpCsFixer\Config(); diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index ba381a28f7..d902156dc8 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -6,6 +6,8 @@ src tests infra + bin/generate-document + bin/generate-locales samples/Header.php */tests/Core/*/*Test\.(inc|css|js)$ diff --git a/bin/generate-document b/bin/generate-document index a8f334c9cb..ec8be555a5 100755 --- a/bin/generate-document +++ b/bin/generate-document @@ -6,20 +6,14 @@ 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); +$phpSpreadsheetFunctions = Calculation::getFunctions(); +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); -} +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) +); diff --git a/bin/generate-locales b/bin/generate-locales index 30b9c55657..724a0cabff 100644 --- a/bin/generate-locales +++ b/bin/generate-locales @@ -6,20 +6,12 @@ use PhpOffice\PhpSpreadsheetInfra\LocaleGenerator; require_once 'vendor/autoload.php'; -try { - $phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class)) - ->getProperty('phpSpreadsheetFunctions'); - $phpSpreadsheetFunctionsProperty->setAccessible(true); - $phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue(); +$phpSpreadsheetFunctions = Calculation::getFunctions(); - $localeGenerator = new LocaleGenerator( - realpath(__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/'), - 'Translations.xlsx', - $phpSpreadsheetFunctions, - true - ); - $localeGenerator->generateLocales(); -} catch (\Exception $e) { - fwrite(STDERR, (string) $e); - exit(1); -} +$localeGenerator = new LocaleGenerator( + __DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/', + 'Translations.xlsx', + $phpSpreadsheetFunctions, + true +); +$localeGenerator->generateLocales(); diff --git a/docs/extra/extra.css b/docs/extra/extra.css index 2addeb79e4..704819d7a3 100644 --- a/docs/extra/extra.css +++ b/docs/extra/extra.css @@ -6,3 +6,14 @@ table.features-cross-reference { .rst-content table.features-cross-reference.docutils td { background-color: white; } + +/* https://github.com/mkdocs/mkdocs/discussions/3035#discussioncomment-7237037 */ +.wy-table-responsive table td, .wy-table-responsive table th { + white-space: normal !important; +} +.wy-table-responsive { + overflow : visible !important; +} + +/* https://github.com/readthedocs/sphinx_rtd_theme/issues/295#issuecomment-455226058 */ +.wy-nav-content {max-width: none;} diff --git a/docs/references/features-cross-reference.md b/docs/references/features-cross-reference.md index d18c0969d9..37668ba82d 100644 --- a/docs/references/features-cross-reference.md +++ b/docs/references/features-cross-reference.md @@ -5,33 +5,26 @@ - Not supported - N/A Cannot be supported +## Readers + - - - + - + - - - - - - - - + @@ -39,32 +32,18 @@ - - - - - - - - + - + - - - - - - - - + @@ -75,14 +54,7 @@ - - - - - - - - + @@ -91,19 +63,12 @@ - - - - - - - - - - + + + - + @@ -111,17 +76,10 @@ - - - - - - - - + @@ -130,13 +88,6 @@ - - - - - - - @@ -148,13 +99,6 @@ - - - - - - - @@ -166,13 +110,6 @@ - - - - - - - @@ -184,13 +121,6 @@ - - - - - - - @@ -202,13 +132,6 @@ - - - - - - - @@ -220,13 +143,6 @@ - - - - - - - @@ -238,13 +154,6 @@ - - - - - - - @@ -256,13 +165,6 @@ - - - - - - - @@ -274,16 +176,9 @@ - - - - - - - - + @@ -291,14 +186,7 @@ - - - - - - - @@ -309,14 +197,7 @@ - - - - - - - @@ -327,14 +208,7 @@ - - - - - - - @@ -345,17 +219,10 @@ - - - - - - - - + @@ -363,14 +230,7 @@ - - - - - - - @@ -381,14 +241,7 @@ - - - - - - - @@ -399,14 +252,7 @@ - - - - - - - @@ -417,14 +263,7 @@ - - - - - - - @@ -435,26 +274,12 @@ - - - - - - - - - - - - - + - - @@ -464,431 +289,890 @@ - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - + + + + - - - - - - - - - - + + - - - - - - + + - - - - - + + - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - - - - + + + - - - - - + + + + - - - - - - - - - - + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ReadersWritersMethodsReaders
XLS XLSXXML (Excel2003XML)Excel2003XML Ods Gnumeric CSV SYLKXLSXLSXOdsCSV HTMLPDFGettersSetters
Reader OptionsReader Options N/A N/AN/AN/AN/AN/AN/AN/A
Read Data Only (no formatting) N/A N/AN/AN/AN/AN/AN/AN/A$reader->getReadDataOnly()$reader->setReadDataOnly()
Read Only Specified Worksheets N/A N/AN/AN/AN/AN/AN/AN/A$reader->getLoadSheetsOnly()$reader->setLoadSheetsOnly()
$reader->setLoadAllSheets()
Read Only Specified Cells N/AN/AN/AN/AN/AN/AN/AN/A$reader->getReadFilter()$reader->setReadFilter()
Document PropertiesDocument Properties N/A N/A N/AN/A
Standard PropertiesStandard Properties N/A N/A N/AN/A
CreatorN/A N/A N/A$spreadsheet->getProperties()->getCreator()$spreadsheet->getProperties()->setCreator()
Creation Date/TimeN/A N/A N/AN/A$spreadsheet->getProperties()->getCreated()$spreadsheet->getProperties()->setCreated()
ModifierN/A N/A N/AN/A$spreadsheet->getProperties()->getLastModifiedBy()$spreadsheet->getProperties()->setLastModifiedBy()
Modified Date/TimeN/A N/A N/AN/A$spreadsheet->getProperties()->getModified()$spreadsheet->getProperties()->setModified()
TitleN/A N/A N/A$spreadsheet->getProperties()->getTitle()$spreadsheet->getProperties()->setTitle()
DescriptionN/A N/A N/AN/A$spreadsheet->getProperties()->getDescription()$spreadsheet->getProperties()->setDescription()
SubjectN/A N/A N/A$spreadsheet->getProperties()->getSubject()$spreadsheet->getProperties()->setSubject()
KeywordsN/A N/A N/A$spreadsheet->getProperties()->getKeywords()$spreadsheet->getProperties()->setKeywords()
Extended PropertiesExtended Properties N/A N/A N/AN/A
Category N/A N/A N/AN/A$spreadsheet->getProperties()->getCategory()$spreadsheet->getProperties()->setCategory()
Company N/A N/A N/AN/A$spreadsheet->getProperties()->getCompany()$spreadsheet->getProperties()->setCompany()
Manager N/A N/A N/AN/A$spreadsheet->getProperties()->getManager()$spreadsheet->getProperties()->setManager()
User-Defined (Custom) PropertiesUser-Defined (Custom) Properties N/A N/A N/A N/AN/A$spreadsheet->getProperties()->getCustomProperties()
$spreadsheet->getProperties()->isCustomPropertySet()
$spreadsheet->getProperties()->getCustomPropertyValue()
$spreadsheet->getProperties()->getCustomPropertyType()
$spreadsheet->getProperties()->setCustomProperty()
Text PropertiesN/A N/A N/A N/AN/A
Number PropertiesN/A N/A N/A N/AN/A
Date PropertiesN/A N/A N/A N/AN/A
Yes/No (Boolean) PropertiesN/A N/A N/A N/AN/A
Cell Data TypesCell Data Types
Empty/NULL
Boolean
Integer
Floating Point
Floating Point
String
Error
Formula
Array
Rich Text N/A N/A
Conditional FormattingConditional Formatting N/A N/AN/A
Rows and Column PropertiesRows and Column PropertiesN/AN/A
Row Height/Column Width N/AN/A
Hidden N/AN/A
Worksheet PropertiesWorksheet Properties N/AN/A
Frozen PanesFrozen Panes N/AN/AN/A
Hidden WorksheetsHidden Worksheets N/AN/A
Coloured TabsN/AN/AN/A
Drawing hyperlinkN/AN/A
Cell FormattingN/A
Number Format MaskN/A
AlignmentN/A
HorizontalN/A
VerticalN/A
WrappingN/A
Shrink-to-FitN/A
IndentN/A
Background ColourN/A
PatternedN/A
Font AttributesN/A
Font FaceN/A
Font SizeN/A
BoldN/A
ItalicN/A
StrikethroughN/A
UnderlineN/A
SuperscriptN/A
SubscriptN/A
BordersN/A
Line StyleN/A
PositionN/A
DiagonalN/A
Hyperlinks
httpN/A
Merged CellsN/A
Cell CommentsN/A
Rich Text2N/AN/A
Alignment3N/A
Background ImageN/A
Cell ValidationN/AN/AN/A
AutoFiltersN/AN/AN/A
AutoFilter ExpressionsN/AN/AN/A
FilterN/AN/AN/A
Custom FilterN/AN/AN/A
Date FilterN/AN/AN/A
Dynamic FilterN/AN/AN/A
Colour FilterN/AN/AN/A
Icon FilterN/AN/AN/A
Top 10 FilterN/AN/AN/A
Macros
Form Controls
Security
Protection (prevent editing)
Encryption (prevent viewing)
XLSXLSXExcel2003XMLOdsGnumericCSVSYLKHTML
Readers
+ +1. Only text contents +2. Only BIFF8 files support Rich Text. Prior to that, comments could only be plain text +3. Only BIFF8 files support alignment and rotation. Prior to that, comments could only be unformatted text + +## Writers + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - - - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - + + - - + + - - - - - - - - - - + - - - - - + + - - - - - - - - - - + + + + - - - - - + + - - - - - - - - - - + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - + - - - - + + + + + + + + @@ -897,34 +1181,25 @@ - - - - - + + + + + + - - - - - - - - - - - - - - - + - - - - + + + + + + + + @@ -933,214 +1208,133 @@ - - - - - + + - - - - - - + + + + + + + - - - + + + + + - - - - - + + - - - - - - - - - - + + + + - - - - - + + - - - - - - - - - - + + + + - - + - - + + + + + + + + - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - + - - - - + + + + + + + + @@ -1149,88 +1343,79 @@ - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + - - - + + + + - - - - - + + + - - - - - - - - - - + + + + + + + + + + @@ -1239,391 +1424,405 @@ - + - + + - - - - - - - - - - - - - - - + + + - - - - - - - - - + + - - - + + - - + + + + + - - - - + + - - + + + + + + + + + + - - - + + + + + + - + - - - + + + + + + + + + + + + - - - - - - - - - - + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + - - - - - - - - - - - - + + + + - + - + + + + + + + + + + + + - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + +
Writers
XLSXLSXOdsCSVHTMLPDF
Document Properties
Standard Properties
Coloured TabsCreatorN/A
Creation Date/TimeN/A
ModifierN/A
Modified Date/TimeN/A
TitleN/A
DescriptionN/A
SubjectN/A
Keywords N/A
Drawing hyperlinkExtended Properties $drawing->getHyperlink()->getUrl()$drawing->setHyperlink()->setUrl($url)
Cell FormattingCategoryN/A
Number Format MaskCompany N/A
AlignmentManager N/A
HorizontalUser-Defined (Custom) Properties N/AN/A
VerticalRich TextN/A
WrappingConditional Formatting
Rows and Column Properties
Shring-to-FitRow Height/Column WidthN/A
IndentHidden N/A
Worksheet Properties
Background ColourFrozen Panes N/A
Hidden Worksheets N/A
PatternedColoured Tabs N/A
Font AttributesDrawing hyperlink N/A
Font FaceCell Formatting
Number Format MaskN/A
Font SizeAlignmentN/A
BoldHorizontalN/A
ItalicVerticalN/A
StrikethroughWrappingN/A
UnderlineShrink-to-FitN/A
SuperscriptIndentN/A
SubscriptBackground ColourN/A
BordersPatterned N/A
Font Attributes
Line StyleFont FaceN/A
PositionFont SizeN/A
DiagonalBoldN/A
ItalicN/A
StrikethroughN/A
HyperlinksUnderline N/A
Superscript $cell->getHyperlink()->getUrl($url)$cell->getHyperlink()->setUrl($url)N/A
httpSubscriptN/A
Borders
Merged CellsLine Style N/A N/AN/A
Cell CommentsPosition N/AN/AN/A1N/A
Rich Text2Diagonal N/AN/AN/A
Hyperlinks N/AN/A
Alignment3http N/A
Merged Cells N/AN/AN/A
Cell Comments N/A1 N/A
Background ImageRich Text N/AN/A
Alignment N/A N/A
Background Image $comment->getBackgroundImage()$comment->setBackgroundImage()
Cell ValidationN/AN/ACell Validation N/A N/A N/A$cell->getDataValidation()$cell->setDataValidation()
AutoFiltersAutoFilters $sheet->getAutoFilter()$sheet->setAutoFilter()
AutoFilter ExpressionsAutoFilter ExpressionsN/AN/AN/A
Filter N/AN/AN/A
Custom Filter N/AN/AN/A
DateGroup Filter
Dynamic Filter
Colour Filter
Icon FilterN/AN/AN/A
Top 10 FilterDynamic Filter N/AN/AN/A
MacrosColour Filter N/AN/AN/A
Icon Filter N/AN/AN/A
Top 10 Filter $spreadsheet->getMacrosCode();$spreadsheet->setMacrosCode();N/AN/AN/A
Form ControlsMacros N/A
SecurityForm Controls N/A
Security
Protection (prevent editing) N/A $sheet->getProtection()$sheet->getProtection()->setSheet(true)
Encryption (prevent viewing) N/A
XLS XLSXExcel2003XMLOdsGnumericCSVSYLKXLSXLSX Ods CSV HTML PDF
Writers
+ +## Setters and Getters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
Methods
GettersSetters
Reader Options
Read Data Only (no formatting)$reader->getReadDataOnly()$reader->setReadDataOnly()
Read Only Specified Worksheets$reader->getLoadSheetsOnly()$reader->setLoadSheetsOnly()
$reader->setLoadAllSheets()
Read Only Specified Cells$reader->getReadFilter()$reader->setReadFilter()
Document Properties
Standard Properties
Creator$spreadsheet->getProperties()->getCreator()$spreadsheet->getProperties()->setCreator()
Creation Date/Time$spreadsheet->getProperties()->getCreated()$spreadsheet->getProperties()->setCreated()
Modifier$spreadsheet->getProperties()->getLastModifiedBy()$spreadsheet->getProperties()->setLastModifiedBy()
Modified Date/Time$spreadsheet->getProperties()->getModified()$spreadsheet->getProperties()->setModified()
Title$spreadsheet->getProperties()->getTitle()$spreadsheet->getProperties()->setTitle()
Description$spreadsheet->getProperties()->getDescription()$spreadsheet->getProperties()->setDescription()
Subject$spreadsheet->getProperties()->getSubject()$spreadsheet->getProperties()->setSubject()
Keywords$spreadsheet->getProperties()->getKeywords()$spreadsheet->getProperties()->setKeywords()
Extended Properties
Category$spreadsheet->getProperties()->getCategory()$spreadsheet->getProperties()->setCategory()
Company$spreadsheet->getProperties()->getCompany()$spreadsheet->getProperties()->setCompany()
Manager$spreadsheet->getProperties()->getManager()$spreadsheet->getProperties()->setManager()
User-Defined (Custom) Properties$spreadsheet->getProperties()->getCustomProperties()
$spreadsheet->getProperties()->isCustomPropertySet()
$spreadsheet->getProperties()->getCustomPropertyValue()
$spreadsheet->getProperties()->getCustomPropertyType()
$spreadsheet->getProperties()->setCustomProperty()
$drawing->getHyperlink()->getUrl()$drawing->setHyperlink()->setUrl($url)
$cell->getHyperlink()->getUrl($url)$cell->getHyperlink()->setUrl($url)
Cell Comments
Background Image$comment->getBackgroundImage()$comment->setBackgroundImage()
Cell Validation$cell->getDataValidation()$cell->setDataValidation()
AutoFilters$sheet->getAutoFilter()$sheet->setAutoFilter()
Macros$spreadsheet->getMacrosCode();$spreadsheet->setMacrosCode();
Security
Protection (prevent editing)$sheet->getProtection()$sheet->getProtection()->setSheet(true)
Getters Setters
ReadersWriters Methods
- -1. Only text contents -2. Only BIFF8 files support Rich Text. Prior to that, comments could only be plain text -3. Only BIFF8 files support alignment and rotation. Prior to that, comments could only be unformatted text diff --git a/docs/references/function-list-by-category.md b/docs/references/function-list-by-category.md index d88d87dffd..353458ca40 100644 --- a/docs/references/function-list-by-category.md +++ b/docs/references/function-list-by-category.md @@ -200,6 +200,7 @@ ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Information\Err ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isNonText ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isNumber ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isOdd +ISOMITTED | **Not yet Implemented** ISREF | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isRef ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isText N | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::asNumber @@ -213,13 +214,21 @@ TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Information\Val Excel Function | PhpSpreadsheet Function -------------------------|-------------------------------------- AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::logicalAnd +BYCOL | **Not yet Implemented** +BYROW | **Not yet Implemented** FALSE | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Boolean::FALSE IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional::statementIf IFERROR | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional::IFERROR IFNA | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional::IFNA IFS | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional::IFS +LAMBDA | **Not yet Implemented** +LET | **Not yet Implemented** +MAKEARRAY | **Not yet Implemented** +MAP | **Not yet Implemented** NOT | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::NOT OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::logicalOr +REDUCE | **Not yet Implemented** +SCAN | **Not yet Implemented** SWITCH | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Conditional::statementSwitch TRUE | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Boolean::TRUE XOR | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::logicalXor @@ -513,7 +522,7 @@ ZTEST | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Dis Excel Function | PhpSpreadsheet Function -------------------------|-------------------------------------- -ARRAYTOTEXT | **Not yet Implemented** +ARRAYTOTEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::fromArray ASC | **Not yet Implemented** BAHTTEXT | **Not yet Implemented** CHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert::character @@ -550,10 +559,10 @@ SEARCHB | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Search SUBSTITUTE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace::substitute T | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::test TEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::TEXTFORMAT -TEXTAFTER | **Not yet Implemented** -TEXTBEFORE | **Not yet Implemented** +TEXTAFTER | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::after +TEXTBEFORE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::before TEXTJOIN | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::TEXTJOIN -TEXTSPLIT | **Not yet Implemented** +TEXTSPLIT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::split THAIDIGIT | **Not yet Implemented** THAINUMSOUND | **Not yet Implemented** THAINUMSTRING | **Not yet Implemented** @@ -563,7 +572,7 @@ UNICHAR | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Charac UNICODE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert::code UPPER | \PhpOffice\PhpSpreadsheet\Calculation\TextData\CaseConvert::upper VALUE | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::VALUE -VALUETOTEXT | **Not yet Implemented** +VALUETOTEXT | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::valueToText ## CATEGORY_WEB @@ -572,3 +581,10 @@ Excel Function | PhpSpreadsheet Function ENCODEURL | \PhpOffice\PhpSpreadsheet\Calculation\Web\Service::urlEncode FILTERXML | **Not yet Implemented** WEBSERVICE | \PhpOffice\PhpSpreadsheet\Calculation\Web\Service::webService + +## CATEGORY_UNCATEGORISED + +Excel Function | PhpSpreadsheet Function +-------------------------|-------------------------------------- +ANCHORARRAY | **Not yet Implemented** +SINGLE | **Not yet Implemented** diff --git a/docs/references/function-list-by-name.md b/docs/references/function-list-by-name.md index 7f91133b93..24c7f823ef 100644 --- a/docs/references/function-list-by-name.md +++ b/docs/references/function-list-by-name.md @@ -15,10 +15,11 @@ ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpread AGGREGATE | CATEGORY_MATH_AND_TRIG | **Not yet Implemented** AMORDEGRC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization::AMORDEGRC AMORLINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization::AMORLINC +ANCHORARRAY | CATEGORY_UNCATEGORISED | **Not yet Implemented** AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations::logicalAnd ARABIC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Arabic::evaluate AREAS | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented** -ARRAYTOTEXT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +ARRAYTOTEXT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::fromArray ASC | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** ASIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::asin ASINH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::asinh @@ -57,6 +58,8 @@ BITLSHIFT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpread BITOR | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise::BITOR BITRSHIFT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise::BITRSHIFT BITXOR | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise::BITXOR +BYCOL | CATEGORY_LOGICAL | **Not yet Implemented** +BYROW | CATEGORY_LOGICAL | **Not yet Implemented** ## C @@ -305,6 +308,7 @@ ISNONTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpread ISNUMBER | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isNumber ISO.CEILING | CATEGORY_MATH_AND_TRIG | **Not yet Implemented** ISODD | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isOdd +ISOMITTED | CATEGORY_INFORMATION | **Not yet Implemented** ISOWEEKNUM | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Week::isoWeekNumber ISPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest::schedulePayment ISREF | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Information\Value::isRef @@ -327,12 +331,14 @@ KURT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpread Excel Function | Category | PhpSpreadsheet Function -------------------------|--------------------------------|-------------------------------------- +LAMBDA | CATEGORY_LOGICAL | **Not yet Implemented** LARGE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Size::large LCM | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Lcm::evaluate LEFT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::left LEFTB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::left LEN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::length LENB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::length +LET | CATEGORY_LOGICAL | **Not yet Implemented** LINEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends::LINEST LN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Logarithms::natural LOG | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Logarithms::withBase @@ -349,6 +355,8 @@ LOWER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpread Excel Function | Category | PhpSpreadsheet Function -------------------------|--------------------------------|-------------------------------------- +MAKEARRAY | CATEGORY_LOGICAL | **Not yet Implemented** +MAP | CATEGORY_LOGICAL | **Not yet Implemented** MATCH | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef\ExcelMatch::MATCH MAX | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Maximum::max MAXA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Maximum::maxA @@ -468,6 +476,7 @@ RANK.AVG | CATEGORY_STATISTICAL | **Not yet Implemente RANK.EQ | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Percentiles::RANK RATE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\CashFlow\Constant\Periodic\Interest::rate RECEIVED | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\Price::received +REDUCE | CATEGORY_LOGICAL | **Not yet Implemented** REPLACE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace::replace REPLACEB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Replace::replace REPT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::builtinREPT @@ -489,6 +498,7 @@ RTD | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemente Excel Function | Category | PhpSpreadsheet Function -------------------------|--------------------------------|-------------------------------------- +SCAN | CATEGORY_LOGICAL | **Not yet Implemented** SEARCH | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Search::insensitive SEARCHB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Search::insensitive SEC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Secant::sec @@ -500,6 +510,7 @@ SHEET | CATEGORY_INFORMATION | **Not yet Implemente SHEETS | CATEGORY_INFORMATION | **Not yet Implemented** SIGN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sign::evaluate SIN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::sin +SINGLE | CATEGORY_UNCATEGORISED | **Not yet Implemented** SINH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine::sinh SKEW | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Deviations::skew SKEW.P | CATEGORY_STATISTICAL | **Not yet Implemented** @@ -550,10 +561,10 @@ TBILLPRICE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpread TBILLYIELD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial\TreasuryBill::yield TDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\StudentT::distribution TEXT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::TEXTFORMAT -TEXTAFTER | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** -TEXTBEFORE | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +TEXTAFTER | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::after +TEXTBEFORE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Extract::before TEXTJOIN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate::TEXTJOIN -TEXTSPLIT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +TEXTSPLIT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Text::split THAIDAYOFWEEK | CATEGORY_DATE_AND_TIME | **Not yet Implemented** THAIDIGIT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** THAIMONTHOFYEAR | CATEGORY_DATE_AND_TIME | **Not yet Implemented** @@ -591,7 +602,7 @@ USDOLLAR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpread Excel Function | Category | PhpSpreadsheet Function -------------------------|--------------------------------|-------------------------------------- VALUE | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::VALUE -VALUETOTEXT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +VALUETOTEXT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData\Format::valueToText VAR | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances::VAR VAR.P | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances::VARP VAR.S | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical\Variances::VAR diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 154541708c..de87870ec7 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,6 +10,8 @@ parameters: - tests/ - samples/ - infra/ + - bin/generate-document + - bin/generate-locales excludePaths: - src/PhpSpreadsheet/Chart/Renderer/JpGraph.php - src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php diff --git a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php index ef1d3d3529..70e92b11cc 100644 --- a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php +++ b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php @@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheetTests; +use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Calculation\Category as Cat; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Logical; @@ -13,12 +14,17 @@ class DocumentGeneratorTest extends TestCase { + private static bool $succeededByName = false; + + private static bool $succeededByCategory = false; + /** * @dataProvider providerGenerateFunctionListByName */ public function testGenerateFunctionListByName(array $phpSpreadsheetFunctions, string $expected): void { self::assertEquals($expected, DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions)); + self::$succeededByName = true; } /** @@ -27,6 +33,7 @@ public function testGenerateFunctionListByName(array $phpSpreadsheetFunctions, s public function testGenerateFunctionListByCategory(array $phpSpreadsheetFunctions, string $expected): void { self::assertEquals($expected, DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions)); + self::$succeededByCategory = true; } public static function providerGenerateFunctionListByName(): array @@ -154,4 +161,24 @@ public function testGenerateFunctionBadArray(): void ]; DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions); } + + public function testGenerateDocuments(): void + { + if (!self::$succeededByName || !self::$succeededByCategory) { + self::markTestSkipped('Not run because prior test failed'); + } + $directory = 'docs/references/'; + self::assertNotEmpty($directory); + $phpSpreadsheetFunctions = Calculation::getFunctions(); + ksort($phpSpreadsheetFunctions); + + self::assertNotFalse(file_put_contents( + $directory . 'function-list-by-category.md', + DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions) + )); + self::assertNotFalse(file_put_contents( + $directory . 'function-list-by-name.md', + DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions) + )); + } }