| @@ -36,12 +36,18 @@ discard block | ||
| 36 | 36 | trait Romanian | 
| 37 | 37 |  { | 
| 38 | 38 | |
| 39 | + /** | |
| 40 | + * @param string $year | |
| 41 | + */ | |
| 39 | 42 |      private function getEasterDatetime($year) { | 
| 40 | 43 |          $base = new \DateTime("$year-03-21"); | 
| 41 | 44 | $days = easter_days($year); | 
| 42 | 45 |          return $base->add(new \DateInterval("P{$days}D")); | 
| 43 | 46 | } | 
| 44 | 47 | |
| 48 | + /** | |
| 49 | + * @param string $fileBaseName | |
| 50 | + */ | |
| 45 | 51 |      private function readTypeFromJsonFile($fileBaseName) { | 
| 46 | 52 | $fName = __DIR__ . DIRECTORY_SEPARATOR . 'json' . DIRECTORY_SEPARATOR . $fileBaseName . '.min.json'; | 
| 47 | 53 | $fJson = fopen($fName, 'r'); | 
| @@ -53,7 +59,7 @@ discard block | ||
| 53 | 59 | /** | 
| 54 | 60 | * List of legal holidays | 
| 55 | 61 | * | 
| 56 | - * @param date $lngDate | |
| 62 | + * @param \DateTime $lngDate | |
| 57 | 63 | * @param boolean $inclCatholicEaster | 
| 58 | 64 | * @return array | 
| 59 | 65 | */ | 
| @@ -79,8 +85,8 @@ discard block | ||
| 79 | 85 | * List of all Romanian fixed holidays | 
| 80 | 86 | * (where fixed means every single year occur on same day of the month) | 
| 81 | 87 | * | 
| 82 | - * @param date $lngDate | |
| 83 | - * @return array | |
| 88 | + * @param \DateTime $lngDate | |
| 89 | + * @return integer[] | |
| 84 | 90 | */ | 
| 85 | 91 |      private function setHolidaysFixed($lngDate) { | 
| 86 | 92 |          $givenYear = $lngDate->format('Y'); | 
| @@ -103,7 +109,7 @@ discard block | ||
| 103 | 109 | * List of Romanian fixed holidays that are still working (weird ones) | 
| 104 | 110 | * (where fixed means every single year occur on same day of the month) | 
| 105 | 111 | * | 
| 106 | - * @param date $lngDate | |
| 112 | + * @param \DateTime $lngDate | |
| 107 | 113 | * @return array | 
| 108 | 114 | */ | 
| 109 | 115 |      private function setHolidaysFixedButWorking($lngDate) { | 
| @@ -121,7 +127,7 @@ discard block | ||
| 121 | 127 | /** | 
| 122 | 128 | * List of all Orthodox holidays and Pentecost | 
| 123 | 129 | * | 
| 124 | - * @param date $lngDate | |
| 130 | + * @param \DateTime $lngDate | |
| 125 | 131 | * @return array | 
| 126 | 132 | */ | 
| 127 | 133 |      private function setHolidaysOrthodoxEaster($lngDate) { | 
| @@ -165,7 +171,7 @@ discard block | ||
| 165 | 171 | /** | 
| 166 | 172 | * returns working days in a given month | 
| 167 | 173 | * | 
| 168 | - * @param date $lngDate | |
| 174 | + * @param \DateTime $lngDate | |
| 169 | 175 | * @param boolean $inclCatholicEaster | 
| 170 | 176 | * @return int | 
| 171 | 177 | */ | 
| @@ -39,13 +39,13 @@ | ||
| 39 | 39 |      public function __construct() { | 
| 40 | 40 |          $todaysDate       = new \DateTime('now'); | 
| 41 | 41 | $thisYearHolidays = $this->setHolidays($todaysDate); | 
| 42 | -        echo '<h1>For ' . $todaysDate->format('Y') . ' the Romanian bank holidays are:</h1>' | |
| 42 | +        echo '<h1>For '.$todaysDate->format('Y').' the Romanian bank holidays are:</h1>' | |
| 43 | 43 | . '<ul>'; | 
| 44 | 44 |          foreach ($thisYearHolidays as $value) { | 
| 45 | -            echo '<li>' . $value . ' --- ' . date('l, d F Y', $value) . '</li>'; | |
| 45 | +            echo '<li>'.$value.' --- '.date('l, d F Y', $value).'</li>'; | |
| 46 | 46 | } | 
| 47 | 47 | echo '</ul>' | 
| 48 | -        . '<p>For the month of ' . $todaysDate->format('M Y') . ' the number of working days is: ' | |
| 49 | - . $this->setWorkingDaysInMonth($todaysDate) . '<p>'; | |
| 48 | +        . '<p>For the month of '.$todaysDate->format('M Y').' the number of working days is: ' | |
| 49 | + . $this->setWorkingDaysInMonth($todaysDate).'<p>'; | |
| 50 | 50 | } | 
| 51 | 51 | } |