Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Breakup Of Calculation/DateTime Functions #1937

Merged
merged 12 commits into from
Mar 21, 2021
46 changes: 23 additions & 23 deletions src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,17 +754,17 @@ class Calculation
],
'DATE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATE'],
'functionCall' => [DateTimeExcel\Datefunc::class, 'funcDate'],
'argumentCount' => '3',
],
'DATEDIF' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATEDIF'],
'functionCall' => [DateTimeExcel\Datedif::class, 'funcDatedif'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2,3',
],
'DATEVALUE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATEVALUE'],
'functionCall' => [DateTimeExcel\Datevalue::class, 'funcDatevalue'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '1',
],
'DAVERAGE' => [
Expand All @@ -774,17 +774,17 @@ class Calculation
],
'DAY' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DAYOFMONTH'],
'functionCall' => [DateTimeExcel\Day::class, 'funcDay'],
'argumentCount' => '1',
],
'DAYS' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DAYS'],
'functionCall' => [DateTimeExcel\Days::class, 'funcDays'],
'argumentCount' => '2',
],
'DAYS360' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DAYS360'],
'functionCall' => [DateTimeExcel\Days360::class, 'funcDays360'],
'argumentCount' => '2,3',
],
'DB' => [
Expand Down Expand Up @@ -919,7 +919,7 @@ class Calculation
],
'EDATE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'EDATE'],
'functionCall' => [DateTimeExcel\Edate::class, 'funcEdate'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2',
],
'EFFECT' => [
Expand All @@ -934,7 +934,7 @@ class Calculation
],
'EOMONTH' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'EOMONTH'],
'functionCall' => [DateTimeExcel\Eomonth::class, 'funcEomonth'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2',
],
'ERF' => [
Expand Down Expand Up @@ -1236,7 +1236,7 @@ class Calculation
],
'HOUR' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'HOUROFDAY'],
'functionCall' => [DateTimeExcel\Hour::class, 'funcHour'],
'argumentCount' => '1',
],
'HYPERLINK' => [
Expand Down Expand Up @@ -1500,7 +1500,7 @@ class Calculation
],
'ISOWEEKNUM' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'ISOWEEKNUM'],
'functionCall' => [DateTimeExcel\IsoWeeknum::class, 'funcIsoWeeknum'],
'argumentCount' => '1',
],
'ISPMT' => [
Expand Down Expand Up @@ -1680,7 +1680,7 @@ class Calculation
],
'MINUTE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'MINUTE'],
'functionCall' => [DateTimeExcel\Minute::class, 'funcMinute'],
'argumentCount' => '1',
],
'MINVERSE' => [
Expand Down Expand Up @@ -1720,7 +1720,7 @@ class Calculation
],
'MONTH' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'MONTHOFYEAR'],
'functionCall' => [DateTimeExcel\Month::class, 'funcMonth'],
'argumentCount' => '1',
],
'MROUND' => [
Expand Down Expand Up @@ -1760,7 +1760,7 @@ class Calculation
],
'NETWORKDAYS' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'NETWORKDAYS'],
'functionCall' => [DateTimeExcel\Networkdays::class, 'funcNetworkdays'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2-3',
],
'NETWORKDAYS.INTL' => [
Expand Down Expand Up @@ -1820,7 +1820,7 @@ class Calculation
],
'NOW' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATETIMENOW'],
'functionCall' => [DateTimeExcel\Now::class, 'funcNow'],
'argumentCount' => '0',
],
'NPER' => [
Expand Down Expand Up @@ -2173,7 +2173,7 @@ class Calculation
],
'SECOND' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'SECOND'],
'functionCall' => [DateTimeExcel\Second::class, 'funcSecond'],
'argumentCount' => '1',
],
'SEQUENCE' => [
Expand Down Expand Up @@ -2419,12 +2419,12 @@ class Calculation
],
'TIME' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'TIME'],
'functionCall' => [DateTimeExcel\Time::class, 'funcTime'],
'argumentCount' => '3',
],
'TIMEVALUE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'TIMEVALUE'],
'functionCall' => [DateTimeExcel\Timevalue::class, 'funcTimevalue'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '1',
],
'TINV' => [
Expand All @@ -2444,7 +2444,7 @@ class Calculation
],
'TODAY' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATENOW'],
'functionCall' => [DateTimeExcel\Today::class, 'funcToday'],
'argumentCount' => '0',
],
'TRANSPOSE' => [
Expand Down Expand Up @@ -2569,12 +2569,12 @@ class Calculation
],
'WEEKDAY' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'WEEKDAY'],
'functionCall' => [DateTimeExcel\Weekday::class, 'funcWeekday'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '1,2',
],
'WEEKNUM' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'WEEKNUM'],
'functionCall' => [DateTimeExcel\Weeknum::class, 'funcWeeknum'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '1,2',
],
'WEIBULL' => [
Expand All @@ -2589,7 +2589,7 @@ class Calculation
],
'WORKDAY' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'WORKDAY'],
'functionCall' => [DateTimeExcel\Workday::class, 'funcWorkday'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2-3',
],
'WORKDAY.INTL' => [
Expand Down Expand Up @@ -2624,12 +2624,12 @@ class Calculation
],
'YEAR' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'YEAR'],
'functionCall' => [DateTimeExcel\Year::class, 'funcYear'],
'argumentCount' => '1',
],
'YEARFRAC' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'YEARFRAC'],
'functionCall' => [DateTimeExcel\Yearfrac::class, 'funcYearfrac'],
oleibman marked this conversation as resolved.
Show resolved Hide resolved
'argumentCount' => '2,3',
],
'YIELD' => [
Expand Down
Loading