Passed
Push — 1.0.0-dev ( e83bbe...49e148 )
by nguereza
02:46
created
core/common.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
         static $cfg;
149 149
         if (empty($cfg)) {
150 150
             $cfg[0] = & load_configurations();
151
-            if(! is_array($cfg[0])){
151
+            if (!is_array($cfg[0])) {
152 152
                 $cfg[0] = array();
153 153
             }
154 154
         }
Please login to merge, or discard this patch.
core/classes/DBSessionHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@
 block discarded – undo
343 343
          * Get some parameters data need like ip address, hostname, browser info, etc.
344 344
          * @return array
345 345
          */
346
-        protected function getSessionDataParams(){
346
+        protected function getSessionDataParams() {
347 347
             $this->getLoader()->functions('user_agent'); 
348 348
             $this->getLoader()->library('Browser'); 
349 349
             
Please login to merge, or discard this patch.
core/libraries/Browser.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@
 block discarded – undo
364 364
             if (stristr($this->_agent, 'FacebookExternalHit')) {
365 365
                 $this->setRobot(true);
366 366
                 $this->setFacebook(true);
367
-            }  else if (stristr($this->_agent, 'FBIOS')) {
367
+            } else if (stristr($this->_agent, 'FBIOS')) {
368 368
                 $this->setFacebook(true);
369 369
             }
370 370
         }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
          */
303 303
 		protected function checkPlatform() { 
304 304
 			foreach ($this->_platforms as $regex => $value) { 
305
-				if (preg_match($regex, $this->_agent) ) {
305
+				if (preg_match($regex, $this->_agent)) {
306 306
 					$this->setPlatform($value);
307 307
 					break;
308 308
 				}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
          */
315 315
 		protected function checkBrowser() {
316 316
 			foreach ($this->_browsers as $regex => $value) { 
317
-				if (preg_match($regex, $this->_agent ) ) {
317
+				if (preg_match($regex, $this->_agent)) {
318 318
 					$this->setBrowser($value);
319 319
 					break;
320 320
 				}
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 		/**
325 325
          * Routine to determine the browser version
326 326
          */
327
-		protected function checkBrowserVersion(){
327
+		protected function checkBrowserVersion() {
328 328
 			$detected = $this->getBrowser();
329 329
 			$d = array_search($detected, $this->_browsers);
330
-			$browser = str_replace(array("/i","/"), "", $d);
330
+			$browser = str_replace(array("/i", "/"), "", $d);
331 331
 			$regex = "/(?<browser>version|{$browser})[\/]+(?<version>[0-9.|a-zA-Z.]*)/i";
332 332
 			if (preg_match_all($regex, $this->_agent, $matches)) {
333 333
 				$found = array_search($browser, $matches["browser"]);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
          * Determine if the browser is Mobile or not
340 340
          */
341 341
 		protected function checkMobile() {
342
-			if (preg_match('/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->_agent) ) {
342
+			if (preg_match('/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $this->_agent)) {
343 343
 				$this->setMobile(true);
344 344
 			}
345 345
 		}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
          * Determine if the browser is Tablet or not
349 349
          */
350 350
 		protected function checkTablet() {
351
-			if (preg_match('/tablet|ipad/i', $this->_agent) ) {
351
+			if (preg_match('/tablet|ipad/i', $this->_agent)) {
352 352
 				$this->setTablet(true);
353 353
 			}
354 354
 		}
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
          * Determine if the browser is Robot or not
358 358
          */
359 359
 		protected function checkBot() {
360
-			if (preg_match('/bot/i', $this->_agent) ) {
360
+			if (preg_match('/bot/i', $this->_agent)) {
361 361
 				$this->setRobot(true);
362 362
 			}
363 363
 		}
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             if (stristr($this->_agent, 'FacebookExternalHit')) {
370 370
                 $this->setRobot(true);
371 371
                 $this->setFacebook(true);
372
-            }  else if (stristr($this->_agent, 'FBIOS')) {
372
+            } else if (stristr($this->_agent, 'FBIOS')) {
373 373
                 $this->setFacebook(true);
374 374
             }
375 375
         }
Please login to merge, or discard this patch.
core/classes/Loader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
          * @param  string $appLang the application language, only if type = "language"
313 313
          * @return string|null          the full file path
314 314
          */
315
-        protected static function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null){
315
+        protected static function getDefaultFilePathForFunctionLanguage($file, $type, $appLang = null) {
316 316
             $searchDir = null;
317 317
             if ($type == 'function') {
318 318
                $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH);
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
          * @param  string|null $module the module if is not null will return it
339 339
          * @return string|null
340 340
          */
341
-        protected static function getModuleFromSuperController($module){
341
+        protected static function getModuleFromSuperController($module) {
342 342
             $obj = & get_instance();
343 343
             if (!$module && !empty($obj->moduleName)) {
344 344
                 $module = $obj->moduleName;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -316,8 +316,7 @@
 block discarded – undo
316 316
             $searchDir = null;
317 317
             if ($type == 'function') {
318 318
                $searchDir = array(FUNCTIONS_PATH, CORE_FUNCTIONS_PATH);
319
-            }
320
-            else if ($type == 'language') {
319
+            } else if ($type == 'language') {
321 320
                 $searchDir = array(APP_LANG_PATH, CORE_LANG_PATH);
322 321
                 $file = $appLang . DS . $file;
323 322
             }
Please login to merge, or discard this patch.
core/classes/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         public function add($name) {
67 67
             $logger = self::getLogger();
68 68
             if (in_array($name, self::$list)) {
69
-               $logger->info('The module [' .$name. '] already added skipping.');
69
+               $logger->info('The module [' . $name . '] already added skipping.');
70 70
                return $this;
71 71
             }
72 72
             self::$list[] = $name;
Please login to merge, or discard this patch.
app/views/home.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
             <p>Author : <b><?php echo TNH_AUTHOR; ?></b></p>
35 35
             <p>Author E-mail : <b><?php echo TNH_AUTHOR_EMAIL; ?></b></p>
36 36
             <hr />
37
-            <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php';?></b>
38
-            <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php';?></b>
37
+            <p>Current controller: <b class = "text-muted label-danger"><?php echo APPS_CONTROLLER_PATH . 'Home.php'; ?></b>
38
+            <p>Current view: <b class = "text-muted label-danger"><?php echo APPS_VIEWS_PATH . 'home.php'; ?></b>
39 39
           </div>
40 40
         </div>
41 41
       </div>
Please login to merge, or discard this patch.
core/classes/Url.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
          * @return string the final path after add suffix if configured
143 143
          * otherwise the same value will be returned
144 144
          */
145
-        protected static function addSuffixInPath($path){
145
+        protected static function addSuffixInPath($path) {
146 146
             $suffix = get_config('url_suffix');
147 147
             if ($suffix && $path) {
148 148
                 if (strpos($path, '?') !== false) {
Please login to merge, or discard this patch.
core/classes/model/Model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 $instance = $db;
152 152
             } else {
153 153
                 $obj = & get_instance();
154
-                if (isset($obj->database)){
154
+                if (isset($obj->database)) {
155 155
                     /**
156 156
                      * NOTE: Need use "clone" because some Model need have the personal instance of the database library
157 157
                      * to prevent duplication
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
          * @return object
731 731
          */
732 732
         protected function getLoaderInstanceOrCreate() {
733
-            if (! is_object($this->loaderInstance)) {
733
+            if (!is_object($this->loaderInstance)) {
734 734
                 $this->loaderInstance = & get_instance()->loader;
735 735
             } 
736 736
             return $this->loaderInstance;
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
          * Get the return type array or object
741 741
          * @return string|boolean
742 742
          */
743
-        protected function getReturnType(){
743
+        protected function getReturnType() {
744 744
             $type = false;
745 745
             if ($this->_temporary_return_type == 'array') {
746 746
                $type = 'array';
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
          * Check if soft delete is enable setting the condition
753 753
          * @return object the current instance 
754 754
          */
755
-        protected function checkForSoftDelete(){
755
+        protected function checkForSoftDelete() {
756 756
             if ($this->soft_delete && $this->_temporary_with_deleted !== true) {
757 757
                 $this->getQueryBuilder()->where($this->soft_delete_key, (bool) $this->_temporary_only_deleted);
758 758
             }
@@ -767,12 +767,12 @@  discard block
 block discarded – undo
767 767
          * @param  string $type         the type can be "belongs_to", "has_many"
768 768
          * @return mixed               the final row values
769 769
          */
770
-        protected function relateBelongsToAndHasMany($relationship, $options, $row, $type){
770
+        protected function relateBelongsToAndHasMany($relationship, $options, $row, $type) {
771 771
             if (in_array($relationship, $this->_with)) {
772 772
                 $loaderInstance = $this->getLoaderInstanceOrCreate();
773 773
                 $loaderInstance->model($options['model'], $relationship . '_model');
774 774
 
775
-                if($type == 'belongs_to'){
775
+                if ($type == 'belongs_to') {
776 776
                     if (is_object($row)) {
777 777
                         $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']});
778 778
                     } else {
Please login to merge, or discard this patch.
core/classes/Response.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
          * 
347 347
          * @return string|null          the full file path
348 348
          */
349
-        protected static function getDefaultFilePathForView($file){
349
+        protected static function getDefaultFilePathForView($file) {
350 350
             $searchDir = array(APPS_VIEWS_PATH, CORE_VIEWS_PATH);
351 351
             $fullFilePath = null;
352 352
             foreach ($searchDir as $dir) {
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             // Parse out the elapsed time and memory usage,
466 466
             // then swap the pseudo-variables with the data
467 467
             $elapsedTime = $benchmark->elapsedTime('APP_EXECUTION_START', 'APP_EXECUTION_END');
468
-            $memoryUsage    = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB';
468
+            $memoryUsage = round($benchmark->memoryUsage('APP_EXECUTION_START', 'APP_EXECUTION_END') / 1024 / 1024, 6) . 'MB';
469 469
             return str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsedTime, $memoryUsage), $content); 
470 470
         }
471 471
 
Please login to merge, or discard this patch.