Completed
Push — master ( dbf868...139eb5 )
by
unknown
17s queued 14s
created
Classes/Controller/CalendarController.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 foreach ($year['children'] as $month) {
128 128
                     foreach ($month['children'] as $day) {
129 129
                         foreach ($day['children'] as $issue) {
130
-                            $title = $issue['label'] ?: $issue['orderlabel'];
130
+                            $title = $issue['label'] ? : $issue['orderlabel'];
131 131
                             if (strtotime($title) !== false) {
132 132
                                 $title = strftime('%x', strtotime($title));
133 133
                             }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 $_day = date('j', $dateTimestamp);
172 172
                 $calendarIssuesByYear[$_year][$_month][$_day][] = $issue;
173 173
             } else {
174
-                $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication');
174
+                $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication');
175 175
             }
176 176
         }
177 177
         // Sort by years.
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
         $this->view->assign('calendarData', $calendarData);
219 219
         $this->view->assign('documentId', $this->document->getUid());
220 220
         $this->view->assign('yearLinkTitle', $yearLinkTitle);
221
-        $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getDoc()->tableOfContents[0]['points']);
222
-        $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ?: $this->document->getDoc()->tableOfContents[0]['label']);
221
+        $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getDoc()->tableOfContents[0]['points']);
222
+        $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ? : $this->document->getDoc()->tableOfContents[0]['label']);
223 223
     }
224 224
 
225 225
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
                 if (empty($yearLabel)) {
257 257
                     // if neither order nor orderlabel is set, use the id...
258
-                    $yearLabel = (string)$id;
258
+                    $yearLabel = (string) $id;
259 259
                 }
260 260
 
261 261
                 $years[] = [
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12)
305 305
     {
306 306
         for ($i = $firstMonth; $i <= $lastMonth; $i++) {
307
-            $key = $year . '-' . $i;
307
+            $key = $year.'-'.$i;
308 308
 
309 309
             $calendarData[$key] = [
310 310
                 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')),
@@ -314,16 +314,16 @@  discard block
 block discarded – undo
314 314
                 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')),
315 315
                 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')),
316 316
                 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')),
317
-                'MONTHNAME'  => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year,
317
+                'MONTHNAME'  => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year,
318 318
                 'CALYEAR' => ($i == $firstMonth) ? $year : ''
319 319
             ];
320 320
 
321
-            $firstOfMonth = strtotime($year . '-' . $i . '-1');
321
+            $firstOfMonth = strtotime($year.'-'.$i.'-1');
322 322
             $lastOfMonth = strtotime('last day of', ($firstOfMonth));
323 323
             $firstOfMonthStart = strtotime('last Monday', $firstOfMonth);
324 324
             // There are never more than 6 weeks in a month.
325 325
             for ($j = 0; $j <= 5; $j++) {
326
-                $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart);
326
+                $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart);
327 327
 
328 328
                 $calendarData[$key]['week'][$j] = [
329 329
                     'DAYMON' => ['dayValue' => '&nbsp;'],
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                 ];
337 337
                 // Every week has seven days. ;-)
338 338
                 for ($k = 0; $k <= 6; $k++) {
339
-                    $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek);
339
+                    $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek);
340 340
                     if (
341 341
                         $currentDayTime >= $firstOfMonth
342 342
                         && $currentDayTime <= $lastOfMonth
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                             }
368 368
                             $dayLinkDiv = $dayLinksText;
369 369
                         }
370
-                        switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) {
370
+                        switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) {
371 371
                             case '0':
372 372
                                 $calendarData[$key]['week'][$j]['DAYSUN']['dayValue'] = strftime('%d', $currentDayTime);
373 373
                                 if ((int) $dayLinks === (int) date('j', $currentDayTime)) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         // Load current document.
65 65
         $this->loadDocument($this->requestData);
66
-        if ($this->document === null) {
66
+        if ($this->document === NULL) {
67 67
             // Quit without doing anything if required variables are not set.
68 68
             return '';
69 69
         }
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
         switch ($type) {
79 79
             case 'newspaper':
80 80
             case 'ephemera':
81
-                $this->forward('years', null, null, $this->requestData);
81
+                $this->forward('years', NULL, NULL, $this->requestData);
82 82
                 break;
83 83
             case 'year':
84
-                $this->forward('calendar', null, null, $this->requestData);
84
+                $this->forward('calendar', NULL, NULL, $this->requestData);
85 85
                 break;
86 86
             case 'issue':
87 87
             default:
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         // Load current document.
112 112
         $this->loadDocument($this->requestData);
113
-        if ($this->document === null) {
113
+        if ($this->document === NULL) {
114 114
             // Quit without doing anything if required variables are not set.
115 115
             return '';
116 116
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                     foreach ($month['children'] as $day) {
129 129
                         foreach ($day['children'] as $issue) {
130 130
                             $title = $issue['label'] ?: $issue['orderlabel'];
131
-                            if (strtotime($title) !== false) {
131
+                            if (strtotime($title) !== FALSE) {
132 132
                                 $title = strftime('%x', strtotime($title));
133 133
                             }
134 134
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     $title = $document->getTitle();
150 150
                 } else {
151 151
                     $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel();
152
-                    if (strtotime($title) !== false) {
152
+                    if (strtotime($title) !== FALSE) {
153 153
                         $title = strftime('%x', strtotime($title));
154 154
                     }
155 155
                 }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $calendarIssuesByYear = [];
166 166
         foreach ($issues as $issue) {
167 167
             $dateTimestamp = strtotime($issue['year']);
168
-            if ($dateTimestamp !== false) {
168
+            if ($dateTimestamp !== FALSE) {
169 169
                 $_year = date('Y', $dateTimestamp);
170 170
                 $_month = date('n', $dateTimestamp);
171 171
                 $_day = date('j', $dateTimestamp);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         // Load current document.
241 241
         $this->loadDocument($this->requestData);
242
-        if ($this->document === null) {
242
+        if ($this->document === NULL) {
243 243
             // Quit without doing anything if required variables are not set.
244 244
             return '';
245 245
         }
Please login to merge, or discard this patch.