Completed
Push — master ( 237738...439fa7 )
by Thierry
01:42
created
src/Utils/Http/URI.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         // Try to get the request URL
51 51
         if(!empty($_SERVER['REQUEST_URI']))
52 52
         {
53
-            $_SERVER['REQUEST_URI'] = str_replace(['"',"'",'<','>'], ['%22','%27','%3C','%3E'], $_SERVER['REQUEST_URI']);
53
+            $_SERVER['REQUEST_URI'] = str_replace(['"', "'", '<', '>'], ['%22', '%27', '%3C', '%3E'], $_SERVER['REQUEST_URI']);
54 54
             $aURL = parse_url($_SERVER['REQUEST_URI']);
55 55
             if(!is_array($aURL))
56 56
             {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             }
102 102
             if(isset($sPath['path']))
103 103
             {
104
-                $aURL['path'] = str_replace(['"',"'",'<','>'], ['%22','%27','%3C','%3E'], $sPath['path']);
104
+                $aURL['path'] = str_replace(['"', "'", '<', '>'], ['%22', '%27', '%3C', '%3E'], $sPath['path']);
105 105
             }
106 106
             unset($sPath);
107 107
         }
@@ -113,34 +113,34 @@  discard block
 block discarded – undo
113 113
 
114 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'].'://';
120
+        $sURL = $aURL['scheme'] . '://';
121 121
         if(!empty($aURL['user']))
122 122
         {
123
-            $sURL.= $aURL['user'];
123
+            $sURL .= $aURL['user'];
124 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 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);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,9 @@
 block discarded – undo
154 154
             foreach($aQueries as $sKey => $sQuery)
155 155
             {
156 156
                 if("jxnGenerate" == substr($sQuery, 0, 11))
157
-                    unset($aQueries[$sKey]);
157
+                {
158
+                                    unset($aQueries[$sKey]);
159
+                }
158 160
             }
159 161
 
160 162
             $sQueries = implode("&", $aQueries);
Please login to merge, or discard this patch.
src/Utils/DI/Container.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -126,19 +126,19 @@  discard block
 block discarded – undo
126 126
          * Core library objects
127 127
          */
128 128
         // Global Response
129
-        $this->libContainer[Response::class] = function () {
129
+        $this->libContainer[Response::class] = function() {
130 130
             return new Response();
131 131
         };
132 132
         // Dialog
133
-        $this->libContainer[Dialog::class] = function () {
133
+        $this->libContainer[Dialog::class] = function() {
134 134
             return new Dialog();
135 135
         };
136 136
         // Jaxon App
137
-        $this->libContainer[App::class] = function () {
137
+        $this->libContainer[App::class] = function() {
138 138
             return new App();
139 139
         };
140 140
         // Jaxon App bootstrap
141
-        $this->libContainer[Bootstrap::class] = function () {
141
+        $this->libContainer[Bootstrap::class] = function() {
142 142
             return new Bootstrap();
143 143
         };
144 144
 
@@ -146,27 +146,27 @@  discard block
 block discarded – undo
146 146
          * Plugins
147 147
          */
148 148
         // Callable objects repository
149
-        $this->libContainer[CallableRepository::class] = function () {
149
+        $this->libContainer[CallableRepository::class] = function() {
150 150
             return new CallableRepository();
151 151
         };
152 152
         // Callable class plugin
153
-        $this->libContainer[CallableClass::class] = function ($c) {
153
+        $this->libContainer[CallableClass::class] = function($c) {
154 154
             return new CallableClass($c[CallableRepository::class]);
155 155
         };
156 156
         // Callable dir plugin
157
-        $this->libContainer[CallableDir::class] = function ($c) {
157
+        $this->libContainer[CallableDir::class] = function($c) {
158 158
             return new CallableDir($c[CallableRepository::class]);
159 159
         };
160 160
         // Callable function plugin
161
-        $this->libContainer[CallableFunction::class] = function () {
161
+        $this->libContainer[CallableFunction::class] = function() {
162 162
             return new CallableFunction();
163 163
         };
164 164
         // File upload plugin
165
-        $this->libContainer[FileUpload::class] = function () {
165
+        $this->libContainer[FileUpload::class] = function() {
166 166
             return new FileUpload();
167 167
         };
168 168
         // JQuery response plugin
169
-        $this->libContainer[JQueryPlugin::class] = function () {
169
+        $this->libContainer[JQueryPlugin::class] = function() {
170 170
             return new JQueryPlugin();
171 171
         };
172 172
 
@@ -174,45 +174,45 @@  discard block
 block discarded – undo
174 174
          * Managers
175 175
          */
176 176
         // Plugin Manager
177
-        $this->libContainer[PluginManager::class] = function () {
177
+        $this->libContainer[PluginManager::class] = function() {
178 178
             return new PluginManager();
179 179
         };
180 180
         // Request Handler
181
-        $this->libContainer[RequestHandler::class] = function ($c) {
181
+        $this->libContainer[RequestHandler::class] = function($c) {
182 182
             return new RequestHandler($c[PluginManager::class], $c[ResponseManager::class], $c[FileUpload::class]);
183 183
         };
184 184
         // Request Factory
185
-        $this->libContainer[RequestFactory::class] = function ($c) {
185
+        $this->libContainer[RequestFactory::class] = function($c) {
186 186
             return new RequestFactory($c[CallableRepository::class]);
187 187
         };
188 188
         // Parameter Factory
189
-        $this->libContainer[ParameterFactory::class] = function () {
189
+        $this->libContainer[ParameterFactory::class] = function() {
190 190
             return new ParameterFactory();
191 191
         };
192 192
         // Response Manager
193
-        $this->libContainer[ResponseManager::class] = function () {
193
+        $this->libContainer[ResponseManager::class] = function() {
194 194
             return new ResponseManager();
195 195
         };
196 196
         // Code Generator
197
-        $this->libContainer[CodeGenerator::class] = function ($c) {
197
+        $this->libContainer[CodeGenerator::class] = function($c) {
198 198
             return new CodeGenerator($c[PluginManager::class], $c[TemplateEngine::class]);
199 199
         };
200 200
         // View Manager
201
-        $this->libContainer[ViewManager::class] = function () {
201
+        $this->libContainer[ViewManager::class] = function() {
202 202
             return new ViewManager();
203 203
         };
204 204
         // View Renderer
205
-        $this->libContainer[ViewRenderer::class] = function ($c) {
205
+        $this->libContainer[ViewRenderer::class] = function($c) {
206 206
             return new ViewRenderer($c[ViewManager::class]);
207 207
         };
208 208
 
209 209
         /*
210 210
          * Config
211 211
          */
212
-        $this->libContainer[Config::class] = function () {
212
+        $this->libContainer[Config::class] = function() {
213 213
             return new Config();
214 214
         };
215
-        $this->libContainer[ConfigReader::class] = function () {
215
+        $this->libContainer[ConfigReader::class] = function() {
216 216
             return new ConfigReader();
217 217
         };
218 218
 
@@ -220,39 +220,39 @@  discard block
 block discarded – undo
220 220
          * Services
221 221
          */
222 222
         // Minifier
223
-        $this->libContainer[Minifier::class] = function () {
223
+        $this->libContainer[Minifier::class] = function() {
224 224
             return new Minifier();
225 225
         };
226 226
         // Translator
227
-        $this->libContainer[Translator::class] = function ($c) {
227
+        $this->libContainer[Translator::class] = function($c) {
228 228
             return new Translator($c['jaxon.core.translation_dir'], $c[Config::class]);
229 229
         };
230 230
         // Template engine
231
-        $this->libContainer[TemplateEngine::class] = function ($c) {
231
+        $this->libContainer[TemplateEngine::class] = function($c) {
232 232
             return new TemplateEngine($c['jaxon.core.template_dir']);
233 233
         };
234 234
         // Template Renderer
235
-        $this->libContainer[TemplateRenderer::class] = function ($c) {
235
+        $this->libContainer[TemplateRenderer::class] = function($c) {
236 236
             return $c[TemplateEngine::class];
237 237
         };
238 238
         // Validator
239
-        $this->libContainer[Validator::class] = function ($c) {
239
+        $this->libContainer[Validator::class] = function($c) {
240 240
             return new Validator($c[Translator::class], $c[Config::class]);
241 241
         };
242 242
         // Pagination Paginator
243
-        $this->libContainer[Paginator::class] = function ($c) {
243
+        $this->libContainer[Paginator::class] = function($c) {
244 244
             return new Paginator($c[PaginationRenderer::class]);
245 245
         };
246 246
         // Pagination Renderer
247
-        $this->libContainer[PaginationRenderer::class] = function ($c) {
247
+        $this->libContainer[PaginationRenderer::class] = function($c) {
248 248
             return new PaginationRenderer($c[TemplateRenderer::class]);
249 249
         };
250 250
         // Event Dispatcher
251
-        $this->libContainer[EventDispatcher::class] = function () {
251
+        $this->libContainer[EventDispatcher::class] = function() {
252 252
             return new EventDispatcher();
253 253
         };
254 254
         // URI decoder
255
-        $this->libContainer[URI::class] = function () {
255
+        $this->libContainer[URI::class] = function() {
256 256
             return new URI();
257 257
         };
258 258
     }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     public function alias($sClass, $sAlias)
296 296
     {
297
-        $this->libContainer[$sClass] = function ($c) use ($sAlias) {
297
+        $this->libContainer[$sClass] = function($c) use ($sAlias) {
298 298
             return $c[$sAlias];
299 299
         };
300 300
     }
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
      */
565 565
     public function setCallableClassRequestFactory($sClassName, CallableObject $xCallableObject)
566 566
     {
567
-        $this->libContainer[$sClassName . '_RequestFactory'] = function () use ($xCallableObject) {
567
+        $this->libContainer[$sClassName . '_RequestFactory'] = function() use ($xCallableObject) {
568 568
             // $xCallableObject = $c[CallableRepository::class]->getCallableObject($sClassName);
569 569
             return new CallableClassRequestFactory($xCallableObject);
570 570
         };
Please login to merge, or discard this patch.