From 952f93dce8b31b80ff74ea0cc1a7f355f39eabe7 Mon Sep 17 00:00:00 2001 From: Daniel Popiniuc Date: Mon, 16 May 2016 20:53:59 +0300 Subject: [PATCH] updated proper type hinting for all DateTime object method variables --- source/Romanian.php | 12 +++---- .../php-unit/coverage.html/Romanian.php.html | 26 +++++++------- tests/php-unit/coverage.html/dashboard.html | 2 +- tests/php-unit/coverage.html/index.html | 2 +- tests/php-unit/junit.xml | 34 +++++++++---------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/source/Romanian.php b/source/Romanian.php index ff9c6b3..4dbc2f6 100644 --- a/source/Romanian.php +++ b/source/Romanian.php @@ -82,7 +82,7 @@ protected function setHolidays(\DateTime $lngDate, $inclCatholicEaster = false, * @param date $lngDate * @return array */ - private function setHolidaysFixed($lngDate) { + private function setHolidaysFixed(\DateTime $lngDate) { $givenYear = $lngDate->format('Y'); $daying[] = mktime(0, 0, 0, 1, 1, $givenYear); // Happy New Year $daying[] = mktime(0, 0, 0, 1, 2, $givenYear); // recovering from New Year party @@ -106,7 +106,7 @@ private function setHolidaysFixed($lngDate) { * @param date $lngDate * @return array */ - private function setHolidaysFixedButWorking($lngDate) { + private function setHolidaysFixedButWorking(\DateTime $lngDate) { $daying = []; $givenYear = $lngDate->format('Y'); if ($givenYear >= 2015) { @@ -124,7 +124,7 @@ private function setHolidaysFixedButWorking($lngDate) { * @param date $lngDate * @return array */ - private function setHolidaysOrthodoxEaster($lngDate) { + private function setHolidaysOrthodoxEaster(\DateTime $lngDate) { $givenYear = $lngDate->format('Y'); $daying = []; $statmentsArray = $this->readTypeFromJsonFile('RomanianBankHolidays'); @@ -143,7 +143,7 @@ private function setHolidaysOrthodoxEaster($lngDate) { * @param boolean $inclCatholicEaster * @return int */ - protected function setHolidaysInMonth($lngDate, $inclCatholicEaster = false) { + protected function setHolidaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false) { $holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster); $thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate); $holidays = 0; @@ -155,7 +155,7 @@ protected function setHolidaysInMonth($lngDate, $inclCatholicEaster = false) { return $holidays; } - protected function setMonthAllDaysIntoArray($lngDate) { + protected function setMonthAllDaysIntoArray(\DateTime $lngDate) { $firstDayGivenMonth = strtotime($lngDate->modify('first day of this month')->format('Y-m-d')); $lastDayInGivenMonth = strtotime($lngDate->modify('last day of this month')->format('Y-m-d')); $secondsInOneDay = 24 * 60 * 60; @@ -169,7 +169,7 @@ protected function setMonthAllDaysIntoArray($lngDate) { * @param boolean $inclCatholicEaster * @return int */ - protected function setWorkingDaysInMonth($lngDate, $inclCatholicEaster = false) { + protected function setWorkingDaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false) { $holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster); $thisMonthDayArray = $this->setMonthAllDaysIntoArray($lngDate); $workingDays = 0; diff --git a/tests/php-unit/coverage.html/Romanian.php.html b/tests/php-unit/coverage.html/Romanian.php.html index 8364ba8..2a37e02 100644 --- a/tests/php-unit/coverage.html/Romanian.php.html +++ b/tests/php-unit/coverage.html/Romanian.php.html @@ -162,7 +162,7 @@ -  setHolidaysFixed +  setHolidaysFixed
100.00% covered (success) @@ -183,7 +183,7 @@ -  setHolidaysFixedButWorking +  setHolidaysFixedButWorking
100.00% covered (success) @@ -204,7 +204,7 @@ -  setHolidaysOrthodoxEaster +  setHolidaysOrthodoxEaster
100.00% covered (success) @@ -225,7 +225,7 @@ -  setHolidaysInMonth +  setHolidaysInMonth
100.00% covered (success) @@ -246,7 +246,7 @@ -  setMonthAllDaysIntoArray +  setMonthAllDaysIntoArray
100.00% covered (success) @@ -267,7 +267,7 @@ -  setWorkingDaysInMonth +  setWorkingDaysInMonth
100.00% covered (success) @@ -376,7 +376,7 @@      * @param date $lngDate      * @return array      */ -     private function setHolidaysFixed($lngDate) { +     private function setHolidaysFixed(\DateTime $lngDate) {         $givenYear = $lngDate->format('Y');         $daying[]  = mktime(0, 0, 0, 1, 1, $givenYear); // Happy New Year         $daying[]  = mktime(0, 0, 0, 1, 2, $givenYear); // recovering from New Year party @@ -400,7 +400,7 @@      * @param date $lngDate      * @return array      */ -     private function setHolidaysFixedButWorking($lngDate) { +     private function setHolidaysFixedButWorking(\DateTime $lngDate) {         $daying    = [];         $givenYear = $lngDate->format('Y');         if ($givenYear >= 2015) { @@ -418,7 +418,7 @@      * @param date $lngDate      * @return array      */ -     private function setHolidaysOrthodoxEaster($lngDate) { +     private function setHolidaysOrthodoxEaster(\DateTime $lngDate) {         $givenYear      = $lngDate->format('Y');         $daying         = [];         $statmentsArray = $this->readTypeFromJsonFile('RomanianBankHolidays'); @@ -437,7 +437,7 @@      * @param boolean $inclCatholicEaster      * @return int      */ -     protected function setHolidaysInMonth($lngDate, $inclCatholicEaster = false) { +     protected function setHolidaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false) {         $holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);         $thisMonthDayArray   = $this->setMonthAllDaysIntoArray($lngDate);         $holidays            = 0; @@ -449,7 +449,7 @@         return $holidays;     } -     protected function setMonthAllDaysIntoArray($lngDate) { +     protected function setMonthAllDaysIntoArray(\DateTime $lngDate) {         $firstDayGivenMonth  = strtotime($lngDate->modify('first day of this month')->format('Y-m-d'));         $lastDayInGivenMonth = strtotime($lngDate->modify('last day of this month')->format('Y-m-d'));         $secondsInOneDay     = 24 * 60 * 60; @@ -463,7 +463,7 @@      * @param boolean $inclCatholicEaster      * @return int      */ -     protected function setWorkingDaysInMonth($lngDate, $inclCatholicEaster = false) { +     protected function setWorkingDaysInMonth(\DateTime $lngDate, $inclCatholicEaster = false) {         $holidaysInGivenYear = $this->setHolidays($lngDate, $inclCatholicEaster);         $thisMonthDayArray   = $this->setMonthAllDaysIntoArray($lngDate);         $workingDays         = 0; @@ -487,7 +487,7 @@

Legend

Dead Code

- Generated by PHP_CodeCoverage 3.3.1 using PHP 7.0.6 and PHPUnit 5.3.4 at Mon May 16 19:01:25 EEST 2016. + Generated by PHP_CodeCoverage 3.3.1 using PHP 7.0.6 and PHPUnit 5.3.4 at Mon May 16 20:52:01 EEST 2016.

diff --git a/tests/php-unit/coverage.html/dashboard.html b/tests/php-unit/coverage.html/dashboard.html index 05fde25..c7eac63 100644 --- a/tests/php-unit/coverage.html/dashboard.html +++ b/tests/php-unit/coverage.html/dashboard.html @@ -136,7 +136,7 @@

Project Risks

diff --git a/tests/php-unit/coverage.html/index.html b/tests/php-unit/coverage.html/index.html index 1c09d99..f589024 100644 --- a/tests/php-unit/coverage.html/index.html +++ b/tests/php-unit/coverage.html/index.html @@ -108,7 +108,7 @@

Legend

High: 70% to 100%

- Generated by PHP_CodeCoverage 3.3.1 using PHP 7.0.6 and PHPUnit 5.3.4 at Mon May 16 19:01:25 EEST 2016. + Generated by PHP_CodeCoverage 3.3.1 using PHP 7.0.6 and PHPUnit 5.3.4 at Mon May 16 20:52:01 EEST 2016.

diff --git a/tests/php-unit/junit.xml b/tests/php-unit/junit.xml index ed73412..7a0bf8e 100644 --- a/tests/php-unit/junit.xml +++ b/tests/php-unit/junit.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +