Completed
Push — master ( 859b6d...c8dd9a )
by Thierry
01:30
created
src/Utils/DI/Container.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -125,19 +125,19 @@  discard block
 block discarded – undo
125 125
          * Core library objects
126 126
          */
127 127
         // Global Response
128
-        $this->libContainer[Response::class] = function () {
128
+        $this->libContainer[Response::class] = function() {
129 129
             return new Response();
130 130
         };
131 131
         // Dialog
132
-        $this->libContainer[Dialog::class] = function () {
132
+        $this->libContainer[Dialog::class] = function() {
133 133
             return new Dialog();
134 134
         };
135 135
         // Jaxon App
136
-        $this->libContainer[App::class] = function () {
136
+        $this->libContainer[App::class] = function() {
137 137
             return new App();
138 138
         };
139 139
         // Jaxon App bootstrap
140
-        $this->libContainer[Bootstrap::class] = function () {
140
+        $this->libContainer[Bootstrap::class] = function() {
141 141
             return new Bootstrap();
142 142
         };
143 143
 
@@ -145,27 +145,27 @@  discard block
 block discarded – undo
145 145
          * Plugins
146 146
          */
147 147
         // Callable objects repository
148
-        $this->libContainer[CallableRepository::class] = function () {
148
+        $this->libContainer[CallableRepository::class] = function() {
149 149
             return new CallableRepository();
150 150
         };
151 151
         // Callable class plugin
152
-        $this->libContainer[CallableClass::class] = function ($c) {
152
+        $this->libContainer[CallableClass::class] = function($c) {
153 153
             return new CallableClass($c[CallableRepository::class]);
154 154
         };
155 155
         // Callable dir plugin
156
-        $this->libContainer[CallableDir::class] = function ($c) {
156
+        $this->libContainer[CallableDir::class] = function($c) {
157 157
             return new CallableDir($c[CallableRepository::class]);
158 158
         };
159 159
         // Callable function plugin
160
-        $this->libContainer[CallableFunction::class] = function () {
160
+        $this->libContainer[CallableFunction::class] = function() {
161 161
             return new CallableFunction();
162 162
         };
163 163
         // File upload plugin
164
-        $this->libContainer[FileUpload::class] = function () {
164
+        $this->libContainer[FileUpload::class] = function() {
165 165
             return new FileUpload();
166 166
         };
167 167
         // JQuery response plugin
168
-        $this->libContainer[JQueryPlugin::class] = function () {
168
+        $this->libContainer[JQueryPlugin::class] = function() {
169 169
             return new JQueryPlugin();
170 170
         };
171 171
 
@@ -173,45 +173,45 @@  discard block
 block discarded – undo
173 173
          * Managers
174 174
          */
175 175
         // Plugin Manager
176
-        $this->libContainer[PluginManager::class] = function () {
176
+        $this->libContainer[PluginManager::class] = function() {
177 177
             return new PluginManager();
178 178
         };
179 179
         // Request Handler
180
-        $this->libContainer[RequestHandler::class] = function ($c) {
180
+        $this->libContainer[RequestHandler::class] = function($c) {
181 181
             return new RequestHandler($c[PluginManager::class], $c[ResponseManager::class], $c[FileUpload::class]);
182 182
         };
183 183
         // Request Factory
184
-        $this->libContainer[RequestFactory::class] = function ($c) {
184
+        $this->libContainer[RequestFactory::class] = function($c) {
185 185
             return new RequestFactory($c[CallableRepository::class]);
186 186
         };
187 187
         // Parameter Factory
188
-        $this->libContainer[ParameterFactory::class] = function () {
188
+        $this->libContainer[ParameterFactory::class] = function() {
189 189
             return new ParameterFactory();
190 190
         };
191 191
         // Response Manager
192
-        $this->libContainer[ResponseManager::class] = function () {
192
+        $this->libContainer[ResponseManager::class] = function() {
193 193
             return new ResponseManager();
194 194
         };
195 195
         // Code Generator
196
-        $this->libContainer[CodeGenerator::class] = function ($c) {
196
+        $this->libContainer[CodeGenerator::class] = function($c) {
197 197
             return new CodeGenerator($c[PluginManager::class], $c[TemplateEngine::class]);
198 198
         };
199 199
         // View Manager
200
-        $this->libContainer[ViewManager::class] = function () {
200
+        $this->libContainer[ViewManager::class] = function() {
201 201
             return new ViewManager();
202 202
         };
203 203
         // View Renderer
204
-        $this->libContainer[ViewRenderer::class] = function ($c) {
204
+        $this->libContainer[ViewRenderer::class] = function($c) {
205 205
             return new ViewRenderer($c[ViewManager::class]);
206 206
         };
207 207
 
208 208
         /*
209 209
          * Config
210 210
          */
211
-        $this->libContainer[Config::class] = function () {
211
+        $this->libContainer[Config::class] = function() {
212 212
             return new Config();
213 213
         };
214
-        $this->libContainer[ConfigReader::class] = function () {
214
+        $this->libContainer[ConfigReader::class] = function() {
215 215
             return new ConfigReader();
216 216
         };
217 217
 
@@ -219,35 +219,35 @@  discard block
 block discarded – undo
219 219
          * Services
220 220
          */
221 221
         // Minifier
222
-        $this->libContainer[Minifier::class] = function () {
222
+        $this->libContainer[Minifier::class] = function() {
223 223
             return new Minifier();
224 224
         };
225 225
         // Translator
226
-        $this->libContainer[Translator::class] = function ($c) {
226
+        $this->libContainer[Translator::class] = function($c) {
227 227
             return new Translator($c['jaxon.core.translation_dir'], $c[Config::class]);
228 228
         };
229 229
         // Template engine
230
-        $this->libContainer[TemplateEngine::class] = function ($c) {
230
+        $this->libContainer[TemplateEngine::class] = function($c) {
231 231
             return new TemplateEngine($c['jaxon.core.template_dir']);
232 232
         };
233 233
         // Template Renderer
234
-        $this->libContainer[TemplateRenderer::class] = function ($c) {
234
+        $this->libContainer[TemplateRenderer::class] = function($c) {
235 235
             return $c[TemplateEngine::class];
236 236
         };
237 237
         // Validator
238
-        $this->libContainer[Validator::class] = function ($c) {
238
+        $this->libContainer[Validator::class] = function($c) {
239 239
             return new Validator($c[Translator::class], $c[Config::class]);
240 240
         };
241 241
         // Pagination Paginator
242
-        $this->libContainer[Paginator::class] = function ($c) {
242
+        $this->libContainer[Paginator::class] = function($c) {
243 243
             return new Paginator($c[PaginationRenderer::class]);
244 244
         };
245 245
         // Pagination Renderer
246
-        $this->libContainer[PaginationRenderer::class] = function ($c) {
246
+        $this->libContainer[PaginationRenderer::class] = function($c) {
247 247
             return new PaginationRenderer($c[TemplateRenderer::class]);
248 248
         };
249 249
         // Event Dispatcher
250
-        $this->libContainer[EventDispatcher::class] = function () {
250
+        $this->libContainer[EventDispatcher::class] = function() {
251 251
             return new EventDispatcher();
252 252
         };
253 253
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function get($sClass)
261 261
     {
262
-        if($this->appContainer != null && $this->appContainer->has($sClass))
262
+        if ($this->appContainer != null && $this->appContainer->has($sClass))
263 263
         {
264 264
             return $this->appContainer->get($sClass);
265 265
         }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      */
290 290
     public function alias($sClass, $sAlias)
291 291
     {
292
-        $this->libContainer[$sClass] = function ($c) use ($sAlias) {
292
+        $this->libContainer[$sClass] = function($c) use ($sAlias) {
293 293
             return $c[$sAlias];
294 294
         };
295 295
     }
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
      */
560 560
     public function setCallableClassRequestFactory($sClassName, CallableObject $xCallableObject)
561 561
     {
562
-        $this->libContainer[$sClassName . '_RequestFactory'] = function () use ($xCallableObject) {
562
+        $this->libContainer[$sClassName . '_RequestFactory'] = function() use ($xCallableObject) {
563 563
             // $xCallableObject = $c[CallableRepository::class]->getCallableObject($sClassName);
564 564
             return new CallableClassRequestFactory($xCallableObject);
565 565
         };
Please login to merge, or discard this patch.
src/Request/Handler/Callback.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function before($xCallable = null)
60 60
     {
61
-        if($xCallable === null)
61
+        if ($xCallable === null)
62 62
         {
63 63
             return $this->xBeforeCallback;
64 64
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function after($xCallable = null)
76 76
     {
77
-        if($xCallable === null)
77
+        if ($xCallable === null)
78 78
         {
79 79
             return $this->xAfterCallback;
80 80
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function invalid($xCallable = null)
92 92
     {
93
-        if($xCallable === null)
93
+        if ($xCallable === null)
94 94
         {
95 95
             return $this->xInvalidCallback;
96 96
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function error($xCallable = null)
108 108
     {
109
-        if($xCallable === null)
109
+        if ($xCallable === null)
110 110
         {
111 111
             return $this->xErrorCallback;
112 112
         }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function init($xCallable = null)
124 124
     {
125
-        if($xCallable === null)
125
+        if ($xCallable === null)
126 126
         {
127 127
             return $this->xInitCallback;
128 128
         }
Please login to merge, or discard this patch.
src/Jaxon.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function getInstance()
84 84
     {
85
-        if(self::$xInstance == null)
85
+        if (self::$xInstance == null)
86 86
         {
87 87
             self::$xInstance = new Jaxon();
88 88
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function __construct()
96 96
     {
97
-        if(self::$xContainer == null)
97
+        if (self::$xContainer == null)
98 98
         {
99 99
             self::$xContainer = new Container();
100 100
             $this->setDefaultOptions();
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             'core.prefix.class'                 => 'Jaxon',
155 155
             // 'core.request.uri'               => '',
156 156
             'core.request.mode'                 => 'asynchronous',
157
-            'core.request.method'               => 'POST',    // W3C: Method is case sensitive
157
+            'core.request.method'               => 'POST', // W3C: Method is case sensitive
158 158
             'core.response.send'                => true,
159 159
             'core.response.merge.ap'            => true,
160 160
             'core.response.merge.js'            => true,
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
      */
241 241
     public function register($sType, $sCallable, $xOptions = [])
242 242
     {
243
-        if($sType == Jaxon::PROCESSING_EVENT)
243
+        if ($sType == Jaxon::PROCESSING_EVENT)
244 244
         {
245 245
             $sEvent = $sCallable;
246 246
             $xCallback = $xOptions;
247
-            switch($sEvent)
247
+            switch ($sEvent)
248 248
             {
249 249
             case Jaxon::PROCESSING_EVENT_BEFORE:
250 250
                 $this->callback()->before($xCallback);
Please login to merge, or discard this patch.