Completed
Push — master ( 859b6d...c8dd9a )
by Thierry
01:30
created
src/Utils/Pagination/Paginator.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
     }
162 162
 
163 163
     /**
164
-     * @return string
164
+     * @return Request
165 165
      */
166 166
     public function getRequest()
167 167
     {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
     protected function updateNumPages()
67 67
     {
68
-        $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int) ceil($this->totalItems/$this->itemsPerPage));
68
+        $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int)ceil($this->totalItems / $this->itemsPerPage));
69 69
     }
70 70
 
71 71
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function setMaxPagesToShow($maxPagesToShow)
76 76
     {
77
-        if($maxPagesToShow < 4)
77
+        if ($maxPagesToShow < 4)
78 78
         {
79 79
             throw new \InvalidArgumentException('maxPagesToShow cannot be less than 4.');
80 80
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     {
155 155
         $this->request = $request;
156 156
         // Append the page number to the parameter list, if not yet given.
157
-        if(($this->request) && !$this->request->hasPageNumber())
157
+        if (($this->request) && !$this->request->hasPageNumber())
158 158
         {
159 159
             $this->request->addParameter(Parameter::PAGE_NUMBER, 0);
160 160
         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
     public function getNextPage()
199 199
     {
200
-        if($this->currentPage < $this->numPages)
200
+        if ($this->currentPage < $this->numPages)
201 201
         {
202 202
             return $this->currentPage + 1;
203 203
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
     public function getPrevPage()
209 209
     {
210
-        if($this->currentPage > 1)
210
+        if ($this->currentPage > 1)
211 211
         {
212 212
             return $this->currentPage - 1;
213 213
         }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
     public function getNextCall()
219 219
     {
220
-        if(!$this->getNextPage())
220
+        if (!$this->getNextPage())
221 221
         {
222 222
             return null;
223 223
         }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     public function getPrevCall()
232 232
     {
233
-        if(!$this->getPrevPage())
233
+        if (!$this->getPrevPage())
234 234
         {
235 235
             return null;
236 236
         }
@@ -258,14 +258,14 @@  discard block
 block discarded – undo
258 258
     {
259 259
         $pages = [];
260 260
 
261
-        if($this->numPages <= 1)
261
+        if ($this->numPages <= 1)
262 262
         {
263 263
             return [];
264 264
         }
265 265
 
266
-        if($this->numPages <= $this->maxPagesToShow)
266
+        if ($this->numPages <= $this->maxPagesToShow)
267 267
         {
268
-            for($i = 1; $i <= $this->numPages; $i++)
268
+            for ($i = 1; $i <= $this->numPages; $i++)
269 269
             {
270 270
                 $pages[] = $this->createPage($i);
271 271
             }
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
         else
274 274
         {
275 275
             // Determine the sliding range, centered around the current page.
276
-            $numAdjacents = (int) floor(($this->maxPagesToShow - 4) / 2);
276
+            $numAdjacents = (int)floor(($this->maxPagesToShow - 4) / 2);
277 277
 
278 278
             $slidingStart = 1;
279 279
             $slidingEndOffset = $numAdjacents + 3 - $this->currentPage;
280
-            if($slidingEndOffset < 0)
280
+            if ($slidingEndOffset < 0)
281 281
             {
282 282
                 $slidingStart = $this->currentPage - $numAdjacents;
283 283
                 $slidingEndOffset = 0;
@@ -285,23 +285,23 @@  discard block
 block discarded – undo
285 285
 
286 286
             $slidingEnd = $this->numPages;
287 287
             $slidingStartOffset = $this->currentPage + $numAdjacents + 2 - $this->numPages;
288
-            if($slidingStartOffset < 0)
288
+            if ($slidingStartOffset < 0)
289 289
             {
290 290
                 $slidingEnd = $this->currentPage + $numAdjacents;
291 291
                 $slidingStartOffset = 0;
292 292
             }
293 293
 
294 294
             // Build the list of pages.
295
-            if($slidingStart > 1)
295
+            if ($slidingStart > 1)
296 296
             {
297 297
                 $pages[] = $this->createPage(1);
298 298
                 $pages[] = $this->createPageEllipsis();
299 299
             }
300
-            for($i = $slidingStart - $slidingStartOffset; $i <= $slidingEnd + $slidingEndOffset; $i++)
300
+            for ($i = $slidingStart - $slidingStartOffset; $i <= $slidingEnd + $slidingEndOffset; $i++)
301 301
             {
302 302
                 $pages[] = $this->createPage($i);
303 303
             }
304
-            if($slidingEnd < $this->numPages)
304
+            if ($slidingEnd < $this->numPages)
305 305
             {
306 306
                 $pages[] = $this->createPageEllipsis();
307 307
                 $pages[] = $this->createPage($this->numPages);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     {
345 345
         $first = ($this->currentPage - 1) * $this->itemsPerPage + 1;
346 346
 
347
-        if($first > $this->totalItems)
347
+        if ($first > $this->totalItems)
348 348
         {
349 349
             return null;
350 350
         }
@@ -355,13 +355,13 @@  discard block
 block discarded – undo
355 355
     public function getCurrentPageLastItem()
356 356
     {
357 357
         $first = $this->getCurrentPageFirstItem();
358
-        if($first === null)
358
+        if ($first === null)
359 359
         {
360 360
             return null;
361 361
         }
362 362
 
363 363
         $last = $first + $this->itemsPerPage - 1;
364
-        if($last > $this->totalItems)
364
+        if ($last > $this->totalItems)
365 365
         {
366 366
             return $this->totalItems;
367 367
         }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
      */
399 399
     public function render()
400 400
     {
401
-        if($this->getNumPages() <= 1)
401
+        if ($this->getNumPages() <= 1)
402 402
         {
403 403
             return '';
404 404
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -269,8 +269,7 @@
 block discarded – undo
269 269
             {
270 270
                 $pages[] = $this->createPage($i);
271 271
             }
272
-        }
273
-        else
272
+        } else
274 273
         {
275 274
             // Determine the sliding range, centered around the current page.
276 275
             $numAdjacents = (int) floor(($this->maxPagesToShow - 4) / 2);
Please login to merge, or discard this patch.
src/Plugin/Plugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,11 +80,11 @@
 block discarded – undo
80 80
     protected function includeAssets()
81 81
     {
82 82
         $sPluginOptionName = 'assets.include.' . $this->getName();
83
-        if($this->hasOption($sPluginOptionName) && !$this->getOption($sPluginOptionName))
83
+        if ($this->hasOption($sPluginOptionName) && !$this->getOption($sPluginOptionName))
84 84
         {
85 85
             return false;
86 86
         }
87
-        if($this->hasOption('assets.include.all') && !$this->getOption('assets.include.all'))
87
+        if ($this->hasOption('assets.include.all') && !$this->getOption('assets.include.all'))
88 88
         {
89 89
             return false;
90 90
         }
Please login to merge, or discard this patch.
templates/pagination/wrapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <ul class="pagination">
2 2
 <?php
3
-    if(($this->prev))
3
+    if (($this->prev))
4 4
     {
5 5
         echo $this->prev;
6 6
     }
7 7
     echo $this->links;
8
-    if(($this->next))
8
+    if (($this->next))
9 9
     {
10 10
         echo $this->next;
11 11
     }
Please login to merge, or discard this patch.
templates/support/function.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sAlias ?> = function() {
2 2
     return jaxon.request(
3 3
         { jxnfun: '<?php echo $this->sFunction ?>' },
4
-        { parameters: arguments<?php foreach($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
4
+        { parameters: arguments<?php foreach ($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
5 5
     );
6 6
 };
Please login to merge, or discard this patch.
templates/support/object.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sClass ?> = {};
2
-<?php foreach($this->aMethods as $aMethod): ?>
2
+<?php foreach ($this->aMethods as $aMethod): ?>
3 3
 <?php echo $this->sPrefix ?><?php echo $this->sClass ?>.<?php echo $aMethod['name'] ?> = function() {
4 4
     return jaxon.request(
5 5
         { jxncls: '<?php echo $this->sClass ?>', jxnmthd: '<?php echo $aMethod['name'] ?>' },
6
-        { parameters: arguments<?php foreach($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
6
+        { parameters: arguments<?php foreach ($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
7 7
     );
8 8
 };
9 9
 <?php endforeach ?>
Please login to merge, or discard this patch.
templates/support/event.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sEvent ?> = function() {
2 2
     return jaxon.request(
3 3
         { jxnevt: '<?php echo $this->sEvent ?>' },
4
-        { parameters: arguments<?php if(($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if(($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> }
4
+        { parameters: arguments<?php if (($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if (($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> }
5 5
     );
6 6
 };
Please login to merge, or discard this patch.
templates/plugins/includes.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1
-<?php foreach($this->aUrls as $sUrl): ?>
1
+<?php foreach ($this->aUrls as $sUrl): ?>
2 2
 <script type="text/javascript" src="<?php echo $sUrl ?>" <?php echo $this->sJsOptions ?> charset="UTF-8"></script>
3 3
 <?php endforeach ?>
Please login to merge, or discard this patch.
templates/plugins/ready.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 jaxon.dom.ready(function() {
2 2
     jaxon.command.handler.register('cc', jaxon.confirm.commands);
3 3
 
4
-<?php if($this->sPluginScript): ?>
4
+<?php if ($this->sPluginScript): ?>
5 5
 <?php echo $this->sPluginScript ?>
6 6
 <?php endif ?>
7 7
 });
Please login to merge, or discard this patch.
src/Utils/Validation/Validator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         // Verify the file extension
130 130
         $xDefault = $this->xConfig->getOption('upload.default.types');
131 131
         $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.types', $xDefault);
132
-        if(is_array($aAllowed) && !in_array($aUploadedFile['type'], $aAllowed))
132
+        if (is_array($aAllowed) && !in_array($aUploadedFile['type'], $aAllowed))
133 133
         {
134 134
             $this->sErrorMessage = $this->xTranslator->trans('errors.upload.type', $aUploadedFile);
135 135
             return false;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         // Verify the file extension
138 138
         $xDefault = $this->xConfig->getOption('upload.default.extensions');
139 139
         $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.extensions', $xDefault);
140
-        if(is_array($aAllowed) && !in_array($aUploadedFile['extension'], $aAllowed))
140
+        if (is_array($aAllowed) && !in_array($aUploadedFile['extension'], $aAllowed))
141 141
         {
142 142
             $this->sErrorMessage = $this->xTranslator->trans('errors.upload.extension', $aUploadedFile);
143 143
             return false;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         // Verify the max size
146 146
         $xDefault = $this->xConfig->getOption('upload.default.max-size', 0);
147 147
         $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.max-size', $xDefault);
148
-        if($iSize > 0 && $aUploadedFile['size'] > $iSize)
148
+        if ($iSize > 0 && $aUploadedFile['size'] > $iSize)
149 149
         {
150 150
             $this->sErrorMessage = $this->xTranslator->trans('errors.upload.max-size', $aUploadedFile);
151 151
             return false;
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         // Verify the min size
154 154
         $xDefault = $this->xConfig->getOption('upload.default.min-size', 0);
155 155
         $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.min-size', $xDefault);
156
-        if($iSize > 0 && $aUploadedFile['size'] < $iSize)
156
+        if ($iSize > 0 && $aUploadedFile['size'] < $iSize)
157 157
         {
158 158
             $this->sErrorMessage = $this->xTranslator->trans('errors.upload.min-size', $aUploadedFile);
159 159
             return false;
Please login to merge, or discard this patch.