Completed
Push — master ( 49228f...024767 )
by Henry Stivens
02:39
created
core/libs/session/session.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param string $namespace
53 53
      * @return mixed
54 54
      */
55
-    public static function get($index, $namespace='default')
55
+    public static function get($index, $namespace = 'default')
56 56
     {
57 57
         if (isset($_SESSION[SESSION][APP_PATH][$namespace][$index])) {
58 58
             return $_SESSION[SESSION][APP_PATH][$namespace][$index];
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param string $index
66 66
      * @param string $namespace
67 67
      */
68
-    public static function delete($index, $namespace='default')
68
+    public static function delete($index, $namespace = 'default')
69 69
     {
70 70
         unset($_SESSION[SESSION][APP_PATH][$namespace][$index]);
71 71
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @param string $namespace
78 78
      * @return boolean
79 79
      */
80
-    public static function has($index, $namespace='default')
80
+    public static function has($index, $namespace = 'default')
81 81
     {
82 82
         return isset($_SESSION[SESSION][APP_PATH][$namespace][$index]);
83 83
     }
Please login to merge, or discard this patch.
core/tests/classes/extensions/helpers/FlashTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,37 +30,37 @@
 block discarded – undo
30 30
 
31 31
     public function testShowTypeTest()
32 32
     {
33
-        $this->expectOutputString('<div class="test flash">Test Content</div>'.PHP_EOL);
33
+        $this->expectOutputString('<div class="test flash">Test Content</div>' . PHP_EOL);
34 34
         Flash::show('test', 'Test Content');
35 35
     }
36 36
 
37 37
     public function testShowTypeSuccess()
38 38
     {
39
-        $this->expectOutputString('<div class="success flash">Test Content</div>'.PHP_EOL);
39
+        $this->expectOutputString('<div class="success flash">Test Content</div>' . PHP_EOL);
40 40
         Flash::show('success', 'Test Content');
41 41
     }
42 42
 
43 43
     public function testValid()
44 44
     {
45
-        $this->expectOutputString('<div class="valid flash">Test content for valid</div>'.PHP_EOL);
45
+        $this->expectOutputString('<div class="valid flash">Test content for valid</div>' . PHP_EOL);
46 46
         Flash::valid('Test content for valid');
47 47
     }
48 48
 
49 49
     public function testError()
50 50
     {
51
-        $this->expectOutputString('<div class="error flash">Test content for error</div>'.PHP_EOL);
51
+        $this->expectOutputString('<div class="error flash">Test content for error</div>' . PHP_EOL);
52 52
         Flash::error('Test content for error');
53 53
     }
54 54
 
55 55
     public function testInfo()
56 56
     {
57
-        $this->expectOutputString('<div class="info flash">Test content for info</div>'.PHP_EOL);
57
+        $this->expectOutputString('<div class="info flash">Test content for info</div>' . PHP_EOL);
58 58
         Flash::info('Test content for info');
59 59
     }
60 60
 
61 61
     public function testWarning()
62 62
     {
63
-        $this->expectOutputString('<div class="warning flash">Test content for warning</div>'.PHP_EOL);
63
+        $this->expectOutputString('<div class="warning flash">Test content for warning</div>' . PHP_EOL);
64 64
         Flash::warning('Test content for warning');
65 65
     }
66 66
 }
Please login to merge, or discard this patch.
core/tests/classes/extensions/helpers/TagTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $scriptPattern = '<script type="text/javascript" src="%sjavascript/%s"></script>';
41 41
         $response = Tag::js($file);
42
-        $expected = sprintf($scriptPattern, PUBLIC_PATH, $file.'.js');
42
+        $expected = sprintf($scriptPattern, PUBLIC_PATH, $file . '.js');
43 43
 
44 44
         $this->assertSame($expected, $response);
45 45
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $scriptPattern = '<script type="text/javascript" src="%sjavascript/%s?nocache=';
53 53
 
54 54
         $response = Tag::js($file, false);
55
-        $expected = sprintf($scriptPattern, PUBLIC_PATH, $file.'.js');
55
+        $expected = sprintf($scriptPattern, PUBLIC_PATH, $file . '.js');
56 56
 
57 57
         $this->assertStringStartsWith($expected, $response);
58 58
         $this->assertStringEndsWith('"></script>', $response);
Please login to merge, or discard this patch.
core/tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 defined('APP_PATH') || define('APP_PATH', __DIR__ . '/');
25 25
 defined('PUBLIC_PATH') || define('PUBLIC_PATH', 'http://127.0.0.1/');
26 26
 
27
-require_once CORE_PATH.'kumbia/autoload.php';
28
-require_once __DIR__.'/../../vendor/autoload.php';
27
+require_once CORE_PATH . 'kumbia/autoload.php';
28
+require_once __DIR__ . '/../../vendor/autoload.php';
29 29
 
30 30
 spl_autoload_register('kumbia_autoload_helper', true, true);
Please login to merge, or discard this patch.
core/kumbia/router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         try {
128 128
             $reflectionMethod = new ReflectionMethod($cont, $cont->action_name);
129 129
         } catch (ReflectionException $e) {
130
-            throw new KumbiaException($cont->action_name, 'no_action');//TODO: enviar a un método del controller
130
+            throw new KumbiaException($cont->action_name, 'no_action'); //TODO: enviar a un método del controller
131 131
         }
132 132
 
133 133
         //k_callback y __constructor metodo reservado
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         try {
147 147
             $reflectionMethod->invokeArgs($cont, $cont->parameters);
148 148
         } catch (ReflectionException $e) {
149
-            throw new KumbiaException(null, 'no_action');//TODO: mejor no_public
149
+            throw new KumbiaException(null, 'no_action'); //TODO: mejor no_public
150 150
         }
151 151
 
152 152
         //Corre los filtros after y finalize
Please login to merge, or discard this patch.
core/kumbia/kumbia_view.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      *
162 162
      * @return boolean  En producción y cache de view
163 163
      */
164
-    public static function cache($time, $type='view', $group='kumbia.view')
164
+    public static function cache($time, $type = 'view', $group = 'kumbia.view')
165 165
     {
166 166
         if ($time === FALSE) { //TODO borrar cache
167 167
             self::$_cache['type'] = FALSE;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $file = APP_PATH . 'views/' . self::getPath();
200 200
         //Si no existe el view y es scaffold
201 201
         if (!is_file($file) && ($scaffold = self::$_controller->scaffold)) {
202
-            $file = APP_PATH . "views/_shared/scaffolds/$scaffold/".self::$_view.'.phtml';
202
+            $file = APP_PATH . "views/_shared/scaffolds/$scaffold/" . self::$_view . '.phtml';
203 203
         }
204 204
         return $file;
205 205
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      * @return string
310 310
      * @throw KumbiaException
311 311
      */
312
-    public static function partial($partial, $__time='', $params=NULL, $group ='kumbia.partials')
312
+    public static function partial($partial, $__time = '', $params = NULL, $group = 'kumbia.partials')
313 313
     {
314 314
         if (PRODUCTION && $__time && !Cache::driver()->start($__time, $partial, $group)) {
315 315
             return;
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             $__file = CORE_PATH . "views/partials/$partial.phtml";
324 324
         }
325 325
 
326
-        if($params){
326
+        if ($params) {
327 327
             if (is_string($params)) {
328 328
                     $params = Util::getParams(explode(',', $params));
329 329
             }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      */
352 352
     public static function getVar($var = '')
353 353
     {
354
-        if(!$var) return get_object_vars(self::$_controller);
354
+        if (!$var) return get_object_vars(self::$_controller);
355 355
 
356 356
         return isset(self::$_controller->$var) ? self::$_controller->$var : NULL;
357 357
     }
Please login to merge, or discard this patch.
core/kumbia/load.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         if (!class_exists($Model, FALSE)) {
77 77
             //Carga la clase
78 78
             if (!include APP_PATH . "models/$model.php") {
79
-                throw new KumbiaException($model,'no_model');
79
+                throw new KumbiaException($model, 'no_model');
80 80
             }
81 81
         }
82 82
         return new $Model($params);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             //Si esta cargada continua con la siguiente clase
97 97
             if (class_exists($Model, FALSE)) continue;
98 98
             if (!include APP_PATH . "models/$model.php") {
99
-                throw new KumbiaException($model,'no_model');
99
+                throw new KumbiaException($model, 'no_model');
100 100
             }
101 101
         }
102 102
     }
Please login to merge, or discard this patch.
core/kumbia/autoload.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 
21 21
 // @see Util
22
-require CORE_PATH.'kumbia/util.php';
22
+require CORE_PATH . 'kumbia/util.php';
23 23
 
24 24
 // Autocarga de clases
25 25
 function kumbia_autoload($class)
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
     // Optimizando carga
28 28
     static $classes;
29 29
     if (!isset($classes)) {
30
-        $classes = array (
31
-            'ActiveRecord'    => APP_PATH.'libs/active_record.php',
32
-            'Load'            => CORE_PATH.'kumbia/load.php',
33
-            'KumbiaException' => CORE_PATH.'kumbia/kumbia_exception.php',
34
-            'KumbiaRouter'    => CORE_PATH.'kumbia/kumbia_router.php',
35
-            'KumbiaFacade'    => CORE_PATH.'kumbia/kumbia_facade.php'
30
+        $classes = array(
31
+            'ActiveRecord'    => APP_PATH . 'libs/active_record.php',
32
+            'Load'            => CORE_PATH . 'kumbia/load.php',
33
+            'KumbiaException' => CORE_PATH . 'kumbia/kumbia_exception.php',
34
+            'KumbiaRouter'    => CORE_PATH . 'kumbia/kumbia_router.php',
35
+            'KumbiaFacade'    => CORE_PATH . 'kumbia/kumbia_facade.php'
36 36
         );
37 37
     }
38 38
     if (isset($classes[$class])) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 function kumbia_autoload_vendor($class)
66 66
 {
67 67
     //Autoload PSR0
68
-    $psr0 = dirname(CORE_PATH).'/vendor/'.str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class).'.php';
68
+    $psr0 = dirname(CORE_PATH) . '/vendor/' . str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class) . '.php';
69 69
     if (is_file($psr0)) {
70 70
         include $psr0;
71 71
     }
Please login to merge, or discard this patch.
core/kumbia/kumbia_router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $urlItems = explode('/', trim($url, '/'));
41 41
 
42 42
         // El primer parametro de la url es un módulo?
43
-        if (is_dir(APP_PATH."controllers/$urlItems[0]")) {
43
+        if (is_dir(APP_PATH . "controllers/$urlItems[0]")) {
44 44
             $router['module'] = $urlItems[0];
45 45
 
46 46
             // Si no hay mas parametros sale
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // Si existe una ruta con el comodin * crea la nueva ruta
92 92
         foreach ($routes as $key => $val) {
93 93
             if ($key == '/*') {
94
-                return rtrim($val, '*').$url;
94
+                return rtrim($val, '*') . $url;
95 95
             }
96 96
 
97 97
             if (strripos($key, '*', -1)) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             throw new KumbiaException(null, 'no_controller');
116 116
         }
117 117
         //Asigna el controlador activo
118
-        $app_controller = Util::camelcase($controller).'Controller';
118
+        $app_controller = Util::camelcase($controller) . 'Controller';
119 119
         return new $app_controller($param);
120 120
     }
121 121
 }
Please login to merge, or discard this patch.