Completed
Push — master ( 1cd1d8...dbc4d9 )
by Thierry
02:53
created
templates/support/function.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sAlias ?> = function() {
2 2
     return jaxon.request(
3 3
         { jxnfun: '<?php echo $this->sFunction ?>' },
4
-        { parameters: arguments<?php foreach($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
4
+        { parameters: arguments<?php foreach ($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
5 5
     );
6 6
 };
Please login to merge, or discard this patch.
templates/support/object.js.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sClass ?> = {};
2
-<?php foreach($this->aMethods as $aMethod): ?>
2
+<?php foreach ($this->aMethods as $aMethod): ?>
3 3
 <?php echo $this->sPrefix ?><?php echo $this->sClass ?>.<?php echo $aMethod['name'] ?> = function() {
4 4
     return jaxon.request(
5 5
         { jxncls: '<?php echo $this->sClass ?>', jxnmthd: '<?php echo $aMethod['name'] ?>' },
6
-        { parameters: arguments<?php foreach($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
6
+        { parameters: arguments<?php foreach ($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> }
7 7
     );
8 8
 };
9 9
 <?php endforeach ?>
Please login to merge, or discard this patch.
templates/support/event.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php echo $this->sPrefix ?><?php echo $this->sEvent ?> = function() {
2 2
     return jaxon.request(
3 3
         { jxnevt: '<?php echo $this->sEvent ?>' },
4
-        { parameters: arguments<?php if(($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if(($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> }
4
+        { parameters: arguments<?php if (($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if (($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> }
5 5
     );
6 6
 };
Please login to merge, or discard this patch.
templates/plugins/includes.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1
-<?php foreach($this->aUrls as $sUrl): ?>
1
+<?php foreach ($this->aUrls as $sUrl): ?>
2 2
 <script type="text/javascript" src="<?php echo $sUrl ?>" <?php echo $this->sJsOptions ?> charset="UTF-8"></script>
3 3
 <?php endforeach ?>
Please login to merge, or discard this patch.
templates/plugins/ready.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 jaxon.dom.ready(function() {
2 2
     jaxon.command.handler.register('cc', jaxon.confirm.commands);
3 3
 
4
-<?php if($this->sPluginScript): ?>
4
+<?php if ($this->sPluginScript): ?>
5 5
 <?php echo $this->sPluginScript ?>
6 6
 <?php endif ?>
7 7
 });
Please login to merge, or discard this patch.
src/Response/Manager.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function append(Response $xResponse)
73 73
     {
74
-        if(!$this->xResponse)
74
+        if (!$this->xResponse)
75 75
         {
76 76
             $this->xResponse = $xResponse;
77 77
         }
78
-        elseif(get_class($this->xResponse) == get_class($xResponse))
78
+        elseif (get_class($this->xResponse) == get_class($xResponse))
79 79
         {
80
-            if($this->xResponse != $xResponse)
80
+            if ($this->xResponse != $xResponse)
81 81
             {
82 82
                 $this->xResponse->appendResponse($xResponse);
83 83
             }
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function printDebug()
112 112
     {
113
-        if(($this->xResponse))
113
+        if (($this->xResponse))
114 114
         {
115
-            foreach($this->aDebugMessages as $sMessage)
115
+            foreach ($this->aDebugMessages as $sMessage)
116 116
             {
117 117
                 $this->xResponse->debug($sMessage);
118 118
             }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function sendHeaders()
129 129
     {
130
-        if(($this->xResponse))
130
+        if (($this->xResponse))
131 131
         {
132 132
             $this->xResponse->sendHeaders();
133 133
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function getOutput()
142 142
     {
143
-        if(($this->xResponse))
143
+        if (($this->xResponse))
144 144
         {
145 145
             return $this->xResponse->getOutput();
146 146
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function sendOutput()
156 156
     {
157
-        if(($this->xResponse))
157
+        if (($this->xResponse))
158 158
         {
159 159
             $this->xResponse->sendHeaders();
160 160
             $this->xResponse->printOutput();
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,15 +74,13 @@
 block discarded – undo
74 74
         if(!$this->xResponse)
75 75
         {
76 76
             $this->xResponse = $xResponse;
77
-        }
78
-        elseif(get_class($this->xResponse) == get_class($xResponse))
77
+        } elseif(get_class($this->xResponse) == get_class($xResponse))
79 78
         {
80 79
             if($this->xResponse != $xResponse)
81 80
             {
82 81
                 $this->xResponse->appendResponse($xResponse);
83 82
             }
84
-        }
85
-        else
83
+        } else
86 84
         {
87 85
             $this->debug($this->trans('errors.mismatch.types', array('class' => get_class($xResponse))));
88 86
         }
Please login to merge, or discard this patch.
src/Utils/URI.php 2 patches
Braces   +10 added lines, -16 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
             if(!empty($_SERVER['HTTP_SCHEME']))
38 38
             {
39 39
                 $aURL['scheme'] = $_SERVER['HTTP_SCHEME'];
40
-            }
41
-            else
40
+            } else
42 41
             {
43 42
                 $aURL['scheme'] = ((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http');
44 43
             }
@@ -51,28 +50,23 @@  discard block
 block discarded – undo
51 50
                 if(strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0)
52 51
                 {
53 52
                     list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']);
54
-                }
55
-                else
53
+                } else
56 54
                 {
57 55
                     $aURL['host'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
58 56
                 }
59
-            }
60
-            elseif(!empty($_SERVER['HTTP_HOST']))
57
+            } elseif(!empty($_SERVER['HTTP_HOST']))
61 58
             {
62 59
                 if(strpos($_SERVER['HTTP_HOST'], ':') > 0)
63 60
                 {
64 61
                     list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']);
65
-                }
66
-                else
62
+                } else
67 63
                 {
68 64
                     $aURL['host'] = $_SERVER['HTTP_HOST'];
69 65
                 }
70
-            }
71
-            elseif(!empty($_SERVER['SERVER_NAME']))
66
+            } elseif(!empty($_SERVER['SERVER_NAME']))
72 67
             {
73 68
                 $aURL['host'] = $_SERVER['SERVER_NAME'];
74
-            }
75
-            else
69
+            } else
76 70
             {
77 71
                 throw new \Jaxon\Exception\URI();
78 72
             }
@@ -94,8 +88,7 @@  discard block
 block discarded – undo
94 88
             if(!empty($_SERVER['PATH_INFO']))
95 89
             {
96 90
                 $sPath = parse_url($_SERVER['PATH_INFO']);
97
-            }
98
-            else
91
+            } else
99 92
             {
100 93
                 $sPath = parse_url($_SERVER['PHP_SELF']);
101 94
             }
@@ -153,8 +146,9 @@  discard block
 block discarded – undo
153 146
         
154 147
             foreach($aQueries as $sKey => $sQuery)
155 148
             {
156
-                if("jxnGenerate" == substr($sQuery, 0, 11))
157
-                    unset($aQueries[$sKey]);
149
+                if("jxnGenerate" == substr($sQuery, 0, 11)) {
150
+                                    unset($aQueries[$sKey]);
151
+                }
158 152
             }
159 153
                 
160 154
             $sQueries = implode("&", $aQueries);
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $aURL = [];
27 27
         // Try to get the request URL
28
-        if(!empty($_SERVER['REQUEST_URI']))
28
+        if (!empty($_SERVER['REQUEST_URI']))
29 29
         {
30
-            $_SERVER['REQUEST_URI'] = str_replace(array('"',"'",'<','>'), array('%22','%27','%3C','%3E'), $_SERVER['REQUEST_URI']);
30
+            $_SERVER['REQUEST_URI'] = str_replace(array('"', "'", '<', '>'), array('%22', '%27', '%3C', '%3E'), $_SERVER['REQUEST_URI']);
31 31
             $aURL = parse_url($_SERVER['REQUEST_URI']);
32 32
         }
33 33
 
34 34
         // Fill in the empty values
35
-        if(empty($aURL['scheme']))
35
+        if (empty($aURL['scheme']))
36 36
         {
37
-            if(!empty($_SERVER['HTTP_SCHEME']))
37
+            if (!empty($_SERVER['HTTP_SCHEME']))
38 38
             {
39 39
                 $aURL['scheme'] = $_SERVER['HTTP_SCHEME'];
40 40
             }
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
             }
45 45
         }
46 46
 
47
-        if(empty($aURL['host']))
47
+        if (empty($aURL['host']))
48 48
         {
49
-            if(!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
49
+            if (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
50 50
             {
51
-                if(strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0)
51
+                if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0)
52 52
                 {
53 53
                     list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']);
54 54
                 }
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
                     $aURL['host'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
58 58
                 }
59 59
             }
60
-            elseif(!empty($_SERVER['HTTP_HOST']))
60
+            elseif (!empty($_SERVER['HTTP_HOST']))
61 61
             {
62
-                if(strpos($_SERVER['HTTP_HOST'], ':') > 0)
62
+                if (strpos($_SERVER['HTTP_HOST'], ':') > 0)
63 63
                 {
64 64
                     list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']);
65 65
                 }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     $aURL['host'] = $_SERVER['HTTP_HOST'];
69 69
                 }
70 70
             }
71
-            elseif(!empty($_SERVER['SERVER_NAME']))
71
+            elseif (!empty($_SERVER['SERVER_NAME']))
72 72
             {
73 73
                 $aURL['host'] = $_SERVER['SERVER_NAME'];
74 74
             }
@@ -78,20 +78,20 @@  discard block
 block discarded – undo
78 78
             }
79 79
         }
80 80
 
81
-        if(empty($aURL['port']) && !empty($_SERVER['SERVER_PORT']))
81
+        if (empty($aURL['port']) && !empty($_SERVER['SERVER_PORT']))
82 82
         {
83 83
             $aURL['port'] = $_SERVER['SERVER_PORT'];
84 84
         }
85 85
 
86
-        if(!empty($aURL['path']) && strlen(basename($aURL['path'])) == 0)
86
+        if (!empty($aURL['path']) && strlen(basename($aURL['path'])) == 0)
87 87
         {
88 88
             unset($aURL['path']);
89 89
         }
90 90
 
91
-        if(empty($aURL['path']))
91
+        if (empty($aURL['path']))
92 92
         {
93 93
             $sPath = [];
94
-            if(!empty($_SERVER['PATH_INFO']))
94
+            if (!empty($_SERVER['PATH_INFO']))
95 95
             {
96 96
                 $sPath = parse_url($_SERVER['PATH_INFO']);
97 97
             }
@@ -99,61 +99,61 @@  discard block
 block discarded – undo
99 99
             {
100 100
                 $sPath = parse_url($_SERVER['PHP_SELF']);
101 101
             }
102
-            if(isset($sPath['path']))
102
+            if (isset($sPath['path']))
103 103
             {
104
-                $aURL['path'] = str_replace(array('"',"'",'<','>'), array('%22','%27','%3C','%3E'), $sPath['path']);
104
+                $aURL['path'] = str_replace(array('"', "'", '<', '>'), array('%22', '%27', '%3C', '%3E'), $sPath['path']);
105 105
             }
106 106
             unset($sPath);
107 107
         }
108 108
 
109
-        if(empty($aURL['query']) && !empty($_SERVER['QUERY_STRING']))
109
+        if (empty($aURL['query']) && !empty($_SERVER['QUERY_STRING']))
110 110
         {
111 111
             $aURL['query'] = $_SERVER['QUERY_STRING'];
112 112
         }
113 113
 
114
-        if(!empty($aURL['query']))
114
+        if (!empty($aURL['query']))
115 115
         {
116
-            $aURL['query'] = '?'.$aURL['query'];
116
+            $aURL['query'] = '?' . $aURL['query'];
117 117
         }
118 118
 
119 119
         // Build the URL: Start with scheme, user and pass
120
-        $sURL = $aURL['scheme'].'://';
121
-        if(!empty($aURL['user']))
120
+        $sURL = $aURL['scheme'] . '://';
121
+        if (!empty($aURL['user']))
122 122
         {
123
-            $sURL.= $aURL['user'];
124
-            if(!empty($aURL['pass']))
123
+            $sURL .= $aURL['user'];
124
+            if (!empty($aURL['pass']))
125 125
             {
126
-                $sURL.= ':'.$aURL['pass'];
126
+                $sURL .= ':' . $aURL['pass'];
127 127
             }
128
-            $sURL.= '@';
128
+            $sURL .= '@';
129 129
         }
130 130
 
131 131
         // Add the host
132
-        $sURL.= $aURL['host'];
132
+        $sURL .= $aURL['host'];
133 133
 
134 134
         // Add the port if needed
135
-        if(!empty($aURL['port'])
135
+        if (!empty($aURL['port'])
136 136
                 && (($aURL['scheme'] == 'http' && $aURL['port'] != 80)
137 137
                         || ($aURL['scheme'] == 'https' && $aURL['port'] != 443)))
138 138
         {
139
-            $sURL.= ':'.$aURL['port'];
139
+            $sURL .= ':' . $aURL['port'];
140 140
         }
141 141
 
142 142
         // Add the path and the query string
143
-        $sURL.= $aURL['path'].@$aURL['query'];
143
+        $sURL .= $aURL['path'] . @$aURL['query'];
144 144
 
145 145
         // Clean up
146 146
         unset($aURL);
147 147
 
148 148
         $aURL = explode("?", $sURL);
149 149
 
150
-        if(1 < count($aURL))
150
+        if (1 < count($aURL))
151 151
         {
152 152
             $aQueries = explode("&", $aURL[1]);
153 153
 
154
-            foreach($aQueries as $sKey => $sQuery)
154
+            foreach ($aQueries as $sKey => $sQuery)
155 155
             {
156
-                if("jxnGenerate" == substr($sQuery, 0, 11))
156
+                if ("jxnGenerate" == substr($sQuery, 0, 11))
157 157
                     unset($aQueries[$sKey]);
158 158
             }
159 159
 
Please login to merge, or discard this patch.
src/Utils/Config/Json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@  discard block
 block discarded – undo
29 29
     public static function read($sConfigFile, $sLibKey = '', $sAppKey = null)
30 30
     {
31 31
         $sConfigFile = realpath($sConfigFile);
32
-        if(!is_readable($sConfigFile))
32
+        if (!is_readable($sConfigFile))
33 33
         {
34 34
             throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile)));
35 35
         }
36 36
         $sFileContent = file_get_contents($sConfigFile);
37 37
         $aConfigOptions = json_decode($sFileContent, true);
38
-        if(!is_array($aConfigOptions))
38
+        if (!is_array($aConfigOptions))
39 39
         {
40 40
             throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile)));
41 41
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $jaxon = jaxon();
45 45
         $jaxon->setOptions($aConfigOptions, $sLibKey);
46 46
         $config = null;
47
-        if(is_string($sAppKey))
47
+        if (is_string($sAppKey))
48 48
         {
49 49
             $config = new Config();
50 50
             $config->setOptions($aConfigOptions, $sAppKey);
Please login to merge, or discard this patch.
src/Utils/Config/Yaml.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
     public static function read($sConfigFile, $sLibKey = '', $sAppKey = null)
30 30
     {
31 31
         $sConfigFile = realpath($sConfigFile);
32
-        if(!extension_loaded('yaml'))
32
+        if (!extension_loaded('yaml'))
33 33
         {
34 34
             throw new \Jaxon\Exception\Config\Yaml(jaxon_trans('config.errors.yaml.install'));
35 35
         }
36
-        if(!is_readable($sConfigFile))
36
+        if (!is_readable($sConfigFile))
37 37
         {
38 38
             throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.access', array('path' => $sConfigFile)));
39 39
         }
40 40
         $aConfigOptions = yaml_parse_file($sConfigFile);
41
-        if(!is_array($aConfigOptions))
41
+        if (!is_array($aConfigOptions))
42 42
         {
43 43
             throw new \Jaxon\Exception\Config\File(jaxon_trans('config.errors.file.content', array('path' => $sConfigFile)));
44 44
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         // Setup the config options into the library.
47 47
         $jaxon = jaxon();
48 48
         $jaxon->setOptions($aConfigOptions, $sLibKey);
49
-        if(!is_string($sAppKey))
49
+        if (!is_string($sAppKey))
50 50
         {
51 51
             return null;
52 52
         }
Please login to merge, or discard this patch.