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'],
'argumentCount' => '2,3',
],
'DATEVALUE' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'DATEVALUE'],
'functionCall' => [DateTimeExcel\DateValue::class, 'funcDateValue'],
'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'],
'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'],
'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'],
'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'],
'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'],
'argumentCount' => '1,2',
],
'WEEKNUM' => [
'category' => Category::CATEGORY_DATE_AND_TIME,
'functionCall' => [DateTime::class, 'WEEKNUM'],
'functionCall' => [DateTimeExcel\WeekNum::class, 'funcWeekNum'],
'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'],
'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'],
'argumentCount' => '2,3',
],
'YIELD' => [
Expand Down
Loading