Skip to content

Commit

Permalink
updated proper type hinting for all DateTime object method variables
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgp committed May 16, 2016
1 parent 017dcb4 commit 952f93d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
12 changes: 6 additions & 6 deletions source/Romanian.php
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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');
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 952f93d

Please sign in to comment.