Test Failed
Push — develop ( 4bb748...b209fe )
by nguereza
02:55
created
core/libraries/Pagination.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -225,15 +225,15 @@
 block discarded – undo
225 225
                 }
226 226
             }
227 227
             $navbar .= $this->config['next_open'] . '<a href="' . $query . ($currentPageNumber + 1) . '">' 
228
-                       . $this->config['next_text'] . '</a>' . $this->config['next_close'];
228
+                        . $this->config['next_text'] . '</a>' . $this->config['next_close'];
229 229
             return $navbar;
230 230
         }
231 231
 
232 232
 
233
-         /**
234
-         * Build the pagination link for the first page
235
-         * @see Pagination::buildPaginationLinkForFirstAndLastPage
236
-         */
233
+            /**
234
+             * Build the pagination link for the first page
235
+             * @see Pagination::buildPaginationLinkForFirstAndLastPage
236
+             */
237 237
         protected function buildPaginationLinkForFirstPage($begin, $end, $currentPageNumber) {
238 238
             return $this->buildPaginationLinkForFirstAndLastPage($begin, $end, $currentPageNumber, 'first');
239 239
         }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
          * @param  int $currentPageNumber the current page number
88 88
          * @return array
89 89
          */
90
-        public function getInfos($totalRows, $currentPageNumber){
91
-            $numberOfRowPerPage = (int)$this->config['pagination_per_page'];
92
-            $numberOfPage = (int)ceil($totalRows / $numberOfRowPerPage);
93
-            $numberOfLink = (int)$this->config['nb_link'];
90
+        public function getInfos($totalRows, $currentPageNumber) {
91
+            $numberOfRowPerPage = (int) $this->config['pagination_per_page'];
92
+            $numberOfPage = (int) ceil($totalRows / $numberOfRowPerPage);
93
+            $numberOfLink = (int) $this->config['nb_link'];
94 94
             $infos['current_page'] = $currentPageNumber;
95 95
             $infos['num_links'] = $numberOfLink;
96 96
             $infos['limit'] = $numberOfRowPerPage;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             //determine the pagination query string value
122 122
             $this->determinePaginationQueryStringValue();
123 123
             
124
-            $currentPageNumber = (int)$currentPageNumber;
124
+            $currentPageNumber = (int) $currentPageNumber;
125 125
             
126 126
             if ($currentPageNumber <= 0) {
127 127
                 $currentPageNumber = 1;
Please login to merge, or discard this patch.
core/libraries/Upload.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -316,15 +316,15 @@  discard block
 block discarded – undo
316 316
             return $this;
317 317
         }
318 318
 
319
-         /**
320
-         *    Append a mime type to allowed mime types
321
-         *
322
-         *    @since     1.0
323
-         *    @version   1.0.1
324
-         *    @param     string      $mime
325
-         *    @return    object
326
-         *    @method    boolean     setAllowMimeType
327
-         */
319
+            /**
320
+             *    Append a mime type to allowed mime types
321
+             *
322
+             *    @since     1.0
323
+             *    @version   1.0.1
324
+             *    @param     string      $mime
325
+             *    @return    object
326
+             *    @method    boolean     setAllowMimeType
327
+             */
328 328
         public function setAllowMimeType($mime) {
329 329
             $this->allowedMimeTypes[] = strtolower($mime);
330 330
             $this->file['allowed_mime_types'][] = strtolower($mime); 
@@ -438,10 +438,10 @@  discard block
 block discarded – undo
438 438
             return $this;
439 439
         }
440 440
 
441
-         /**
442
-         *    Get the allow overwriting
443
-         *    @return    boolean
444
-         */
441
+            /**
442
+             *    Get the allow overwriting
443
+             *    @return    boolean
444
+             */
445 445
         public function isAllowOverwriting() {
446 446
             return $this->overwriteFile ;
447 447
         }
@@ -532,14 +532,14 @@  discard block
 block discarded – undo
532 532
             return $this->error;
533 533
         }
534 534
 
535
-         /**
536
-         *    Retrive status of upload
537
-         *
538
-         *    @since     1.0
539
-         *    @version   1.0
540
-         *    @return    boolean
541
-         *    @method    boolean    getStatus
542
-         */
535
+            /**
536
+             *    Retrive status of upload
537
+             *
538
+             *    @since     1.0
539
+             *    @version   1.0
540
+             *    @return    boolean
541
+             *    @method    boolean    getStatus
542
+             */
543 543
         public function getStatus() {
544 544
             return $this->file['status'];
545 545
         }
@@ -572,11 +572,11 @@  discard block
 block discarded – undo
572 572
                                 && is_file($file);
573 573
         }
574 574
 
575
-         /**
576
-         * Set the filename if is empty using the uploaded data information
577
-         *
578
-         * @return object the current instance
579
-         */
575
+            /**
576
+             * Set the filename if is empty using the uploaded data information
577
+             *
578
+             * @return object the current instance
579
+             */
580 580
         protected function setFilenameUsingUploadedData() {
581 581
             // set original filename if not have a new name
582 582
             if (empty($this->filename)) {
@@ -660,12 +660,12 @@  discard block
 block discarded – undo
660 660
             return $this->maxFileSize >= $size;
661 661
         }
662 662
 
663
-         /**
664
-         *    Check the file overwritting
665
-         *    @since     1.0
666
-         *    @version   1.0
667
-         *    @return    boolean
668
-         */
663
+            /**
664
+             *    Check the file overwritting
665
+             *    @since     1.0
666
+             *    @version   1.0
667
+             *    @return    boolean
668
+             */
669 669
         protected function checkFileOverwritting() {
670 670
             if ($this->fileExists($this->destinationDirectory . $this->filename)) {
671 671
                 return $this->overwriteFile;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -443,7 +443,7 @@
 block discarded – undo
443 443
          *    @return    boolean
444 444
          */
445 445
         public function isAllowOverwriting() {
446
-            return $this->overwriteFile ;
446
+            return $this->overwriteFile;
447 447
         }
448 448
 
449 449
         /**
Please login to merge, or discard this patch.
core/libraries/Email.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $addresses = array();
348 348
             foreach ($pairs as $name => $email) {
349 349
                 if (is_numeric($name)) {
350
-                   $name = null;
350
+                    $name = null;
351 351
                 }
352 352
                 $addresses[] = $this->formatHeader($email, $name);
353 353
             }
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
             return $headers;
739 739
         }
740 740
 
741
-         /**
742
-         * Get the attachment message for send or the simple message
743
-         * @return string
744
-         */
741
+            /**
742
+             * Get the attachment message for send or the simple message
743
+             * @return string
744
+             */
745 745
         protected function getMessageWithAttachmentForSend() {
746 746
             $message = wordwrap($this->message, $this->wrap);
747 747
             if ($this->hasAttachments()) {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          */
772 772
         protected function sendHelloCommand() {
773 773
             $responseCode = $this->sendCommand('EHLO ' . $this->getSmtpClientHostname())
774
-                                 ->getSmtpResponseCode();
774
+                                    ->getSmtpResponseCode();
775 775
             if ($responseCode !== 250) {
776 776
                 $this->error = $this->smtpResponse;
777 777
                 return false;
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
             $message = $this->getMessageWithAttachmentForSend();
919 919
             $headers = $this->getHeadersForSend(); 
920 920
             $this->logger->info('Sending new mail using mail protocol, the information are listed below: '
921
-                                  . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
921
+                                    . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
922 922
             $result = mail($to, $this->subject, $message, $headers, $this->params);
923 923
             if (!$result) {
924 924
                 $this->error = 'Error when sending mail using mail protocol';
@@ -926,10 +926,10 @@  discard block
 block discarded – undo
926 926
             return $result;
927 927
         }
928 928
 
929
-         /**
930
-         * Send mail using "smtp" protocol
931
-         * @return boolean
932
-         */
929
+            /**
930
+             * Send mail using "smtp" protocol
931
+             * @return boolean
932
+             */
933 933
         protected function sendSmtp() {
934 934
             if (!$this->smtpConnection()) {
935 935
                 return false;
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
             $message = $this->getMessageWithAttachmentForSend();
940 940
             $headers = $this->getHeadersForSend();
941 941
             $this->logger->info('Sending new mail using SMTP protocol, the information are listed below: '
942
-                                  . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
942
+                                    . 'destination: ' . $to . ', headers: ' . $headers . ', message: ' . $message);
943 943
             $recipients = array_merge($this->to, $this->cc, $this->bcc);
944 944
             $commands = array(
945 945
                                 'mail_from' => array('MAIL FROM: <' . $this->from . '>', 'MAIL_FROM', 250),
@@ -990,17 +990,17 @@  discard block
 block discarded – undo
990 990
         }
991 991
 
992 992
 
993
-         /**
994
-         * Return the client hostname for SMTP
995
-         * 
996
-         * There are only two legal types of hostname - either a fully
997
-         * qualified domain name (eg: "mail.example.com") or an IP literal
998
-         * (eg: "[1.2.3.4]").
999
-         *
1000
-         * @link    https://tools.ietf.org/html/rfc5321#section-2.3.5
1001
-         * @link    http://cbl.abuseat.org/namingproblems.html
1002
-         * @return string
1003
-         */
993
+            /**
994
+             * Return the client hostname for SMTP
995
+             * 
996
+             * There are only two legal types of hostname - either a fully
997
+             * qualified domain name (eg: "mail.example.com") or an IP literal
998
+             * (eg: "[1.2.3.4]").
999
+             *
1000
+             * @link    https://tools.ietf.org/html/rfc5321#section-2.3.5
1001
+             * @link    http://cbl.abuseat.org/namingproblems.html
1002
+             * @return string
1003
+             */
1004 1004
         protected function getSmtpClientHostname() {
1005 1005
             $globals = &class_loader('GlobalVar', 'classes');
1006 1006
             if ($globals->server('SERVER_NAME')) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * SOFTWARE.
29 29
      */
30 30
 
31
-    class Email extends BaseClass{
31
+    class Email extends BaseClass {
32 32
         /**
33 33
          * @var int $wrap
34 34
          */
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
             $message = wordwrap($this->message, $this->wrap);
747 747
             if ($this->hasAttachments()) {
748 748
                 $this->setAttachmentHeaders();
749
-                $message  = $this->assembleAttachmentBody();
749
+                $message = $this->assembleAttachmentBody();
750 750
             }
751 751
             return $message;
752 752
         }
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
                                         $this->smtpConfig['connection_timeout']
827 827
                                     );
828 828
 
829
-            if (! is_resource($this->smtpSocket)) {
829
+            if (!is_resource($this->smtpSocket)) {
830 830
                 $this->error = $errorNumber . ': ' . $errorMessage;
831 831
                 return false;
832 832
             }
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                      */
876 876
                     if (is_resource($this->smtpSocket)) {
877 877
                         $method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
878
-                        if(version_compare(PHP_VERSION, '5.6', '>=')) {
878
+                        if (version_compare(PHP_VERSION, '5.6', '>=')) {
879 879
                             $method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
880 880
                         }
881 881
                         stream_socket_enable_crypto($this->smtpSocket, true, $method);
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
                 'To' => $to
984 984
             );
985 985
             foreach ($additionalHeaders as $key => $value) {
986
-                if (! isset($this->headers[$key])) {
986
+                if (!isset($this->headers[$key])) {
987 987
                     $this->headers[$key] = $value;
988 988
                 }
989 989
             }
Please login to merge, or discard this patch.
core/libraries/PDF.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
          * @return object the current instance
100 100
          */
101 101
         public function setFilename($filename) {
102
-            if(stripos($filename, '.pdf') === false) {
102
+            if (stripos($filename, '.pdf') === false) {
103 103
                 $filename .= '.pdf';     
104 104
             }
105 105
             $this->filename = $filename;
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -104,11 +104,11 @@
 block discarded – undo
104 104
          * @return object the current instance
105 105
          */
106 106
         public function render() {
107
-           $this->dompdf->loadHtml($this->html);
108
-           $this->dompdf->setPaper($this->paper, $this->orientation);
109
-           $this->dompdf->render(); 
110
-           $this->rendered = true;
111
-           return $this;
107
+            $this->dompdf->loadHtml($this->html);
108
+            $this->dompdf->setPaper($this->paper, $this->orientation);
109
+            $this->dompdf->render(); 
110
+            $this->rendered = true;
111
+            return $this;
112 112
         }
113 113
 
114 114
         /**
Please login to merge, or discard this patch.
core/classes/EventDispatcher.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
                 return;
157 157
             } 
158 158
             $this->logger->info('Found the registered event listener for the '
159
-                                 . 'event [' . $event->getName() . '] the list are: ' . stringify_vars($list));
159
+                                    . 'event [' . $event->getName() . '] the list are: ' . stringify_vars($list));
160 160
             foreach ($list as $listener) {
161 161
                 $result = call_user_func_array($listener, array($event));
162 162
                 if ($event->isReturnBack() === true) {
Please login to merge, or discard this patch.
core/classes/Router.php 3 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $this->determineRouteParamsInformation();
395 395
 
396 396
             //if the request method not match
397
-            if(!$this->routeMethodMatch){
397
+            if (!$this->routeMethodMatch) {
398 398
                  //create the instance of Controller
399 399
                 $cError = new Controller();
400 400
                 $cError->response->setStatus(405);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
          * Remove the DOCUMENT_ROOT and front controller from segments if exists
466 466
          * @return void
467 467
          */
468
-        protected function removeDocumentRootFrontControllerFromSegments(){
468
+        protected function removeDocumentRootFrontControllerFromSegments() {
469 469
             $segment = $this->segments;
470 470
             $globals = & class_loader('GlobalVar', 'classes');
471 471
             $rootFolder = substr($globals->server('SCRIPT_NAME'), 0, strpos(
@@ -519,11 +519,11 @@  discard block
 block discarded – undo
519 519
         protected function setRouteParamsUsingPredefinedConfig($findIndex) {
520 520
             $callback = $this->callback[$findIndex];
521 521
             //if callback is array so means user defined the HTTP Method
522
-            if(is_array($callback) && count($callback) > 0){
523
-                if(array_key_exists($this->requestMethod, $callback)){
522
+            if (is_array($callback) && count($callback) > 0) {
523
+                if (array_key_exists($this->requestMethod, $callback)) {
524 524
                     $callback = $callback[$this->requestMethod];
525 525
                 }
526
-                else{
526
+                else {
527 527
                     //Wrong request method
528 528
                     $this->logger->warning('The request method [' . $this->requestMethod . '] is not allowed');
529 529
                     $this->routeMethodMatch = false;
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                     break;
610 610
                 }
611 611
             }
612
-            if($findIndex !== -1){
612
+            if ($findIndex !== -1) {
613 613
                 /*
614 614
                 * $args[0] => full string captured by preg_match
615 615
                 * $args[1], $args[2], $args[n] => contains the value of 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
          * Find file path of the current controller using the current module
637 637
          * @return boolean true if the file path is found otherwise false.
638 638
          */
639
-        protected function findControllerFullPathUsingCurrentModule(){
639
+        protected function findControllerFullPathUsingCurrentModule() {
640 640
             $path = $this->moduleInstance->findControllerFullPath(ucfirst($this->controller), $this->module);
641 641
             if (!$path) {
642 642
                 $this->logger->info('The controller [' . $this->controller . '] not ' 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
          * or the current request does not use module
654 654
          * @return void
655 655
          */
656
-        protected function setRouteParamsIfNoModuleOrNotFound(){
656
+        protected function setRouteParamsIfNoModuleOrNotFound() {
657 657
             $segment = $this->segments;
658 658
             //controller
659 659
             if (isset($segment[0])) {
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
          * or the current request use module
675 675
          * @return void
676 676
          */
677
-        protected function setRouteParamsIfAppHasModuleOrFound(){
677
+        protected function setRouteParamsIfAppHasModuleOrFound() {
678 678
             //get the module list
679 679
             $modules = $this->moduleInstance->getModuleList();
680 680
             $segment = $this->segments;
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 if (isset($segment[0])) {
687 687
                     $this->controller = $segment[0];
688 688
                     //check if the request use the same module name and controller
689
-                    if($this->findControllerFullPathUsingCurrentModule()){
689
+                    if ($this->findControllerFullPathUsingCurrentModule()) {
690 690
                         array_shift($segment);
691 691
                     }
692 692
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -522,8 +522,7 @@
 block discarded – undo
522 522
             if(is_array($callback) && count($callback) > 0){
523 523
                 if(array_key_exists($this->requestMethod, $callback)){
524 524
                     $callback = $callback[$this->requestMethod];
525
-                }
526
-                else{
525
+                } else{
527 526
                     //Wrong request method
528 527
                     $this->logger->warning('The request method [' . $this->requestMethod . '] is not allowed');
529 528
                     $this->routeMethodMatch = false;
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -278,14 +278,14 @@  discard block
 block discarded – undo
278 278
         }
279 279
 
280 280
         /**
281
-        * Setting the route configuration using the configuration file 
282
-        * and additional configuration from param
283
-        * @param array $overwriteConfig the additional configuration 
284
-        * to overwrite with the existing one
285
-        * @param boolean $useConfigFile whether to use route configuration file
286
-        * 
287
-        * @return object
288
-        */
281
+         * Setting the route configuration using the configuration file 
282
+         * and additional configuration from param
283
+         * @param array $overwriteConfig the additional configuration 
284
+         * to overwrite with the existing one
285
+         * @param boolean $useConfigFile whether to use route configuration file
286
+         * 
287
+         * @return object
288
+         */
289 289
         public function setRouteConfiguration(array $overwriteConfig = array(), $useConfigFile = true) {
290 290
             $route = array();
291 291
             if ($useConfigFile && file_exists(CONFIG_PATH . 'routes.php')) {
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             //the URL like http://domain.com/module/controller/method/arg1/arg2/argn 
367 367
             if (!$this->controller && $this->routeMethodMatch /* normally if the route method isnot match no need continue */) {
368 368
                 $this->logger->info('Cannot determine the routing information ' 
369
-                       . 'using the predefined routes configuration, will use the request URI parameters');
369
+                        . 'using the predefined routes configuration, will use the request URI parameters');
370 370
                 //determine route parameters using the route URI param
371 371
                 $this->determineRouteParamsFromRequestUri();
372 372
             }
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
             //if the request method not match
397 397
             if(!$this->routeMethodMatch){
398
-                 //create the instance of Controller
398
+                    //create the instance of Controller
399 399
                 $cError = new Controller();
400 400
                 $cError->response->setStatus(405);
401 401
                 $cError->response->setOutput('HTTP method [' . $this->requestMethod . '] not allowed');
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
             }
494 494
         }
495 495
 
496
-         /**
497
-         * Remove the URL suffix and query string values if exists
498
-         * @param  string $uri the route URI to process
499
-         * @return string      the final route uri after processed
500
-         */
496
+            /**
497
+             * Remove the URL suffix and query string values if exists
498
+             * @param  string $uri the route URI to process
499
+             * @return string      the final route uri after processed
500
+             */
501 501
         protected function removeSuffixAndQueryStringFromUri($uri) {
502 502
             $this->logger->debug('Check if URL suffix is enabled in the configuration');
503 503
             //remove url suffix from the request URI
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
                 $this->logger->info(
627 627
                                     'After loop in predefined routes configuration,'
628 628
                                     . 'the module name is set but the controller is not set,' 
629
-									. 'so we will use module as the controller'
629
+                                    . 'so we will use module as the controller'
630 630
                                 );
631 631
                 $this->controller = $this->module;
632 632
             }
Please login to merge, or discard this patch.