Completed
Push — master ( 46919a...87b06b )
by Daniel
01:15
created
sample/BankHoliday.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,25 +46,25 @@  discard block
 block discarded – undo
46 46
     private function listBankHolidays($refDate)
47 47
     {
48 48
         $thisYearHolidays = $this->setHolidays($refDate);
49
-        echo '<h1>For ' . $refDate->format('Y') . ' the Romanian bank holidays are:</h1>'
49
+        echo '<h1>For '.$refDate->format('Y').' the Romanian bank holidays are:</h1>'
50 50
         . '<ul>';
51 51
         foreach ($thisYearHolidays as $value) {
52
-            echo '<li>' . $value . ' --- ' . date('l, d F Y', $value) . '</li>';
52
+            echo '<li>'.$value.' --- '.date('l, d F Y', $value).'</li>';
53 53
         }
54 54
         echo '</ul>';
55 55
     }
56 56
 
57 57
     private function listWorkingDaysM2M($refDate)
58 58
     {
59
-        echo '<h1>For ' . $refDate->format('Y') . ' the Romanian working days month by month are:</h1>'
59
+        echo '<h1>For '.$refDate->format('Y').' the Romanian working days month by month are:</h1>'
60 60
         . '<ul>';
61 61
         $wkDaysInMonth = [];
62 62
         for ($crtMonth = 1; $crtMonth <= 12; $crtMonth++) {
63
-            $crtDate = \DateTime::createFromFormat('Y-n-j', $refDate->format('Y') . '-' . $crtMonth . '-1');
63
+            $crtDate = \DateTime::createFromFormat('Y-n-j', $refDate->format('Y').'-'.$crtMonth.'-1');
64 64
             if ($crtDate !== false) {
65 65
                 $wkDaysInMonth[] = $this->setWorkingDaysInMonth($crtDate);
66
-                echo '<li>' . $crtDate->format('M Y') . ' = '
67
-                . $this->setWorkingDaysInMonth($crtDate) . ' working days</li>';
66
+                echo '<li>'.$crtDate->format('M Y').' = '
67
+                . $this->setWorkingDaysInMonth($crtDate).' working days</li>';
68 68
             }
69 69
         }
70 70
         echo '</ul>';
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 
74 74
     private function overallStatistics($wkDaysInMonth, $refDate)
75 75
     {
76
-        echo '<p>Total # of working days in ' . $refDate->format('Y') . ' is '
77
-        . array_sum($wkDaysInMonth) . ' days</p>';
78
-        echo '<p>Average working days for ' . $refDate->format('Y') . ' is '
79
-        . round((array_sum($wkDaysInMonth) / count($wkDaysInMonth)), 2) . ' days'
80
-        . ' or ' . round((array_sum($wkDaysInMonth) * 8 / count($wkDaysInMonth)), 2) . ' hours'
76
+        echo '<p>Total # of working days in '.$refDate->format('Y').' is '
77
+        . array_sum($wkDaysInMonth).' days</p>';
78
+        echo '<p>Average working days for '.$refDate->format('Y').' is '
79
+        . round((array_sum($wkDaysInMonth) / count($wkDaysInMonth)), 2).' days'
80
+        . ' or '.round((array_sum($wkDaysInMonth) * 8 / count($wkDaysInMonth)), 2).' hours'
81 81
         . '</p>';
82 82
     }
83 83
 }
Please login to merge, or discard this patch.
source/Romanian.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
      */
44 44
     private function getEasterDatetime($year)
45 45
     {
46
-        $base = new \DateTime($year . '-03-21');
47
-        return $base->add(new \DateInterval('P{' . easter_days($year) . '}D'));
46
+        $base = new \DateTime($year.'-03-21');
47
+        return $base->add(new \DateInterval('P{'.easter_days($year).'}D'));
48 48
     }
49 49
 
50 50
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     protected function readTypeFromJsonFileUniversal($filePath, $fileBaseName)
57 57
     {
58
-        $fName       = $filePath . DIRECTORY_SEPARATOR . $fileBaseName . '.min.json';
58
+        $fName       = $filePath.DIRECTORY_SEPARATOR.$fileBaseName.'.min.json';
59 59
         $fJson       = fopen($fName, 'r');
60 60
         $jSonContent = fread($fJson, filesize($fName));
61 61
         fclose($fJson);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     private function setHolidaysFixed(\DateTime $lngDate)
99 99
     {
100
-        $daying    = [
100
+        $daying = [
101 101
             mktime(0, 0, 0, 1, 1, $lngDate->format('Y')), // Happy New Year
102 102
             mktime(0, 0, 0, 1, 2, $lngDate->format('Y')), // recovering from New Year party
103 103
             mktime(0, 0, 0, 5, 1, $lngDate->format('Y')), // May 1st
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $givenYear      = $lngDate->format('Y');
168 168
         $daying         = [];
169
-        $configPath     = __DIR__ . DIRECTORY_SEPARATOR . 'json';
169
+        $configPath     = __DIR__.DIRECTORY_SEPARATOR.'json';
170 170
         $statmentsArray = $this->readTypeFromJsonFileUniversal($configPath, 'RomanianBankHolidays');
171 171
         if (array_key_exists($givenYear, $statmentsArray)) {
172 172
             foreach ($statmentsArray[$givenYear] as $value) {
Please login to merge, or discard this patch.