GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( e01879...7e1050 )
by Calima
08:53
created
symfony/console/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -589,6 +589,9 @@
 block discarded – undo
589 589
         return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated);
590 590
     }
591 591
 
592
+    /**
593
+     * @param string $expected
594
+     */
592 595
     protected function generateOutput($expected)
593 596
     {
594 597
         $count = substr_count($expected, "\n");
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
         rewind($output->getStream());
28 28
         $this->assertEquals(
29
-            $this->generateOutput('    0 [>---------------------------]').
30
-            $this->generateOutput('    1 [->--------------------------]').
29
+            $this->generateOutput('    0 [>---------------------------]') .
30
+            $this->generateOutput('    1 [->--------------------------]') .
31 31
             $this->generateOutput('    0 [>---------------------------]'),
32 32
             stream_get_contents($output->getStream())
33 33
         );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         rewind($output->getStream());
43 43
         $this->assertEquals(
44
-            $this->generateOutput('    0 [>---------------------------]').
44
+            $this->generateOutput('    0 [>---------------------------]') .
45 45
             $this->generateOutput('    1 [->--------------------------]'),
46 46
             stream_get_contents($output->getStream())
47 47
         );
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         rewind($output->getStream());
57 57
         $this->assertEquals(
58
-            $this->generateOutput('    0 [>---------------------------]').
58
+            $this->generateOutput('    0 [>---------------------------]') .
59 59
             $this->generateOutput('    5 [----->----------------------]'),
60 60
             stream_get_contents($output->getStream())
61 61
         );
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 
71 71
         rewind($output->getStream());
72 72
         $this->assertEquals(
73
-            $this->generateOutput('    0 [>---------------------------]').
74
-            $this->generateOutput('    3 [--->------------------------]').
73
+            $this->generateOutput('    0 [>---------------------------]') .
74
+            $this->generateOutput('    3 [--->------------------------]') .
75 75
             $this->generateOutput('    5 [----->----------------------]'),
76 76
             stream_get_contents($output->getStream())
77 77
         );
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
         rewind($output->getStream());
88 88
         $this->assertEquals(
89
-            $this->generateOutput('  9/10 [=========================>--]  90%').
90
-            $this->generateOutput(' 10/10 [============================] 100%').
89
+            $this->generateOutput('  9/10 [=========================>--]  90%') .
90
+            $this->generateOutput(' 10/10 [============================] 100%') .
91 91
             $this->generateOutput(' 11/11 [============================] 100%'),
92 92
             stream_get_contents($output->getStream())
93 93
         );
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         rewind($output->getStream());
108 108
         $this->assertEquals(
109
-            $this->generateOutput('  0/10 [/         ]   0%').
109
+            $this->generateOutput('  0/10 [/         ]   0%') .
110 110
             $this->generateOutput('  1/10 [_/        ]  10%'),
111 111
             stream_get_contents($output->getStream())
112 112
         );
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
 
159 159
         rewind($output->getStream());
160 160
         $this->assertEquals(
161
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
162
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
163
-            $this->generateOutput('  1/50 [>---------------------------]   2%').
161
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
162
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
163
+            $this->generateOutput('  1/50 [>---------------------------]   2%') .
164 164
             $this->generateOutput('  2/50 [=>--------------------------]   4%'),
165 165
             stream_get_contents($output->getStream())
166 166
         );
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 
181 181
         rewind($output->getStream());
182 182
         $this->assertEquals(
183
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
184
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
185
-            $this->generateOutput('  1/50 [>---------------------------]   2%').
183
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
184
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
185
+            $this->generateOutput('  1/50 [>---------------------------]   2%') .
186 186
             $this->generateOutput('  2/50 [=>--------------------------]     '),
187 187
             stream_get_contents($output->getStream())
188 188
         );
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         rewind($output->getStream());
199 199
         $this->assertEquals(
200
-            $this->generateOutput(' 0/50 [>---------------------------]').
200
+            $this->generateOutput(' 0/50 [>---------------------------]') .
201 201
             $this->generateOutput(' 1/50 [>---------------------------]'),
202 202
             stream_get_contents($output->getStream())
203 203
         );
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
         rewind($output->getStream());
216 216
         $this->assertEquals(
217
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
218
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
219
-            $this->generateOutput('  1/50 [>---------------------------]   2%').
220
-            $this->generateOutput(' 15/50 [========>-------------------]  30%').
217
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
218
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
219
+            $this->generateOutput('  1/50 [>---------------------------]   2%') .
220
+            $this->generateOutput(' 15/50 [========>-------------------]  30%') .
221 221
             $this->generateOutput(' 25/50 [==============>-------------]  50%'),
222 222
             stream_get_contents($output->getStream())
223 223
         );
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         rewind($output->getStream());
272 272
         $this->assertEquals(
273
-            $this->generateOutput('    0 [>---------------------------]').
273
+            $this->generateOutput('    0 [>---------------------------]') .
274 274
             $this->generateOutput('    3 [■■■>------------------------]'),
275 275
             stream_get_contents($output->getStream())
276 276
         );
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
 
286 286
         rewind($output->getStream());
287 287
         $this->assertEquals(
288
-            $this->generateOutput('  0/50 [>---------------------------]   0%').
289
-            $this->generateOutput(' 25/50 [==============>-------------]  50%').
288
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
289
+            $this->generateOutput(' 25/50 [==============>-------------]  50%') .
290 290
             $this->generateOutput('                                          '),
291 291
             stream_get_contents($output->getStream())
292 292
         );
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 
303 303
         rewind($output->getStream());
304 304
         $this->assertEquals(
305
-            $this->generateOutput('   0/200 [>---------------------------]   0%').
306
-            $this->generateOutput('   0/200 [>---------------------------]   0%').
307
-            $this->generateOutput(' 199/200 [===========================>]  99%').
305
+            $this->generateOutput('   0/200 [>---------------------------]   0%') .
306
+            $this->generateOutput('   0/200 [>---------------------------]   0%') .
307
+            $this->generateOutput(' 199/200 [===========================>]  99%') .
308 308
             $this->generateOutput(' 200/200 [============================] 100%'),
309 309
             stream_get_contents($output->getStream())
310 310
         );
@@ -323,16 +323,16 @@  discard block
 block discarded – undo
323 323
 
324 324
         rewind($output->getStream());
325 325
         $this->assertEquals(
326
-            "   0/200 [>---------------------------]   0%\n".
327
-            "  20/200 [==>-------------------------]  10%\n".
328
-            "  40/200 [=====>----------------------]  20%\n".
329
-            "  60/200 [========>-------------------]  30%\n".
330
-            "  80/200 [===========>----------------]  40%\n".
331
-            " 100/200 [==============>-------------]  50%\n".
332
-            " 120/200 [================>-----------]  60%\n".
333
-            " 140/200 [===================>--------]  70%\n".
334
-            " 160/200 [======================>-----]  80%\n".
335
-            " 180/200 [=========================>--]  90%\n".
326
+            "   0/200 [>---------------------------]   0%\n" .
327
+            "  20/200 [==>-------------------------]  10%\n" .
328
+            "  40/200 [=====>----------------------]  20%\n" .
329
+            "  60/200 [========>-------------------]  30%\n" .
330
+            "  80/200 [===========>----------------]  40%\n" .
331
+            " 100/200 [==============>-------------]  50%\n" .
332
+            " 120/200 [================>-----------]  60%\n" .
333
+            " 140/200 [===================>--------]  70%\n" .
334
+            " 160/200 [======================>-----]  80%\n" .
335
+            " 180/200 [=========================>--]  90%\n" .
336 336
             " 200/200 [============================] 100%",
337 337
             stream_get_contents($output->getStream())
338 338
         );
@@ -349,8 +349,8 @@  discard block
 block discarded – undo
349 349
 
350 350
         rewind($output->getStream());
351 351
         $this->assertEquals(
352
-            "  0/50 [>---------------------------]   0%\n".
353
-            " 25/50 [==============>-------------]  50%\n".
352
+            "  0/50 [>---------------------------]   0%\n" .
353
+            " 25/50 [==============>-------------]  50%\n" .
354 354
             " 50/50 [============================] 100%",
355 355
             stream_get_contents($output->getStream())
356 356
         );
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
         rewind($output->getStream());
366 366
         $this->assertEquals(
367
-            "    0 [>---------------------------]\n".
367
+            "    0 [>---------------------------]\n" .
368 368
             "    1 [->--------------------------]",
369 369
             stream_get_contents($output->getStream())
370 370
         );
@@ -402,28 +402,28 @@  discard block
 block discarded – undo
402 402
 
403 403
         rewind($output->getStream());
404 404
         $this->assertEquals(
405
-            $this->generateOutput(' 0/2 [>---------------------------]   0%')."\n".
406
-            $this->generateOutput(' 0/3 [#---------------------------]   0%')."\n".
407
-            rtrim($this->generateOutput('    0 [>---------------------------]')).
408
-
409
-            "\033[2A".
410
-            $this->generateOutput(' 1/2 [==============>-------------]  50%')."\n".
411
-            $this->generateOutput(' 1/3 [=========#------------------]  33%')."\n".
412
-            rtrim($this->generateOutput('    1 [->--------------------------]')).
413
-
414
-            "\033[2A".
415
-            $this->generateOutput(' 2/2 [============================] 100%')."\n".
416
-            $this->generateOutput(' 2/3 [==================#---------]  66%')."\n".
417
-            rtrim($this->generateOutput('    2 [-->-------------------------]')).
418
-
419
-            "\033[2A".
420
-            "\n".
421
-            $this->generateOutput(' 3/3 [============================] 100%')."\n".
422
-            rtrim($this->generateOutput('    3 [--->------------------------]')).
423
-
424
-            "\033[2A".
425
-            "\n".
426
-            "\n".
405
+            $this->generateOutput(' 0/2 [>---------------------------]   0%') . "\n" .
406
+            $this->generateOutput(' 0/3 [#---------------------------]   0%') . "\n" .
407
+            rtrim($this->generateOutput('    0 [>---------------------------]')) .
408
+
409
+            "\033[2A" .
410
+            $this->generateOutput(' 1/2 [==============>-------------]  50%') . "\n" .
411
+            $this->generateOutput(' 1/3 [=========#------------------]  33%') . "\n" .
412
+            rtrim($this->generateOutput('    1 [->--------------------------]')) .
413
+
414
+            "\033[2A" .
415
+            $this->generateOutput(' 2/2 [============================] 100%') . "\n" .
416
+            $this->generateOutput(' 2/3 [==================#---------]  66%') . "\n" .
417
+            rtrim($this->generateOutput('    2 [-->-------------------------]')) .
418
+
419
+            "\033[2A" .
420
+            "\n" .
421
+            $this->generateOutput(' 3/3 [============================] 100%') . "\n" .
422
+            rtrim($this->generateOutput('    3 [--->------------------------]')) .
423
+
424
+            "\033[2A" .
425
+            "\n" .
426
+            "\n" .
427 427
             rtrim($this->generateOutput('    3 [============================]')),
428 428
             stream_get_contents($output->getStream())
429 429
         );
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
 
443 443
         rewind($output->getStream());
444 444
         $this->assertEquals(
445
-            rtrim($this->generateOutput('    0 [>---------------------------]')).
446
-            rtrim($this->generateOutput('    1 [->--------------------------]')).
447
-            rtrim($this->generateOutput('    2 [-->-------------------------]')).
448
-            rtrim($this->generateOutput('    3 [--->------------------------]')).
445
+            rtrim($this->generateOutput('    0 [>---------------------------]')) .
446
+            rtrim($this->generateOutput('    1 [->--------------------------]')) .
447
+            rtrim($this->generateOutput('    2 [-->-------------------------]')) .
448
+            rtrim($this->generateOutput('    3 [--->------------------------]')) .
449 449
             rtrim($this->generateOutput('    3 [============================]')),
450 450
             stream_get_contents($output->getStream())
451 451
         );
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 
454 454
     public function testAddingPlaceholderFormatter()
455 455
     {
456
-        ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) {
456
+        ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function(ProgressBar $bar) {
457 457
             return $bar->getMaxSteps() - $bar->getProgress();
458 458
         });
459 459
         $bar = new ProgressBar($output = $this->getOutputStream(), 3);
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 
466 466
         rewind($output->getStream());
467 467
         $this->assertEquals(
468
-            $this->generateOutput(' 3 [>---------------------------]').
469
-            $this->generateOutput(' 2 [=========>------------------]').
468
+            $this->generateOutput(' 3 [>---------------------------]') .
469
+            $this->generateOutput(' 2 [=========>------------------]') .
470 470
             $this->generateOutput(' 0 [============================]'),
471 471
             stream_get_contents($output->getStream())
472 472
         );
@@ -484,9 +484,9 @@  discard block
 block discarded – undo
484 484
 
485 485
         rewind($output->getStream());
486 486
         $this->assertEquals(
487
-            $this->generateOutput(">---------------------------\nfoobar").
488
-            $this->generateOutput("=========>------------------\nfoobar                      ").
489
-            $this->generateOutput("                            \n                            ").
487
+            $this->generateOutput(">---------------------------\nfoobar") .
488
+            $this->generateOutput("=========>------------------\nfoobar                      ") .
489
+            $this->generateOutput("                            \n                            ") .
490 490
             $this->generateOutput("============================\nfoobar                      "),
491 491
             stream_get_contents($output->getStream())
492 492
         );
@@ -495,12 +495,12 @@  discard block
 block discarded – undo
495 495
     public function testAnsiColorsAndEmojis()
496 496
     {
497 497
         $bar = new ProgressBar($output = $this->getOutputStream(), 15);
498
-        ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) {
498
+        ProgressBar::setPlaceholderFormatterDefinition('memory', function(ProgressBar $bar) {
499 499
             static $i = 0;
500 500
             $mem = 100000 * $i;
501 501
             $colors = $i++ ? '41;37' : '44;37';
502 502
 
503
-            return "\033[".$colors."m ".Helper::formatMemory($mem)." \033[0m";
503
+            return "\033[" . $colors . "m " . Helper::formatMemory($mem) . " \033[0m";
504 504
         });
505 505
         $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n 
Please login to merge, or discard this patch.
Sistema/Ayudantes/CFPHPMenu.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     
31 31
     
32 32
     function menu_ul($sel = 'inicio')
33
-   {
33
+    {
34 34
         $items = array(
35 35
             'inicio' => array(
36 36
                 'id'     => 'inicio',
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
     
67 67
     function menu_p($sel = 'inicio', $separador = '')
68
-   {
68
+    {
69 69
         //$CI =& get_instance();
70 70
         $items = array(
71 71
             'inicio' => array(
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
             )
54 54
         );
55 55
         
56
-        $menu = '<ul class="inline" >'.  PHP_EOL;
57
-        foreach($items as $item)
56
+        $menu = '<ul class="inline" >' . PHP_EOL;
57
+        foreach ($items as $item)
58 58
         {
59 59
             $current = (in_array($sel, $item)) ? ' class="current"' : '';
60
-            $id = (!empty($item['id'])) ? ' id="'.$item['id'].'"' : '';
61
-            $menu .= '<li'.$current.'><a href="'.$item['link'].'"'.$id.'>'.$item['title'].'</a></li>'."\n";
60
+            $id = (!empty($item['id'])) ? ' id="' . $item['id'] . '"' : '';
61
+            $menu .= '<li' . $current . '><a href="' . $item['link'] . '"' . $id . '>' . $item['title'] . '</a></li>' . "\n";
62 62
         }
63
-        $menu .= '</ul>'. PHP_EOL . PHP_EOL;
63
+        $menu .= '</ul>' . PHP_EOL . PHP_EOL;
64 64
         return $menu;
65 65
     }
66 66
     
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 
92 92
         $count = count($items);
93 93
         $i = 0;
94
-        $menu =  PHP_EOL .'<p class="bottom_nav">';
95
-        foreach($items as $item)
94
+        $menu = PHP_EOL . '<p class="bottom_nav">';
95
+        foreach ($items as $item)
96 96
         {
97 97
             $current = (in_array($sel, $item)) ? ' class="current"' : '';
98
-            $id = (!empty($item['id'])) ? ' id="'.$item['id'].'"' : '';
99
-            $menu .= '<a'.$current.' href="'.$item['link'].'"'.$id.'>'.$item['title'].'</a>';
98
+            $id = (!empty($item['id'])) ? ' id="' . $item['id'] . '"' : '';
99
+            $menu .= '<a' . $current . ' href="' . $item['link'] . '"' . $id . '>' . $item['title'] . '</a>';
100 100
             $i++;
101
-            if($count != $i)
101
+            if ($count != $i)
102 102
             {
103
-                $menu .= ' '.$separador.' ';
103
+                $menu .= ' ' . $separador . ' ';
104 104
             }
105 105
         }
106
-        $menu .= '</p>'. PHP_EOL ;
106
+        $menu .= '</p>' . PHP_EOL;
107 107
         return $menu;
108 108
     }
109 109
     
Please login to merge, or discard this patch.
Sistema/Ayudantes/CFPHPPaginador.php 3 patches
Indentation   +236 added lines, -236 removed lines patch added patch discarded remove patch
@@ -39,311 +39,311 @@
 block discarded – undo
39 39
  * (you can pass the most critical GETs manually if you like)
40 40
  */
41 41
  
42
- //Esta clase fue editada por programadores de Cf con la aprobacion de Ruben Arroyo
42
+    //Esta clase fue editada por programadores de Cf con la aprobacion de Ruben Arroyo
43 43
 
44 44
 namespace Sistema\Ayudantes;
45 45
 
46 46
 class Cf_PHPPaginator {
47
-	/*
47
+    /*
48 48
 	 * MAIN Settings (required)
49 49
 	 */
50 50
 	
51
-	/**
52
-	 * 
53
-	 * @total_records string Total of records to paginate (specify manually)
54
-	 */
55
-	public $total_records = 0;
51
+    /**
52
+     * 
53
+     * @total_records string Total of records to paginate (specify manually)
54
+     */
55
+    public $total_records = 0;
56 56
 	
57 57
 	
58
-	/*
58
+    /*
59 59
 	 * MAIN Settings (optional)
60 60
 	 */
61 61
 	
62
-	/**
63
-	 * @style string  Specify Class to define
64
-	 * @tutorial If is specified, it would create <div class="style"> otherwise it not create div
65
-	 */
66
-	public $style = '';
62
+    /**
63
+     * @style string  Specify Class to define
64
+     * @tutorial If is specified, it would create <div class="style"> otherwise it not create div
65
+     */
66
+    public $style = '';
67 67
 	
68
-	/**
69
-	 * @records number Max records to show on every page
70
-	 */
71
-	public $records = 20;
68
+    /**
69
+     * @records number Max records to show on every page
70
+     */
71
+    public $records = 20;
72 72
 	
73
-	/** 
74
-	 * @max_links number Maxium quantity of links to show before and after actual page
75
-	 * @example If current page is 4 and MAX is 2, it show "2 3 4 5 6"
76
-	 */
77
-	public $max_links = 3;
73
+    /** 
74
+     * @max_links number Maxium quantity of links to show before and after actual page
75
+     * @example If current page is 4 and MAX is 2, it show "2 3 4 5 6"
76
+     */
77
+    public $max_links = 3;
78 78
 	
79
-	/**
80
-	 * @get_name string Specify INDEX of GET that is used
81
-	 * 
82
-	 * It will load automatically the current page. 
83
-	 * If you like, you can specify manually in "$cur_page" 
84
-	 * (if you like filter previously or the script will not load directly from URL)  
85
-	 */
86
-	public $get_name = 'pag';
79
+    /**
80
+     * @get_name string Specify INDEX of GET that is used
81
+     * 
82
+     * It will load automatically the current page. 
83
+     * If you like, you can specify manually in "$cur_page" 
84
+     * (if you like filter previously or the script will not load directly from URL)  
85
+     */
86
+    public $get_name = 'pag';
87 87
 	
88
-	/**
89
-	 * @max_records number Specify maxium quantity of registers will be loaded. "0" disable this
90
-	 */
91
-	public $max_records = 0;
88
+    /**
89
+     * @max_records number Specify maxium quantity of registers will be loaded. "0" disable this
90
+     */
91
+    public $max_records = 0;
92 92
 	
93 93
 	
94
-	/**
95
-	 * @recicle_url boolean If is true, modify directly tue current URL to put the pagination (if not exist any, add &pag= to the end)
96
-	 * If is true, $url_start and $url_end will be ignored
97
-	 */
98
-	public $recicle_url = true;
94
+    /**
95
+     * @recicle_url boolean If is true, modify directly tue current URL to put the pagination (if not exist any, add &pag= to the end)
96
+     * If is true, $url_start and $url_end will be ignored
97
+     */
98
+    public $recicle_url = true;
99 99
 	
100
-	/**
101
-	 * @specific_get array Specify what GETs (and order) you like recicle.
102
-	 * Set array() to ALL (not recomended to avoid atacks DoS)  
103
-	 * Set '' for any
104
-	 * @example array('section', 'pag', 'subsection');
105
-	 * If you don't need 'pag' in the midle, you can ignore it.
106
-	 * WARNING: If the order is very important, use the pag at THE END of url   
107
-	 */
108
-	public $specific_get = '';
100
+    /**
101
+     * @specific_get array Specify what GETs (and order) you like recicle.
102
+     * Set array() to ALL (not recomended to avoid atacks DoS)  
103
+     * Set '' for any
104
+     * @example array('section', 'pag', 'subsection');
105
+     * If you don't need 'pag' in the midle, you can ignore it.
106
+     * WARNING: If the order is very important, use the pag at THE END of url   
107
+     */
108
+    public $specific_get = '';
109 109
 	
110
-	/**
111
-	 * @url_start string specify how the URL of every link start. IF $recicle_url is TRUE, this will be ignored 
112
-	 * @example If you use MOD_REWRITE or JAVASCRIPT, you can put "http://mywebsite.com/subdir/pag-" or "javascript:paginate("
113
-	 * 
114
-	 * This value will auto completed if you leave empty 
115
-	 */
116
-	public $url_start = '';
110
+    /**
111
+     * @url_start string specify how the URL of every link start. IF $recicle_url is TRUE, this will be ignored 
112
+     * @example If you use MOD_REWRITE or JAVASCRIPT, you can put "http://mywebsite.com/subdir/pag-" or "javascript:paginate("
113
+     * 
114
+     * This value will auto completed if you leave empty 
115
+     */
116
+    public $url_start = '';
117 117
 	
118
-	/**
119
-	 * @url_end string specify how the URL of every link ends. IF $recicle_url is TRUE, this will be ignored
120
-	 * @example If you use MOD_REWRITE or JAVASCRIPT, you can put "/" or ");"
121
-	 * 
122
-	 * This value will auto completed if you leave empty
123
-	 */
124
-	public $url_end = '';
118
+    /**
119
+     * @url_end string specify how the URL of every link ends. IF $recicle_url is TRUE, this will be ignored
120
+     * @example If you use MOD_REWRITE or JAVASCRIPT, you can put "/" or ");"
121
+     * 
122
+     * This value will auto completed if you leave empty
123
+     */
124
+    public $url_end = '';
125 125
 	
126 126
 	
127 127
 	
128
-	/*
128
+    /*
129 129
 	 * Design settings
130 130
 	 */
131 131
 	
132
-	// Icons to show "First | Previous | Next | Last"
133
-	//& laquo; = � | & lt; = <
132
+    // Icons to show "First | Previous | Next | Last"
133
+    //& laquo; = � | & lt; = <
134 134
     //& raquo; = � | & gt; = >
135 135
     // Leave empty '' to not show or ' ' to show empty
136
-	public $first = '[&lt;&lt;]';
137
-	public $previous = '[&lt;]';
138
-	public $next = '[&gt;]';
139
-	public $last = '[&gt;&gt;]';
136
+    public $first = '[&lt;&lt;]';
137
+    public $previous = '[&lt;]';
138
+    public $next = '[&gt;]';
139
+    public $last = '[&gt;&gt;]';
140 140
 	
141 141
 	
142
-	/*
142
+    /*
143 143
 	 * RETURNS FROM PAGINATOR and internal use
144 144
 	 */
145
-	// Return current page (auto loaded)
146
-	public $cur_page;
145
+    // Return current page (auto loaded)
146
+    public $cur_page;
147 147
 	
148
-	// original page loaded
149
-	// it contains the real value in GET (ex: -1, 5...) to compare later
150
-	public $original_page;
148
+    // original page loaded
149
+    // it contains the real value in GET (ex: -1, 5...) to compare later
150
+    public $original_page;
151 151
 	
152
-	// Return total pages
153
-	public $total_pages;
152
+    // Return total pages
153
+    public $total_pages;
154 154
 	
155
-	// LIMIT_START / Specify the first record of the page (ex, in page 3 and 20 records is record num 40)
156
-	// Limit max is $records
157
-	public $first_record;
155
+    // LIMIT_START / Specify the first record of the page (ex, in page 3 and 20 records is record num 40)
156
+    // Limit max is $records
157
+    public $first_record;
158 158
 	
159
-	// Specify limit to put directly in mysql query ( LIMIT 0,20 )
160
-	public $limit;
159
+    // Specify limit to put directly in mysql query ( LIMIT 0,20 )
160
+    public $limit;
161 161
 	
162 162
 	
163 163
 /*
164 164
  * Functions
165 165
  */
166
-	/**
167
-	 * @name paginate
168
-	 * @tutorial This function is called directly to load all params
169
-	 * @example $pag->paginate();
170
-	 */
171
-	public function paginate() {
172
-		$this->get(); // Filtering and obtaining variables
173
-		$this->calculate(); // Calc current page
174
-		$this->prepareUrl(); // Preparing URL to show
175
-	}
166
+    /**
167
+     * @name paginate
168
+     * @tutorial This function is called directly to load all params
169
+     * @example $pag->paginate();
170
+     */
171
+    public function paginate() {
172
+        $this->get(); // Filtering and obtaining variables
173
+        $this->calculate(); // Calc current page
174
+        $this->prepareUrl(); // Preparing URL to show
175
+    }
176 176
 	
177
-	/**
178
-	 * @name show
179
-	 * @tutorial Show links of pagination
180
-	 * @example $pag->show();
181
-	 */
182
-	public function show() {
183
-		// Prepare string with links
184
-		// Reading here variables is faster than "$this->var"
185
-		$cur_page = $this->cur_page; 
186
-		$url_start = $this->url_start;
187
-		$url_end = $this->url_end;
177
+    /**
178
+     * @name show
179
+     * @tutorial Show links of pagination
180
+     * @example $pag->show();
181
+     */
182
+    public function show() {
183
+        // Prepare string with links
184
+        // Reading here variables is faster than "$this->var"
185
+        $cur_page = $this->cur_page; 
186
+        $url_start = $this->url_start;
187
+        $url_end = $this->url_end;
188 188
 		
189
-		$start = $cur_page - $this->max_links;
190
-		$end = $cur_page + $this->max_links;
189
+        $start = $cur_page - $this->max_links;
190
+        $end = $cur_page + $this->max_links;
191 191
 		
192
-		if ($start < 1) $start = 1;
193
-		if ($end > $this->total_pages) $end = $this->total_pages;
192
+        if ($start < 1) $start = 1;
193
+        if ($end > $this->total_pages) $end = $this->total_pages;
194 194
 		
195
-		// Showing all clickable pages (create div if class is defined)
196
-		if ($this->style != '') $r = '<div class="'.$this->style.'">';
197
-		else $r = '';
195
+        // Showing all clickable pages (create div if class is defined)
196
+        if ($this->style != '') $r = '<div class="'.$this->style.'">';
197
+        else $r = '';
198 198
 		
199 199
 		
200
-		// First / previous
201
-		if ($this->cur_page > 1) {
202
-			if ($this->first != '') $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">'.$this->first.'</a> ';
203
-			if ($this->previous != '') $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">'.$this->previous.'</a> ';
204
-		}
200
+        // First / previous
201
+        if ($this->cur_page > 1) {
202
+            if ($this->first != '') $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">'.$this->first.'</a> ';
203
+            if ($this->previous != '') $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">'.$this->previous.'</a> ';
204
+        }
205 205
 		
206
-		// You can optimize this separating BEFORE and AFTER current page in two for (to avoid load "if" in each loop)
207
-		// but it would be difficult on changes
208
-		for ($n=$start; $n<=$end; $n++) {
209
-			if ($n != $cur_page) $r .= '<a class="link" href="'. $url_start . $n . $url_end . '">'.$n.'</a> ';
210
-			else $r .= '<a class="current">'.$n.'</a> ';
211
-		}
206
+        // You can optimize this separating BEFORE and AFTER current page in two for (to avoid load "if" in each loop)
207
+        // but it would be difficult on changes
208
+        for ($n=$start; $n<=$end; $n++) {
209
+            if ($n != $cur_page) $r .= '<a class="link" href="'. $url_start . $n . $url_end . '">'.$n.'</a> ';
210
+            else $r .= '<a class="current">'.$n.'</a> ';
211
+        }
212 212
 		
213
-		// next / last
214
-		if ($this->cur_page < $this->total_pages) {
215
-			if ($this->next != '') $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">'.$this->next.'</a> ';
216
-			if ($this->last != '') $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end .'">'.$this->last.'</a> ';
217
-		}
213
+        // next / last
214
+        if ($this->cur_page < $this->total_pages) {
215
+            if ($this->next != '') $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">'.$this->next.'</a> ';
216
+            if ($this->last != '') $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end .'">'.$this->last.'</a> ';
217
+        }
218 218
 		
219
-		// End div (if exist)
220
-		if ($this->style != '') $r .= '</div>';
219
+        // End div (if exist)
220
+        if ($this->style != '') $r .= '</div>';
221 221
 		
222
-		return $r;
223
-	}
222
+        return $r;
223
+    }
224 224
 	
225 225
 	
226
-	/**
227
-	 * @name get
228
-	 * @tutorial This function is autoloaded, it get the current page and filter number to avoid hackers
229
-	 */	 
230
-	private function get() {
231
-		if (!is_numeric($this->cur_page)) {
232
-			// First get the actual page, by default 1
233
-			$cur_page = isset($_GET[$this->get_name]) ? $_GET[$this->get_name] : 1;
234
-			$this->original_page = $cur_page;
226
+    /**
227
+     * @name get
228
+     * @tutorial This function is autoloaded, it get the current page and filter number to avoid hackers
229
+     */	 
230
+    private function get() {
231
+        if (!is_numeric($this->cur_page)) {
232
+            // First get the actual page, by default 1
233
+            $cur_page = isset($_GET[$this->get_name]) ? $_GET[$this->get_name] : 1;
234
+            $this->original_page = $cur_page;
235 235
 			
236
-			// Filter values
237
-			if (!is_numeric($cur_page) or $cur_page < 1) $cur_page = 1;
236
+            // Filter values
237
+            if (!is_numeric($cur_page) or $cur_page < 1) $cur_page = 1;
238 238
 			
239
-			// Set new filtered values (is faster this method)
240
-			$this->cur_page = $cur_page;
241
-		} else {
242
-			$this->original_page = $cur_page;
243
-		}
244
-	}
239
+            // Set new filtered values (is faster this method)
240
+            $this->cur_page = $cur_page;
241
+        } else {
242
+            $this->original_page = $cur_page;
243
+        }
244
+    }
245 245
 	
246
-	/**
247
-	 * @name calculate
248
-	 * @tutorial Do all calcs about current and last page
249
-	 */
250
-	private function calculate() {
251
-		// This vars are very used, so is faster do this
252
-		$max_records = $this->max_records;
253
-		$records = $this->records;
246
+    /**
247
+     * @name calculate
248
+     * @tutorial Do all calcs about current and last page
249
+     */
250
+    private function calculate() {
251
+        // This vars are very used, so is faster do this
252
+        $max_records = $this->max_records;
253
+        $records = $this->records;
254 254
 		
255
-		// Force maxium records loaded (only if is specified by user)
256
-		if ($max_records  > 0 and $max_records  > $total_records) 
257
-			$this->total_records = $max_records;
255
+        // Force maxium records loaded (only if is specified by user)
256
+        if ($max_records  > 0 and $max_records  > $total_records) 
257
+            $this->total_records = $max_records;
258 258
 		
259
-		// Calculate total pages that have
260
-		$total_pages = ceil($this->total_records / $records);
259
+        // Calculate total pages that have
260
+        $total_pages = ceil($this->total_records / $records);
261 261
 		
262
-		// Is correct current page?
263
-		if ($this->cur_page > $total_pages) $this->cur_page = $total_pages;
264
-		$this->total_pages = $total_pages;
262
+        // Is correct current page?
263
+        if ($this->cur_page > $total_pages) $this->cur_page = $total_pages;
264
+        $this->total_pages = $total_pages;
265 265
 		
266
-		// Specify LIMIT to do a query
267
-		$start = ($this->cur_page - 1) * $records;
266
+        // Specify LIMIT to do a query
267
+        $start = ($this->cur_page - 1) * $records;
268 268
 		
269
-		// Forcing maixum records to show (only if is specified by user)
270
-		if ($max_records > 0 and $records > $max_records) {
271
-			$records = $max_records;
272
-			$this->records = $records;
273
-		}
269
+        // Forcing maixum records to show (only if is specified by user)
270
+        if ($max_records > 0 and $records > $max_records) {
271
+            $records = $max_records;
272
+            $this->records = $records;
273
+        }
274 274
 			
275 275
 		
276
-		// Saving changes
277
-		$this->first_record = $start;
278
-		$this->limit = ' LIMIT '.$start.','.$records.' ';
279
-	}
276
+        // Saving changes
277
+        $this->first_record = $start;
278
+        $this->limit = ' LIMIT '.$start.','.$records.' ';
279
+    }
280 280
 	
281
-	/**
282
-	 * @name prepareUrl
283
-	 * @tutorial It prepare the url to show in each link, specified by user
284
-	 * If recicle URL is false, it will auto load $url_start and $url_end
285
-	 */
286
-	private function prepareUrl() {
287
-		// This script use three methods to recicle GET depending user selection
288
-		if ($this->recicle_url) {
289
-			// gonna to recicle the URL
290
-			$gets = $this->specific_get;
291
-			$get_name = $this->get_name;
281
+    /**
282
+     * @name prepareUrl
283
+     * @tutorial It prepare the url to show in each link, specified by user
284
+     * If recicle URL is false, it will auto load $url_start and $url_end
285
+     */
286
+    private function prepareUrl() {
287
+        // This script use three methods to recicle GET depending user selection
288
+        if ($this->recicle_url) {
289
+            // gonna to recicle the URL
290
+            $gets = $this->specific_get;
291
+            $get_name = $this->get_name;
292 292
 			
293
-			// If user specified an array
294
-			if (is_array($gets)) {
295
-				if (empty($gets)) {
296
-					// And is empty, we have to Recicle ALL GET
297
-					// To know that page needs to be replaced we will use the "original_page" (the real get)
298
-					// Cortamos "pag=2" para obtener lo que va antes y despues, as� poder modificar directamente ese pag=2 por la pagina actual
299
-					$query_string = explode($this->get_name.'='.$this->original_page, $_SERVER['QUERY_STRING']);
293
+            // If user specified an array
294
+            if (is_array($gets)) {
295
+                if (empty($gets)) {
296
+                    // And is empty, we have to Recicle ALL GET
297
+                    // To know that page needs to be replaced we will use the "original_page" (the real get)
298
+                    // Cortamos "pag=2" para obtener lo que va antes y despues, as� poder modificar directamente ese pag=2 por la pagina actual
299
+                    $query_string = explode($this->get_name.'='.$this->original_page, $_SERVER['QUERY_STRING']);
300 300
 					
301
-					// How start the new URL? To know it, we need to see the last character from current string
302
-					if (!in_array(substr($query_string[0], -1), array('?', '&'))) {
303
-						// Current string haven't any at end and it isn't "&" or "?" ?
304
-						// If initial string have one character at least it means that not is the first index 
305
-						if (isset($query_string[0][0])) $this->url_start = '?'.$query_string[0].'&';
306
-						else $this->url_start = '?'.$query_string[0];
307
-					} else {
308
-						// Current string already have ? or &,
309
-						$this->url_start = '?'.$query_string[0];
310
-					}
301
+                    // How start the new URL? To know it, we need to see the last character from current string
302
+                    if (!in_array(substr($query_string[0], -1), array('?', '&'))) {
303
+                        // Current string haven't any at end and it isn't "&" or "?" ?
304
+                        // If initial string have one character at least it means that not is the first index 
305
+                        if (isset($query_string[0][0])) $this->url_start = '?'.$query_string[0].'&';
306
+                        else $this->url_start = '?'.$query_string[0];
307
+                    } else {
308
+                        // Current string already have ? or &,
309
+                        $this->url_start = '?'.$query_string[0];
310
+                    }
311 311
 					
312
-					$this->url_end = isset($query_string[1]) ? $query_string[1] : '';
313
-				} else {
314
-					// Only specifics GET, reading all and finally leave in the same order
315
-					// With this we can clean all GET that we don't need (like hacker attempts)
316
-					$tmp = '';
317
-					$tmp_start = ''; // If we found the current page, we move here all $tmp
318
-					foreach ($gets as $get) {
319
-						if ($get != $get_name) {
320
-							// Trying to get the GET
321
-							if (isset($_GET[$get])) $tmp .= $get.'='.$_GET[$get].'&';
322
-						} else {
323
-							// Pour the $tmp content to $tmp_start
324
-							if ($tmp_start == '') $tmp_start .= '?';
325
-							$tmp_start .= $tmp;
326
-							$tmp = '';
327
-						}
328
-					}
312
+                    $this->url_end = isset($query_string[1]) ? $query_string[1] : '';
313
+                } else {
314
+                    // Only specifics GET, reading all and finally leave in the same order
315
+                    // With this we can clean all GET that we don't need (like hacker attempts)
316
+                    $tmp = '';
317
+                    $tmp_start = ''; // If we found the current page, we move here all $tmp
318
+                    foreach ($gets as $get) {
319
+                        if ($get != $get_name) {
320
+                            // Trying to get the GET
321
+                            if (isset($_GET[$get])) $tmp .= $get.'='.$_GET[$get].'&';
322
+                        } else {
323
+                            // Pour the $tmp content to $tmp_start
324
+                            if ($tmp_start == '') $tmp_start .= '?';
325
+                            $tmp_start .= $tmp;
326
+                            $tmp = '';
327
+                        }
328
+                    }
329 329
 					
330
-					// Finally, write the changes in the object
331
-					if ($tmp_start != '') {
332
-						// If have start and end
333
-						$this->url_start = $tmp_start;
334
-						$this->url_end = $tmp;
335
-					}
336
-					else $this->url_start = '?'.$tmp;
337
-				}
338
-			} else{
339
-				// Non recicle
340
-				$this->url_start = '?';
341
-				$this->url_end = ''; 
342
-			}
330
+                    // Finally, write the changes in the object
331
+                    if ($tmp_start != '') {
332
+                        // If have start and end
333
+                        $this->url_start = $tmp_start;
334
+                        $this->url_end = $tmp;
335
+                    }
336
+                    else $this->url_start = '?'.$tmp;
337
+                }
338
+            } else{
339
+                // Non recicle
340
+                $this->url_start = '?';
341
+                $this->url_end = ''; 
342
+            }
343 343
 			
344
-			// Add the pagination
345
-			$this->url_start .= $this->get_name.'=';
346
-		}
347
-	}
344
+            // Add the pagination
345
+            $this->url_start .= $this->get_name.'=';
346
+        }
347
+    }
348 348
 }
349 349
 ?>
350 350
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -193,27 +193,27 @@  discard block
 block discarded – undo
193 193
 		if ($end > $this->total_pages) $end = $this->total_pages;
194 194
 		
195 195
 		// Showing all clickable pages (create div if class is defined)
196
-		if ($this->style != '') $r = '<div class="'.$this->style.'">';
196
+		if ($this->style != '') $r = '<div class="' . $this->style . '">';
197 197
 		else $r = '';
198 198
 		
199 199
 		
200 200
 		// First / previous
201 201
 		if ($this->cur_page > 1) {
202
-			if ($this->first != '') $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">'.$this->first.'</a> ';
203
-			if ($this->previous != '') $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">'.$this->previous.'</a> ';
202
+			if ($this->first != '') $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">' . $this->first . '</a> ';
203
+			if ($this->previous != '') $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">' . $this->previous . '</a> ';
204 204
 		}
205 205
 		
206 206
 		// You can optimize this separating BEFORE and AFTER current page in two for (to avoid load "if" in each loop)
207 207
 		// but it would be difficult on changes
208
-		for ($n=$start; $n<=$end; $n++) {
209
-			if ($n != $cur_page) $r .= '<a class="link" href="'. $url_start . $n . $url_end . '">'.$n.'</a> ';
210
-			else $r .= '<a class="current">'.$n.'</a> ';
208
+		for ($n = $start; $n <= $end; $n++) {
209
+			if ($n != $cur_page) $r .= '<a class="link" href="' . $url_start . $n . $url_end . '">' . $n . '</a> ';
210
+			else $r .= '<a class="current">' . $n . '</a> ';
211 211
 		}
212 212
 		
213 213
 		// next / last
214 214
 		if ($this->cur_page < $this->total_pages) {
215
-			if ($this->next != '') $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">'.$this->next.'</a> ';
216
-			if ($this->last != '') $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end .'">'.$this->last.'</a> ';
215
+			if ($this->next != '') $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">' . $this->next . '</a> ';
216
+			if ($this->last != '') $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end . '">' . $this->last . '</a> ';
217 217
 		}
218 218
 		
219 219
 		// End div (if exist)
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		$records = $this->records;
254 254
 		
255 255
 		// Force maxium records loaded (only if is specified by user)
256
-		if ($max_records  > 0 and $max_records  > $total_records) 
256
+		if ($max_records > 0 and $max_records > $total_records) 
257 257
 			$this->total_records = $max_records;
258 258
 		
259 259
 		// Calculate total pages that have
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 		
276 276
 		// Saving changes
277 277
 		$this->first_record = $start;
278
-		$this->limit = ' LIMIT '.$start.','.$records.' ';
278
+		$this->limit = ' LIMIT ' . $start . ',' . $records . ' ';
279 279
 	}
280 280
 	
281 281
 	/**
@@ -296,17 +296,17 @@  discard block
 block discarded – undo
296 296
 					// And is empty, we have to Recicle ALL GET
297 297
 					// To know that page needs to be replaced we will use the "original_page" (the real get)
298 298
 					// Cortamos "pag=2" para obtener lo que va antes y despues, as� poder modificar directamente ese pag=2 por la pagina actual
299
-					$query_string = explode($this->get_name.'='.$this->original_page, $_SERVER['QUERY_STRING']);
299
+					$query_string = explode($this->get_name . '=' . $this->original_page, $_SERVER['QUERY_STRING']);
300 300
 					
301 301
 					// How start the new URL? To know it, we need to see the last character from current string
302 302
 					if (!in_array(substr($query_string[0], -1), array('?', '&'))) {
303 303
 						// Current string haven't any at end and it isn't "&" or "?" ?
304 304
 						// If initial string have one character at least it means that not is the first index 
305
-						if (isset($query_string[0][0])) $this->url_start = '?'.$query_string[0].'&';
306
-						else $this->url_start = '?'.$query_string[0];
305
+						if (isset($query_string[0][0])) $this->url_start = '?' . $query_string[0] . '&';
306
+						else $this->url_start = '?' . $query_string[0];
307 307
 					} else {
308 308
 						// Current string already have ? or &,
309
-						$this->url_start = '?'.$query_string[0];
309
+						$this->url_start = '?' . $query_string[0];
310 310
 					}
311 311
 					
312 312
 					$this->url_end = isset($query_string[1]) ? $query_string[1] : '';
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 					foreach ($gets as $get) {
319 319
 						if ($get != $get_name) {
320 320
 							// Trying to get the GET
321
-							if (isset($_GET[$get])) $tmp .= $get.'='.$_GET[$get].'&';
321
+							if (isset($_GET[$get])) $tmp .= $get . '=' . $_GET[$get] . '&';
322 322
 						} else {
323 323
 							// Pour the $tmp content to $tmp_start
324 324
 							if ($tmp_start == '') $tmp_start .= '?';
@@ -333,16 +333,16 @@  discard block
 block discarded – undo
333 333
 						$this->url_start = $tmp_start;
334 334
 						$this->url_end = $tmp;
335 335
 					}
336
-					else $this->url_start = '?'.$tmp;
336
+					else $this->url_start = '?' . $tmp;
337 337
 				}
338
-			} else{
338
+			} else {
339 339
 				// Non recicle
340 340
 				$this->url_start = '?';
341 341
 				$this->url_end = ''; 
342 342
 			}
343 343
 			
344 344
 			// Add the pagination
345
-			$this->url_start .= $this->get_name.'=';
345
+			$this->url_start .= $this->get_name . '=';
346 346
 		}
347 347
 	}
348 348
 }
Please login to merge, or discard this patch.
Braces   +53 added lines, -20 removed lines patch added patch discarded remove patch
@@ -189,35 +189,55 @@  discard block
 block discarded – undo
189 189
 		$start = $cur_page - $this->max_links;
190 190
 		$end = $cur_page + $this->max_links;
191 191
 		
192
-		if ($start < 1) $start = 1;
193
-		if ($end > $this->total_pages) $end = $this->total_pages;
192
+		if ($start < 1) {
193
+		    $start = 1;
194
+		}
195
+		if ($end > $this->total_pages) {
196
+		    $end = $this->total_pages;
197
+		}
194 198
 		
195 199
 		// Showing all clickable pages (create div if class is defined)
196
-		if ($this->style != '') $r = '<div class="'.$this->style.'">';
197
-		else $r = '';
200
+		if ($this->style != '') {
201
+		    $r = '<div class="'.$this->style.'">';
202
+		} else {
203
+		    $r = '';
204
+		}
198 205
 		
199 206
 		
200 207
 		// First / previous
201 208
 		if ($this->cur_page > 1) {
202
-			if ($this->first != '') $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">'.$this->first.'</a> ';
203
-			if ($this->previous != '') $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">'.$this->previous.'</a> ';
209
+			if ($this->first != '') {
210
+			    $r .= '<a class="first" href="' . $url_start . '1' . $url_end . '">'.$this->first.'</a> ';
211
+			}
212
+			if ($this->previous != '') {
213
+			    $r .= '<a class="previous" href="' . $url_start . ($cur_page - 1) . $url_end . '">'.$this->previous.'</a> ';
214
+			}
204 215
 		}
205 216
 		
206 217
 		// You can optimize this separating BEFORE and AFTER current page in two for (to avoid load "if" in each loop)
207 218
 		// but it would be difficult on changes
208 219
 		for ($n=$start; $n<=$end; $n++) {
209
-			if ($n != $cur_page) $r .= '<a class="link" href="'. $url_start . $n . $url_end . '">'.$n.'</a> ';
210
-			else $r .= '<a class="current">'.$n.'</a> ';
220
+			if ($n != $cur_page) {
221
+			    $r .= '<a class="link" href="'. $url_start . $n . $url_end . '">'.$n.'</a> ';
222
+			} else {
223
+			    $r .= '<a class="current">'.$n.'</a> ';
224
+			}
211 225
 		}
212 226
 		
213 227
 		// next / last
214 228
 		if ($this->cur_page < $this->total_pages) {
215
-			if ($this->next != '') $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">'.$this->next.'</a> ';
216
-			if ($this->last != '') $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end .'">'.$this->last.'</a> ';
229
+			if ($this->next != '') {
230
+			    $r .= '<a class="next" href="' . $url_start . ($cur_page + 1) . $url_end . '">'.$this->next.'</a> ';
231
+			}
232
+			if ($this->last != '') {
233
+			    $r .= '<a class="last" href="' . $url_start . $this->total_pages . $url_end .'">'.$this->last.'</a> ';
234
+			}
217 235
 		}
218 236
 		
219 237
 		// End div (if exist)
220
-		if ($this->style != '') $r .= '</div>';
238
+		if ($this->style != '') {
239
+		    $r .= '</div>';
240
+		}
221 241
 		
222 242
 		return $r;
223 243
 	}
@@ -234,7 +254,9 @@  discard block
 block discarded – undo
234 254
 			$this->original_page = $cur_page;
235 255
 			
236 256
 			// Filter values
237
-			if (!is_numeric($cur_page) or $cur_page < 1) $cur_page = 1;
257
+			if (!is_numeric($cur_page) or $cur_page < 1) {
258
+			    $cur_page = 1;
259
+			}
238 260
 			
239 261
 			// Set new filtered values (is faster this method)
240 262
 			$this->cur_page = $cur_page;
@@ -253,14 +275,17 @@  discard block
 block discarded – undo
253 275
 		$records = $this->records;
254 276
 		
255 277
 		// Force maxium records loaded (only if is specified by user)
256
-		if ($max_records  > 0 and $max_records  > $total_records) 
257
-			$this->total_records = $max_records;
278
+		if ($max_records  > 0 and $max_records  > $total_records) {
279
+					$this->total_records = $max_records;
280
+		}
258 281
 		
259 282
 		// Calculate total pages that have
260 283
 		$total_pages = ceil($this->total_records / $records);
261 284
 		
262 285
 		// Is correct current page?
263
-		if ($this->cur_page > $total_pages) $this->cur_page = $total_pages;
286
+		if ($this->cur_page > $total_pages) {
287
+		    $this->cur_page = $total_pages;
288
+		}
264 289
 		$this->total_pages = $total_pages;
265 290
 		
266 291
 		// Specify LIMIT to do a query
@@ -302,8 +327,11 @@  discard block
 block discarded – undo
302 327
 					if (!in_array(substr($query_string[0], -1), array('?', '&'))) {
303 328
 						// Current string haven't any at end and it isn't "&" or "?" ?
304 329
 						// If initial string have one character at least it means that not is the first index 
305
-						if (isset($query_string[0][0])) $this->url_start = '?'.$query_string[0].'&';
306
-						else $this->url_start = '?'.$query_string[0];
330
+						if (isset($query_string[0][0])) {
331
+						    $this->url_start = '?'.$query_string[0].'&';
332
+						} else {
333
+						    $this->url_start = '?'.$query_string[0];
334
+						}
307 335
 					} else {
308 336
 						// Current string already have ? or &,
309 337
 						$this->url_start = '?'.$query_string[0];
@@ -318,10 +346,14 @@  discard block
 block discarded – undo
318 346
 					foreach ($gets as $get) {
319 347
 						if ($get != $get_name) {
320 348
 							// Trying to get the GET
321
-							if (isset($_GET[$get])) $tmp .= $get.'='.$_GET[$get].'&';
349
+							if (isset($_GET[$get])) {
350
+							    $tmp .= $get.'='.$_GET[$get].'&';
351
+							}
322 352
 						} else {
323 353
 							// Pour the $tmp content to $tmp_start
324
-							if ($tmp_start == '') $tmp_start .= '?';
354
+							if ($tmp_start == '') {
355
+							    $tmp_start .= '?';
356
+							}
325 357
 							$tmp_start .= $tmp;
326 358
 							$tmp = '';
327 359
 						}
@@ -332,8 +364,9 @@  discard block
 block discarded – undo
332 364
 						// If have start and end
333 365
 						$this->url_start = $tmp_start;
334 366
 						$this->url_end = $tmp;
367
+					} else {
368
+					    $this->url_start = '?'.$tmp;
335 369
 					}
336
-					else $this->url_start = '?'.$tmp;
337 370
 				}
338 371
 			} else{
339 372
 				// Non recicle
Please login to merge, or discard this patch.
Sistema/Ayudantes/CFPHPVinculos.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,5 +31,5 @@
 block discarded – undo
31 31
     
32 32
     $dominio = "http://www.my-site-domain.com/";
33 33
     return $dominio;
34
-   }
34
+    }
35 35
 }
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 class CFPHPVinculos {
29 29
     
30
-    function get_dominio(){
30
+    function get_dominio() {
31 31
     
32 32
     $dominio = "http://www.my-site-domain.com/";
33 33
     return $dominio;
Please login to merge, or discard this patch.
Sistema/Nucleo/CFBootstrap.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,31 +32,31 @@
 block discarded – undo
32 32
     {
33 33
         $controlador = $peticion->getControlador() . 'Controlador';
34 34
         //definimos la ruta al controlador
35
-        $rutaControlador = SITE_ROOT . 'mvc' . DS .'controladores' . DS . $controlador . '.php';
35
+        $rutaControlador = SITE_ROOT . 'mvc' . DS . 'controladores' . DS . $controlador . '.php';
36 36
         $metodo = $peticion->getMetodo();
37 37
         $args = $peticion->getArgumentos();
38 38
         
39 39
         //verifcamos que el archivo existe con la funcion de PHP is_readable
40
-        if(is_readable($rutaControlador)){
40
+        if (is_readable($rutaControlador)) {
41 41
             require_once $rutaControlador;
42 42
             $controlador = new $controlador;
43 43
             
44
-            if(is_callable(array($controlador, $metodo))){
44
+            if (is_callable(array($controlador, $metodo))) {
45 45
                 $metodo = $peticion->getMetodo();
46 46
             }
47
-            else{
47
+            else {
48 48
                 $metodo = 'index';
49 49
             }
50 50
             
51
-            if(isset($args)){
51
+            if (isset($args)) {
52 52
                 call_user_func_array(array($controlador, $metodo), $args);
53 53
             }
54
-            else{
54
+            else {
55 55
                 call_user_func(array($controlador, $metodo));
56 56
             }
57 57
             
58 58
         } else {
59
-            header('Location: '.  Cf_BASE_URL.'error/');           
59
+            header('Location: ' . Cf_BASE_URL . 'error/');           
60 60
         }
61 61
     }
62 62
 }
63 63
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,15 +43,13 @@
 block discarded – undo
43 43
             
44 44
             if(is_callable(array($controlador, $metodo))){
45 45
                 $metodo = $peticion->getMetodo();
46
-            }
47
-            else{
46
+            } else{
48 47
                 $metodo = 'index';
49 48
             }
50 49
             
51 50
             if(isset($args)){
52 51
                 call_user_func_array(array($controlador, $metodo), $args);
53
-            }
54
-            else{
52
+            } else{
55 53
                 call_user_func(array($controlador, $metodo));
56 54
             }
57 55
             
Please login to merge, or discard this patch.
Sistema/Nucleo/CFConfiguracion.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
 define('Cf_KEY_MD5', 'P0L1');
92 92
 
93 93
 /*  en el controlador concatena la constante con el llamado a la funcion generarCadenaAleatoria() de Cf_PHPSeguridad */
94
-define('Cf_CSRF_SECRET','Cfbeta');
94
+define('Cf_CSRF_SECRET', 'Cfbeta');
95 95
 
96 96
 /* #base de datos */
97 97
 
Please login to merge, or discard this patch.
Sistema/Nucleo/CFControlador.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $rutaLib = RUTA_LIBS . $libreria . '.php';
39 39
         if(is_readable($rutaLib)){
40 40
             require_once $rutaLib;
41
-           //echo 'libreria cargada';
41
+            //echo 'libreria cargada';
42 42
         }
43 43
         else {
44 44
             throw new Exception("houston tenemos un problema! al cargar libreria");
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
     
48 48
     protected function cargaModelo($modelo){
49 49
         $modelo=$modelo.'Modelo';
50
-       $rutaMod = RUTA_MOD . $modelo . '.php';
50
+        $rutaMod = RUTA_MOD . $modelo . '.php';
51 51
         if(is_readable($rutaMod)){
52 52
             require_once $rutaMod;
53 53
             $modelo = new $modelo;
54 54
             return $modelo;
55
-           //echo 'modelo cargado';
55
+            //echo 'modelo cargado';
56 56
         }
57 57
         else {
58 58
             //echo $rutaMod;
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     }
65 65
     
66 66
     protected function cargaAyudante($ayudante){
67
-       $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php';
67
+        $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php';
68 68
         if(is_readable($rutaAyudante)){
69 69
             require_once $rutaAyudante;
70
-           //echo 'libreria cargada';
70
+            //echo 'libreria cargada';
71 71
         }
72 72
         else {
73 73
             throw new Exception("houston tenemos un problema! al cargar ayudante");
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
         $this->_vista = new CFVista(new CFSolicitud);
35 35
     }
36 36
     
37
-    protected function cargaLib($libreria){
37
+    protected function cargaLib($libreria) {
38 38
         $rutaLib = RUTA_LIBS . $libreria . '.php';
39
-        if(is_readable($rutaLib)){
39
+        if (is_readable($rutaLib)) {
40 40
             require_once $rutaLib;
41 41
            //echo 'libreria cargada';
42 42
         }
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
         }
46 46
     }
47 47
     
48
-    protected function cargaModelo($modelo){
49
-        $modelo=$modelo.'Modelo';
48
+    protected function cargaModelo($modelo) {
49
+        $modelo = $modelo . 'Modelo';
50 50
        $rutaMod = RUTA_MOD . $modelo . '.php';
51
-        if(is_readable($rutaMod)){
51
+        if (is_readable($rutaMod)) {
52 52
             require_once $rutaMod;
53 53
             $modelo = new $modelo;
54 54
             return $modelo;
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
         }
64 64
     }
65 65
     
66
-    protected function cargaAyudante($ayudante){
66
+    protected function cargaAyudante($ayudante) {
67 67
        $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php';
68
-        if(is_readable($rutaAyudante)){
68
+        if (is_readable($rutaAyudante)) {
69 69
             require_once $rutaAyudante;
70 70
            //echo 'libreria cargada';
71 71
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@  discard block
 block discarded – undo
39 39
         if(is_readable($rutaLib)){
40 40
             require_once $rutaLib;
41 41
            //echo 'libreria cargada';
42
-        }
43
-        else {
42
+        } else {
44 43
             throw new Exception("houston tenemos un problema! al cargar libreria");
45 44
         }
46 45
     }
@@ -53,8 +52,7 @@  discard block
 block discarded – undo
53 52
             $modelo = new $modelo;
54 53
             return $modelo;
55 54
            //echo 'modelo cargado';
56
-        }
57
-        else {
55
+        } else {
58 56
             //echo $rutaMod;
59 57
             
60 58
             
@@ -68,8 +66,7 @@  discard block
 block discarded – undo
68 66
         if(is_readable($rutaAyudante)){
69 67
             require_once $rutaAyudante;
70 68
            //echo 'libreria cargada';
71
-        }
72
-        else {
69
+        } else {
73 70
             throw new Exception("houston tenemos un problema! al cargar ayudante");
74 71
         }
75 72
     }
Please login to merge, or discard this patch.
Sistema/Nucleo/CFSolicitud.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     private $_argumentos;
33 33
     
34 34
     public function __construct() {
35
-        if(isset($_GET['url'])){
35
+        if (isset($_GET['url'])) {
36 36
             $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL);
37 37
             $url = explode('/', $url);
38 38
             $url = array_filter($url);
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
             $this->_argumentos = $url;
43 43
         }       
44 44
         
45
-        if(!$this->_controlador){
45
+        if (!$this->_controlador) {
46 46
             $this->_controlador = CONTROLADOR_INICIAL;
47 47
         }
48 48
         
49
-        if(!$this->_metodo){
49
+        if (!$this->_metodo) {
50 50
             $this->_metodo = 'index';
51 51
         }
52 52
         
53
-        if(!isset($this->_argumentos)){
53
+        if (!isset($this->_argumentos)) {
54 54
             $this->_argumentos = array();
55 55
         }
56 56
     }
Please login to merge, or discard this patch.
Sistema/Nucleo/CFVista.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@
 block discarded – undo
38 38
             
39 39
         $ver_ruta = VIEW_PATH . $this->_controlador . DS . $vista . '.phtml';
40 40
         
41
-        if(is_readable($ver_ruta)){
41
+        if (is_readable($ver_ruta)) {
42 42
             include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php';
43 43
             include_once $ver_ruta;
44 44
             include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php';
45 45
         } 
46 46
         else {
47 47
             
48
-            header('Location: '.  Cf_BASE_URL.'error/index'.'?error='.'vista' );
48
+            header('Location: ' . Cf_BASE_URL . 'error/index' . '?error=' . 'vista');
49 49
             
50 50
         }
51 51
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@
 block discarded – undo
42 42
             include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php';
43 43
             include_once $ver_ruta;
44 44
             include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php';
45
-        } 
46
-        else {
45
+        } else {
47 46
             
48 47
             header('Location: '.  Cf_BASE_URL.'error/index'.'?error='.'vista' );
49 48
             
Please login to merge, or discard this patch.