From 75c34f26945d664ead1e58c31f1a5738b11e3590 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 2 Oct 2016 09:41:20 +0900 Subject: [PATCH] Rename MINUTEOFHOUR into MINUTE for consistency --- Documentation/FunctionListByCategory.txt | 2 +- Documentation/FunctionListByName.txt | 2 +- .../FunctionReference/03-03-Date-and-Time-Functions.md | 4 ++-- Documentation/markdown/Functions/FunctionListByCategory.md | 2 +- Documentation/markdown/Functions/FunctionListByName.md | 2 +- src/PhpSpreadsheet/Calculation.php | 2 +- src/PhpSpreadsheet/Calculation/DateTime.php | 4 ++-- tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/FunctionListByCategory.txt b/Documentation/FunctionListByCategory.txt index 824346b3..b1eced62 100644 --- a/Documentation/FunctionListByCategory.txt +++ b/Documentation/FunctionListByCategory.txt @@ -30,7 +30,7 @@ CATEGORY_DATE_AND_TIME EDATE PHPExcel_Calculation_DateTime::EDATE EOMONTH PHPExcel_Calculation_DateTime::EOMONTH HOUR PHPExcel_Calculation_DateTime::HOUROFDAY - MINUTE PHPExcel_Calculation_DateTime::MINUTEOFHOUR + MINUTE PHPExcel_Calculation_DateTime::MINUTE MONTH PHPExcel_Calculation_DateTime::MONTHOFYEAR NETWORKDAYS PHPExcel_Calculation_DateTime::NETWORKDAYS NOW PHPExcel_Calculation_DateTime::DATETIMENOW diff --git a/Documentation/FunctionListByName.txt b/Documentation/FunctionListByName.txt index 4c7ad87a..e347a242 100644 --- a/Documentation/FunctionListByName.txt +++ b/Documentation/FunctionListByName.txt @@ -224,7 +224,7 @@ MIDB CATEGORY_TEXT_AND_DATA PHPExcel_Calculation_Tex MIN CATEGORY_STATISTICAL PHPExcel_Calculation_Statistical::MIN MINA CATEGORY_STATISTICAL PHPExcel_Calculation_Statistical::MINA MINIF CATEGORY_STATISTICAL PHPExcel_Calculation_Statistical::MINIF -MINUTE CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::MINUTEOFHOUR +MINUTE CATEGORY_DATE_AND_TIME PHPExcel_Calculation_DateTime::MINUTE MINVERSE CATEGORY_MATH_AND_TRIG PHPExcel_Calculation_MathTrig::MINVERSE MIRR CATEGORY_FINANCIAL PHPExcel_Calculation_Financial::MIRR MMULT CATEGORY_MATH_AND_TRIG PHPExcel_Calculation_MathTrig::MMULT diff --git a/Documentation/markdown/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md b/Documentation/markdown/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md index db7bc0e3..7f11ac34 100644 --- a/Documentation/markdown/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md +++ b/Documentation/markdown/CalculationEngine/FunctionReference/03-03-Date-and-Time-Functions.md @@ -663,7 +663,7 @@ $retVal = $worksheet->getCell('B4')->getCalculatedValue(); ```php $retVal = call_user_func_array( - array('PHPExcel_Calculation_Functions', 'MINUTEOFHOUR'), + array('PHPExcel_Calculation_Functions', 'MINUTE'), array('09:30') ); // $retVal = 30 @@ -671,7 +671,7 @@ $retVal = call_user_func_array( ##### Notes -Note that the PHPExcel function is PHPExcel_Calculation_Functions::MINUTEOFHOUR() when the method is called statically. +Note that the PHPExcel function is PHPExcel_Calculation_Functions::MINUTE() when the method is called statically. #### MONTH diff --git a/Documentation/markdown/Functions/FunctionListByCategory.md b/Documentation/markdown/Functions/FunctionListByCategory.md index d1d99d39..b4753751 100644 --- a/Documentation/markdown/Functions/FunctionListByCategory.md +++ b/Documentation/markdown/Functions/FunctionListByCategory.md @@ -39,7 +39,7 @@ EDATE | PHPExcel_Calculation_DateTime::EDATE EOMONTH | PHPExcel_Calculation_DateTime::EOMONTH HOUR | PHPExcel_Calculation_DateTime::HOUROFDAY - MINUTE | PHPExcel_Calculation_DateTime::MINUTEOFHOUR + MINUTE | PHPExcel_Calculation_DateTime::MINUTE MONTH | PHPExcel_Calculation_DateTime::MONTHOFYEAR NETWORKDAYS | PHPExcel_Calculation_DateTime::NETWORKDAYS NOW | PHPExcel_Calculation_DateTime::DATETIMENOW diff --git a/Documentation/markdown/Functions/FunctionListByName.md b/Documentation/markdown/Functions/FunctionListByName.md index 5a61aa7d..f7ccd0df 100644 --- a/Documentation/markdown/Functions/FunctionListByName.md +++ b/Documentation/markdown/Functions/FunctionListByName.md @@ -276,7 +276,7 @@ MIN | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MIN MINA | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MINA MINIF | CATEGORY_STATISTICAL | PHPExcel_Calculation_Statistical::MINIF - MINUTE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::MINUTEOFHOUR + MINUTE | CATEGORY_DATE_AND_TIME | PHPExcel_Calculation_DateTime::MINUTE MINVERSE | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MINVERSE MIRR | CATEGORY_FINANCIAL | PHPExcel_Calculation_Financial::MIRR MMULT | CATEGORY_MATH_AND_TRIG | PHPExcel_Calculation_MathTrig::MMULT diff --git a/src/PhpSpreadsheet/Calculation.php b/src/PhpSpreadsheet/Calculation.php index fbf90ca7..ca70b9c4 100644 --- a/src/PhpSpreadsheet/Calculation.php +++ b/src/PhpSpreadsheet/Calculation.php @@ -1307,7 +1307,7 @@ class Calculation ], 'MINUTE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::MINUTEOFHOUR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::MINUTE', 'argumentCount' => '1', ], 'MINVERSE' => [ diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index a2043cb0..3deaf06e 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -1358,7 +1358,7 @@ class DateTime } /** - * MINUTEOFHOUR + * MINUTE * * Returns the minutes of a time value. * The minute is given as an integer, ranging from 0 to 59. @@ -1370,7 +1370,7 @@ class DateTime * PHP DateTime object, or a standard time string * @return int Minute */ - public static function MINUTEOFHOUR($timeValue = 0) + public static function MINUTE($timeValue = 0) { $timeValue = $timeTester = Functions::flattenSingleValue($timeValue); diff --git a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php index 5c8b9e0c..6c207f5f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php @@ -283,7 +283,7 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase { $args = func_get_args(); $expectedResult = array_pop($args); - $result = call_user_func_array([DateTime::class, 'MINUTEOFHOUR'], $args); + $result = call_user_func_array([DateTime::class, 'MINUTE'], $args); $this->assertEquals($expectedResult, $result, null, 1E-8); }