@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function addNamespace($sNamespace, $sDirectory, $sExtension = '') |
| 56 | 56 | { |
| 57 | 57 | // The 'jaxon' key cannot be overriden |
| 58 | - if($sNamespace == 'jaxon') |
|
| 58 | + if ($sNamespace == 'jaxon') |
|
| 59 | 59 | { |
| 60 | 60 | return; |
| 61 | 61 | } |
@@ -92,18 +92,18 @@ discard block |
||
| 92 | 92 | // Get the namespace name |
| 93 | 93 | $sNamespace = ''; |
| 94 | 94 | $iSeparatorPosition = strrpos($sTemplate, '::'); |
| 95 | - if($iSeparatorPosition !== false) |
|
| 95 | + if ($iSeparatorPosition !== false) |
|
| 96 | 96 | { |
| 97 | 97 | $sNamespace = substr($sTemplate, 0, $iSeparatorPosition); |
| 98 | 98 | $sTemplate = substr($sTemplate, $iSeparatorPosition + 2); |
| 99 | 99 | } |
| 100 | 100 | // The default namespace is 'jaxon' |
| 101 | - if(!($sNamespace = trim($sNamespace))) |
|
| 101 | + if (!($sNamespace = trim($sNamespace))) |
|
| 102 | 102 | { |
| 103 | 103 | $sNamespace = 'jaxon'; |
| 104 | 104 | } |
| 105 | 105 | // Check if the namespace is defined |
| 106 | - if(!key_exists($sNamespace, $this->aNamespaces)) |
|
| 106 | + if (!key_exists($sNamespace, $this->aNamespaces)) |
|
| 107 | 107 | { |
| 108 | 108 | return ''; |
| 109 | 109 | } |
@@ -125,19 +125,19 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | }; |
@@ -58,7 +58,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |