Passed
Push — main ( 238af9...5ca287 )
by Thierry
20:54 queued 15:16
created
jaxon-core/src/Plugin/Manager/PluginManager.php 2 patches
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     private function _registerPlugin(string $sClassName, string $sPluginName, array $aInterfaces): int
101 101
     {
102 102
         // Any plugin must implement the PluginInterface interface.
103
-        if(!in_array(PluginInterface::class, $aInterfaces))
103
+        if (!in_array(PluginInterface::class, $aInterfaces))
104 104
         {
105 105
             $sMessage = $this->xTranslator->trans('errors.register.invalid', [
106 106
                 'name' => $sClassName,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         }
110 110
 
111 111
         // Response plugin.
112
-        if(in_array(ResponsePluginInterface::class, $aInterfaces))
112
+        if (in_array(ResponsePluginInterface::class, $aInterfaces))
113 113
         {
114 114
             $this->aResponsePlugins[$sPluginName] = $sClassName;
115 115
             return 1;
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
 
118 118
         // Request plugin.
119 119
         $nCount = 0;
120
-        if(in_array(CallableRegistryInterface::class, $aInterfaces))
120
+        if (in_array(CallableRegistryInterface::class, $aInterfaces))
121 121
         {
122 122
             $this->aRegistryPlugins[$sPluginName] = $sClassName;
123 123
             $nCount++;
124 124
         }
125
-        if(in_array(RequestHandlerInterface::class, $aInterfaces))
125
+        if (in_array(RequestHandlerInterface::class, $aInterfaces))
126 126
         {
127 127
             $this->aRequestHandlers[$sPluginName] = $sClassName;
128 128
             $nCount++;
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
         $nCount = $this->_registerPlugin($sClassName, $sPluginName, $aInterfaces);
152 152
 
153 153
         // Any plugin can implement the CodeGeneratorInterface interface.
154
-        if(in_array(CodeGeneratorInterface::class, $aInterfaces))
154
+        if (in_array(CodeGeneratorInterface::class, $aInterfaces))
155 155
         {
156 156
             $this->xCodeGenerator->addCodeGenerator($sClassName, $nPriority);
157 157
             $nCount++;
158 158
         }
159 159
         // The class is not a valid plugin.
160
-        if($nCount === 0)
160
+        if ($nCount === 0)
161 161
         {
162 162
             $sMessage = $this->xTranslator->trans('errors.register.invalid', [
163 163
                 'name' => $sClassName,
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         }
167 167
 
168 168
         // Register the plugin in the DI container, if necessary
169
-        if(!$this->di->has($sClassName))
169
+        if (!$this->di->has($sClassName))
170 170
         {
171 171
             $this->di->auto($sClassName);
172 172
         }
@@ -182,8 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     public function getResponsePlugin(string $sName): ?ResponsePluginInterface
184 184
     {
185
-        return $this->di->h($sName) ? $this->di->g($sName) :
186
-            (!isset($this->aResponsePlugins[$sName]) ? null :
185
+        return $this->di->h($sName) ? $this->di->g($sName) : (!isset($this->aResponsePlugins[$sName]) ? null :
187 186
             $this->di->g($this->aResponsePlugins[$sName]));
188 187
     }
189 188
 
@@ -201,7 +200,7 @@  discard block
 block discarded – undo
201 200
      */
202 201
     public function registerCallable(string $sType, string $sCallable, $xOptions = []): void
203 202
     {
204
-        if(isset($this->aRegistryPlugins[$sType]) &&
203
+        if (isset($this->aRegistryPlugins[$sType]) &&
205 204
             ($xPlugin = $this->di->g($this->aRegistryPlugins[$sType])))
206 205
         {
207 206
             $xPlugin->register($sType, $sCallable, $xPlugin->checkOptions($sCallable, $xOptions));
Please login to merge, or discard this patch.
Switch Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -45,49 +45,49 @@  discard block
 block discarded – undo
45 45
 
46 46
 class PluginManager
47 47
 {
48
-    /**
48
+/**
49 49
      * Request plugins, indexed by name
50 50
      *
51 51
      * @var array<string>
52 52
      */
53
-    private $aRegistryPlugins = [];
53
+private $aRegistryPlugins = [];
54 54
 
55
-    /**
55
+/**
56 56
      * Request handlers, indexed by name
57 57
      *
58 58
      * @var array<string>
59 59
      */
60
-    private $aRequestHandlers = [];
60
+private $aRequestHandlers = [];
61 61
 
62
-    /**
62
+/**
63 63
      * Response plugins, indexed by name
64 64
      *
65 65
      * @var array<string>
66 66
      */
67
-    private $aResponsePlugins = [];
67
+private $aResponsePlugins = [];
68 68
 
69
-    /**
69
+/**
70 70
      * The constructor
71 71
      *
72 72
      * @param Container $di
73 73
      * @param CodeGenerator $xCodeGenerator
74 74
      * @param Translator $xTranslator
75 75
      */
76
-    public function __construct(private Container $di,
77
-        private CodeGenerator $xCodeGenerator, private Translator $xTranslator)
78
-    {}
76
+public function __construct(private Container $di,
77
+private CodeGenerator $xCodeGenerator, private Translator $xTranslator)
78
+{}
79 79
 
80
-    /**
80
+/**
81 81
      * Get the request plugins
82 82
      *
83 83
      * @return array<class-string>
84 84
      */
85
-    public function getRequestHandlers(): array
86
-    {
87
-        return $this->aRequestHandlers;
88
-    }
85
+public function getRequestHandlers(): array
86
+{
87
+return $this->aRequestHandlers;
88
+}
89 89
 
90
-    /**
90
+/**
91 91
      * Register a plugin
92 92
      *
93 93
      * @param class-string $sClassName    The plugin class
@@ -97,40 +97,40 @@  discard block
 block discarded – undo
97 97
      * @return int
98 98
      * @throws SetupException
99 99
      */
100
-    private function _registerPlugin(string $sClassName, string $sPluginName, array $aInterfaces): int
101
-    {
102
-        // Any plugin must implement the PluginInterface interface.
103
-        if(!in_array(PluginInterface::class, $aInterfaces))
104
-        {
105
-            $sMessage = $this->xTranslator->trans('errors.register.invalid', [
106
-                'name' => $sClassName,
107
-            ]);
108
-            throw new SetupException($sMessage);
109
-        }
110
-
111
-        // Response plugin.
112
-        if(in_array(ResponsePluginInterface::class, $aInterfaces))
113
-        {
114
-            $this->aResponsePlugins[$sPluginName] = $sClassName;
115
-            return 1;
116
-        }
117
-
118
-        // Request plugin.
119
-        $nCount = 0;
120
-        if(in_array(CallableRegistryInterface::class, $aInterfaces))
121
-        {
122
-            $this->aRegistryPlugins[$sPluginName] = $sClassName;
123
-            $nCount++;
124
-        }
125
-        if(in_array(RequestHandlerInterface::class, $aInterfaces))
126
-        {
127
-            $this->aRequestHandlers[$sPluginName] = $sClassName;
128
-            $nCount++;
129
-        }
130
-        return $nCount;
131
-    }
132
-
133
-    /**
100
+private function _registerPlugin(string $sClassName, string $sPluginName, array $aInterfaces): int
101
+{
102
+// Any plugin must implement the PluginInterface interface.
103
+if(!in_array(PluginInterface::class, $aInterfaces))
104
+{
105
+$sMessage = $this->xTranslator->trans('errors.register.invalid', [
106
+    'name' => $sClassName,
107
+]);
108
+throw new SetupException($sMessage);
109
+}
110
+
111
+// Response plugin.
112
+if(in_array(ResponsePluginInterface::class, $aInterfaces))
113
+{
114
+$this->aResponsePlugins[$sPluginName] = $sClassName;
115
+return 1;
116
+}
117
+
118
+// Request plugin.
119
+$nCount = 0;
120
+if(in_array(CallableRegistryInterface::class, $aInterfaces))
121
+{
122
+$this->aRegistryPlugins[$sPluginName] = $sClassName;
123
+$nCount++;
124
+}
125
+if(in_array(RequestHandlerInterface::class, $aInterfaces))
126
+{
127
+$this->aRequestHandlers[$sPluginName] = $sClassName;
128
+$nCount++;
129
+}
130
+return $nCount;
131
+}
132
+
133
+/**
134 134
      * Register a plugin
135 135
      *
136 136
      * Below is a table for priorities and their description:
@@ -145,34 +145,34 @@  discard block
 block discarded – undo
145 145
      * @return void
146 146
      * @throws SetupException
147 147
      */
148
-    public function registerPlugin(string $sClassName, string $sPluginName, int $nPriority = 1000): void
149
-    {
150
-        $aInterfaces = class_implements($sClassName);
151
-        $nCount = $this->_registerPlugin($sClassName, $sPluginName, $aInterfaces);
152
-
153
-        // Any plugin can implement the CodeGeneratorInterface interface.
154
-        if(in_array(CodeGeneratorInterface::class, $aInterfaces))
155
-        {
156
-            $this->xCodeGenerator->addCodeGenerator($sClassName, $nPriority);
157
-            $nCount++;
158
-        }
159
-        // The class is not a valid plugin.
160
-        if($nCount === 0)
161
-        {
162
-            $sMessage = $this->xTranslator->trans('errors.register.invalid', [
163
-                'name' => $sClassName,
164
-            ]);
165
-            throw new SetupException($sMessage);
166
-        }
167
-
168
-        // Register the plugin in the DI container, if necessary
169
-        if(!$this->di->has($sClassName))
170
-        {
171
-            $this->di->auto($sClassName);
172
-        }
173
-    }
174
-
175
-    /**
148
+public function registerPlugin(string $sClassName, string $sPluginName, int $nPriority = 1000): void
149
+{
150
+$aInterfaces = class_implements($sClassName);
151
+$nCount = $this->_registerPlugin($sClassName, $sPluginName, $aInterfaces);
152
+
153
+// Any plugin can implement the CodeGeneratorInterface interface.
154
+if(in_array(CodeGeneratorInterface::class, $aInterfaces))
155
+{
156
+$this->xCodeGenerator->addCodeGenerator($sClassName, $nPriority);
157
+$nCount++;
158
+}
159
+// The class is not a valid plugin.
160
+if($nCount === 0)
161
+{
162
+$sMessage = $this->xTranslator->trans('errors.register.invalid', [
163
+    'name' => $sClassName,
164
+]);
165
+throw new SetupException($sMessage);
166
+}
167
+
168
+// Register the plugin in the DI container, if necessary
169
+if(!$this->di->has($sClassName))
170
+{
171
+$this->di->auto($sClassName);
172
+}
173
+}
174
+
175
+/**
176 176
      * Find the specified response plugin by name or class name
177 177
      *
178 178
      * @template R of ResponsePluginInterface
@@ -180,14 +180,14 @@  discard block
 block discarded – undo
180 180
      *
181 181
      * @return ($sName is class-string ? R|null : ResponsePluginInterface|null)
182 182
      */
183
-    public function getResponsePlugin(string $sName): ?ResponsePluginInterface
184
-    {
185
-        return $this->di->h($sName) ? $this->di->g($sName) :
186
-            (!isset($this->aResponsePlugins[$sName]) ? null :
187
-            $this->di->g($this->aResponsePlugins[$sName]));
188
-    }
189
-
190
-    /**
183
+public function getResponsePlugin(string $sName): ?ResponsePluginInterface
184
+{
185
+return $this->di->h($sName) ? $this->di->g($sName) :
186
+(!isset($this->aResponsePlugins[$sName]) ? null :
187
+$this->di->g($this->aResponsePlugins[$sName]));
188
+}
189
+
190
+/**
191 191
      * Register a callable function or class
192 192
      *
193 193
      * Call the request plugin with the $sType defined as name.
@@ -199,46 +199,46 @@  discard block
 block discarded – undo
199 199
      * @return void
200 200
      * @throws SetupException
201 201
      */
202
-    public function registerCallable(string $sType, string $sCallable, $xOptions = []): void
203
-    {
204
-        if(isset($this->aRegistryPlugins[$sType]) &&
205
-            ($xPlugin = $this->di->g($this->aRegistryPlugins[$sType])))
206
-        {
207
-            $xPlugin->register($sType, $sCallable, $xPlugin->checkOptions($sCallable, $xOptions));
208
-            return;
209
-        }
210
-        throw new SetupException($this->xTranslator->trans('errors.register.plugin',
211
-            ['name' => $sType, 'callable' => $sCallable]));
212
-    }
213
-
214
-    /**
202
+public function registerCallable(string $sType, string $sCallable, $xOptions = []): void
203
+{
204
+if(isset($this->aRegistryPlugins[$sType]) &&
205
+($xPlugin = $this->di->g($this->aRegistryPlugins[$sType])))
206
+{
207
+$xPlugin->register($sType, $sCallable, $xPlugin->checkOptions($sCallable, $xOptions));
208
+return;
209
+}
210
+throw new SetupException($this->xTranslator->trans('errors.register.plugin',
211
+['name' => $sType, 'callable' => $sCallable]));
212
+}
213
+
214
+/**
215 215
      * Register the Jaxon request plugins
216 216
      *
217 217
      * @return void
218 218
      * @throws SetupException
219 219
      */
220
-    public function registerPlugins(): void
221
-    {
222
-        // Request plugins
223
-        $this->registerPlugin(CallableClassPlugin::class, Jaxon::CALLABLE_CLASS, 101);
224
-        $this->registerPlugin(CallableFunctionPlugin::class, Jaxon::CALLABLE_FUNCTION, 102);
225
-        $this->registerPlugin(CallableDirPlugin::class, Jaxon::CALLABLE_DIR, 103);
226
-
227
-        // Response plugins
228
-        $this->registerPlugin(ScriptPlugin::class, ScriptPlugin::NAME, 700);
229
-        $this->registerPlugin(DatabagPlugin::class, DatabagPlugin::NAME, 700);
230
-        $this->registerPlugin(DialogPlugin::class, DialogPlugin::NAME, 750);
231
-        $this->registerPlugin(PaginatorPlugin::class, PaginatorPlugin::NAME, 800);
232
-        $this->registerPlugin(PsrPlugin::class, PsrPlugin::NAME, 850);
233
-    }
234
-
235
-    /**
220
+public function registerPlugins(): void
221
+{
222
+// Request plugins
223
+$this->registerPlugin(CallableClassPlugin::class, Jaxon::CALLABLE_CLASS, 101);
224
+$this->registerPlugin(CallableFunctionPlugin::class, Jaxon::CALLABLE_FUNCTION, 102);
225
+$this->registerPlugin(CallableDirPlugin::class, Jaxon::CALLABLE_DIR, 103);
226
+
227
+// Response plugins
228
+$this->registerPlugin(ScriptPlugin::class, ScriptPlugin::NAME, 700);
229
+$this->registerPlugin(DatabagPlugin::class, DatabagPlugin::NAME, 700);
230
+$this->registerPlugin(DialogPlugin::class, DialogPlugin::NAME, 750);
231
+$this->registerPlugin(PaginatorPlugin::class, PaginatorPlugin::NAME, 800);
232
+$this->registerPlugin(PsrPlugin::class, PsrPlugin::NAME, 850);
233
+}
234
+
235
+/**
236 236
      * Get the parameter reader
237 237
      *
238 238
      * @return ParameterReader
239 239
      */
240
-    public function getParameterReader(): ParameterReader
241
-    {
242
-        return $this->di->g(ParameterReader::class);
243
-    }
240
+public function getParameterReader(): ParameterReader
241
+{
242
+return $this->di->g(ParameterReader::class);
243
+}
244 244
 }
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Response/Psr/PsrPlugin.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public function ajaxResponse(): ResponseInterface
64 64
     {
65 65
         $xPsrResponse = $this->xPsr17Factory->createResponse(200);
66
-        if($this->xRequest->getMethod() === 'GET')
66
+        if ($this->xRequest->getMethod() === 'GET')
67 67
         {
68 68
             $xPsrResponse = $xPsrResponse
69 69
                 ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
Please login to merge, or discard this patch.
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -23,56 +23,56 @@
 block discarded – undo
23 23
 
24 24
 class PsrPlugin extends AbstractResponsePlugin
25 25
 {
26
-    /**
26
+/**
27 27
      * @const The plugin name
28 28
      */
29
-    public const NAME = 'psr';
29
+public const NAME = 'psr';
30 30
 
31
-    /**
31
+/**
32 32
      * The class constructor
33 33
      *
34 34
      * @param Psr17Factory $xPsr17Factory
35 35
      * @param RequestInterface $xRequest
36 36
      */
37
-    public function __construct(private Psr17Factory $xPsr17Factory,
38
-        private RequestInterface $xRequest)
39
-    {}
37
+public function __construct(private Psr17Factory $xPsr17Factory,
38
+private RequestInterface $xRequest)
39
+{}
40 40
 
41
-    /**
41
+/**
42 42
      * @inheritDoc
43 43
      */
44
-    public function getName(): string
45
-    {
46
-        return self::NAME;
47
-    }
44
+public function getName(): string
45
+{
46
+return self::NAME;
47
+}
48 48
 
49
-    /**
49
+/**
50 50
      * @inheritDoc
51 51
      */
52
-    public function getHash(): string
53
-    {
54
-        // Use the version number as hash
55
-        return '5.0.0';
56
-    }
52
+public function getHash(): string
53
+{
54
+// Use the version number as hash
55
+return '5.0.0';
56
+}
57 57
 
58
-    /**
58
+/**
59 59
      * Convert an ajax response to a PSR7 response object
60 60
      *
61 61
      * @return ResponseInterface
62 62
      */
63
-    public function ajaxResponse(): ResponseInterface
64
-    {
65
-        $xPsrResponse = $this->xPsr17Factory->createResponse(200);
66
-        if($this->xRequest->getMethod() === 'GET')
67
-        {
68
-            $xPsrResponse = $xPsrResponse
69
-                ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
70
-                ->withHeader('Last-Modified', gmdate("D, d M Y H:i:s") . ' GMT')
71
-                ->withHeader('Cache-Control', 'no-cache, must-revalidate')
72
-                ->withHeader('Pragma', 'no-cache');
73
-        }
74
-        return $xPsrResponse
75
-            ->withHeader('content-type', $this->response()->getContentType())
76
-            ->withBody(Stream::create($this->response()->getOutput()));
77
-    }
63
+public function ajaxResponse(): ResponseInterface
64
+{
65
+$xPsrResponse = $this->xPsr17Factory->createResponse(200);
66
+if($this->xRequest->getMethod() === 'GET')
67
+{
68
+$xPsrResponse = $xPsrResponse
69
+    ->withHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
70
+    ->withHeader('Last-Modified', gmdate("D, d M Y H:i:s") . ' GMT')
71
+    ->withHeader('Cache-Control', 'no-cache, must-revalidate')
72
+    ->withHeader('Pragma', 'no-cache');
73
+}
74
+return $xPsrResponse
75
+->withHeader('content-type', $this->response()->getContentType())
76
+->withBody(Stream::create($this->response()->getOutput()));
77
+}
78 78
 }
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Code/ConfigScriptGenerator.php 2 patches
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
     public function getScript(): string
53 53
     {
54 54
         // It is important to call $this->xParameterReader->uri() only if necessary.
55
-        $sUri = $this->xConfigManager->getOption('core.request.uri') ?:
56
-            $this->xParameterReader->uri();
55
+        $sUri = $this->xConfigManager->getOption('core.request.uri') ?: $this->xParameterReader->uri();
57 56
         $aOptions = [
58 57
             'sResponseType'      => 'JSON',
59 58
             'sVersion'           => $this->option('core.version'),
Please login to merge, or discard this patch.
Switch Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -22,53 +22,53 @@
 block discarded – undo
22 22
 
23 23
 class ConfigScriptGenerator extends AbstractCodeGenerator
24 24
 {
25
-    /**
25
+/**
26 26
      * The constructor
27 27
      *
28 28
      * @param ParameterReader $xParameterReader
29 29
      * @param TemplateEngine $xTemplateEngine
30 30
      * @param ConfigManager $xConfigManager
31 31
      */
32
-    public function __construct(private ParameterReader $xParameterReader,
33
-        private TemplateEngine $xTemplateEngine, private ConfigManager $xConfigManager)
34
-    {}
32
+public function __construct(private ParameterReader $xParameterReader,
33
+private TemplateEngine $xTemplateEngine, private ConfigManager $xConfigManager)
34
+{}
35 35
 
36
-    /**
36
+/**
37 37
      * Get the value of a config option
38 38
      *
39 39
      * @param string $sName The option name
40 40
      *
41 41
      * @return mixed
42 42
      */
43
-    private function option(string $sName): mixed
44
-    {
45
-        return $this->xConfigManager->getOption($sName);
46
-    }
43
+private function option(string $sName): mixed
44
+{
45
+return $this->xConfigManager->getOption($sName);
46
+}
47 47
 
48
-    /**
48
+/**
49 49
      * @inheritDoc
50 50
      * @throws UriException
51 51
      */
52
-    public function getScript(): string
53
-    {
54
-        // It is important to call $this->xParameterReader->uri() only if necessary.
55
-        $sUri = $this->xConfigManager->getOption('core.request.uri') ?:
56
-            $this->xParameterReader->uri();
57
-        $aOptions = [
58
-            'sResponseType'      => 'JSON',
59
-            'sVersion'           => $this->option('core.version'),
60
-            'sLanguage'          => $this->option('core.language'),
61
-            'sRequestURI'        => $sUri,
62
-            'sDefaultMode'       => $this->option('core.request.mode'),
63
-            'sDefaultMethod'     => $this->option('core.request.method'),
64
-            'sCsrfMetaName'      => $this->option('core.request.csrf_meta'),
65
-            'bDebug'             => $this->option('core.debug.on'),
66
-            'bVerboseDebug'      => $this->option('core.debug.verbose'),
67
-            'sDebugOutputID'     => $this->option('core.debug.output_id'),
68
-            'nResponseQueueSize' => $this->option('js.lib.queue_size'),
69
-            'sStatusMessages'    => $this->option('js.lib.show_status') ? 'true' : 'false',
70
-            'sWaitCursor'        => $this->option('js.lib.show_cursor') ? 'true' : 'false',
71
-        ];
72
-        return $this->xTemplateEngine->render('jaxon::plugins/config.js', $aOptions);
73
-    }
52
+public function getScript(): string
53
+{
54
+// It is important to call $this->xParameterReader->uri() only if necessary.
55
+$sUri = $this->xConfigManager->getOption('core.request.uri') ?:
56
+$this->xParameterReader->uri();
57
+$aOptions = [
58
+'sResponseType'      => 'JSON',
59
+'sVersion'           => $this->option('core.version'),
60
+'sLanguage'          => $this->option('core.language'),
61
+'sRequestURI'        => $sUri,
62
+'sDefaultMode'       => $this->option('core.request.mode'),
63
+'sDefaultMethod'     => $this->option('core.request.method'),
64
+'sCsrfMetaName'      => $this->option('core.request.csrf_meta'),
65
+'bDebug'             => $this->option('core.debug.on'),
66
+'bVerboseDebug'      => $this->option('core.debug.verbose'),
67
+'sDebugOutputID'     => $this->option('core.debug.output_id'),
68
+'nResponseQueueSize' => $this->option('js.lib.queue_size'),
69
+'sStatusMessages'    => $this->option('js.lib.show_status') ? 'true' : 'false',
70
+'sWaitCursor'        => $this->option('js.lib.show_cursor') ? 'true' : 'false',
71
+];
72
+return $this->xTemplateEngine->render('jaxon::plugins/config.js', $aOptions);
73
+}
74 74
 }
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Code/AssetManager.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function shallIncludeAssets(AbstractPlugin $xPlugin): bool
74 74
     {
75 75
         $sPluginOptionName = 'assets.include.' . $xPlugin->getName();
76
-        if($this->hasLibOption($sPluginOptionName))
76
+        if ($this->hasLibOption($sPluginOptionName))
77 77
         {
78 78
             return $this->getLibOption($sPluginOptionName);
79 79
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             $this->getLibOption('js.lib.jq', "$sJsLibUri/libs/chibi/chibi$sJsExtension"),
98 98
             "$sJsLibUri/jaxon.core$sJsExtension",
99 99
         ];
100
-        if($this->getLibOption('core.debug.on'))
100
+        if ($this->getLibOption('core.debug.on'))
101 101
         {
102 102
             $sLanguage = $this->getLibOption('core.language');
103 103
             $aJsFiles[] = "$sJsLibUri/jaxon.debug$sJsExtension";
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         // Check config options
118 118
         // - The js.app.export option must be set to true
119 119
         // - The js.app.uri and js.app.dir options must be set to non null values
120
-        if(!$this->getLibOption('js.app.export', false) ||
120
+        if (!$this->getLibOption('js.app.export', false) ||
121 121
             !$this->getLibOption('js.app.uri') || !$this->getLibOption('js.app.dir'))
122 122
         {
123 123
             return false;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $sJsFileName = $this->getLibOption('js.app.file') ?: $xCodeGenerator->getHash();
139 139
         $sJsDirectory = rtrim($this->getLibOption('js.app.dir'), '\/') . DIRECTORY_SEPARATOR;
140 140
         // - The js.app.dir must be writable
141
-        if(!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
141
+        if (!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
142 142
         {
143 143
             return '';
144 144
         }
@@ -147,16 +147,16 @@  discard block
 block discarded – undo
147 147
         $sJsMinFilePath = $sJsDirectory . $sJsFileName . '.min.js';
148 148
         $sJsFileUri = rtrim($this->getLibOption('js.app.uri'), '/') . "/$sJsFileName";
149 149
 
150
-        if(!is_file($sJsFilePath) &&
150
+        if (!is_file($sJsFilePath) &&
151 151
             !@file_put_contents($sJsFilePath, $xCodeGenerator->getJsScript()))
152 152
         {
153 153
             return '';
154 154
         }
155
-        if(!$this->getLibOption('js.app.minify', false))
155
+        if (!$this->getLibOption('js.app.minify', false))
156 156
         {
157 157
             return $sJsFileUri . '.js';
158 158
         }
159
-        if(!is_file($sJsMinFilePath) &&
159
+        if (!is_file($sJsMinFilePath) &&
160 160
             !$this->xMinifier->minify($sJsFilePath, $sJsMinFilePath))
161 161
         {
162 162
             // If the file cannot be minified, return the plain js file.
Please login to merge, or discard this patch.
Switch Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -26,142 +26,142 @@
 block discarded – undo
26 26
 
27 27
 class AssetManager
28 28
 {
29
-    use ConfigTrait;
29
+use ConfigTrait;
30 30
 
31
-    /**
31
+/**
32 32
      * Default library URL
33 33
      *
34 34
      * @var string
35 35
      */
36
-    const JS_LIB_URL = 'https://cdn.jsdelivr.net/gh/jaxon-php/[email protected]/dist';
36
+const JS_LIB_URL = 'https://cdn.jsdelivr.net/gh/jaxon-php/[email protected]/dist';
37 37
 
38
-    /**
38
+/**
39 39
      * The constructor
40 40
      *
41 41
      * @param ConfigManager $xConfigManager
42 42
      * @param MinifierInterface $xMinifier
43 43
      */
44
-    public function __construct(private ConfigManager $xConfigManager,
45
-        private MinifierInterface $xMinifier)
46
-    {}
44
+public function __construct(private ConfigManager $xConfigManager,
45
+private MinifierInterface $xMinifier)
46
+{}
47 47
 
48
-    /**
48
+/**
49 49
      * @return ConfigManager
50 50
      */
51
-    protected function config(): ConfigManager
52
-    {
53
-        return $this->xConfigManager;
54
-    }
51
+protected function config(): ConfigManager
52
+{
53
+return $this->xConfigManager;
54
+}
55 55
 
56
-    /**
56
+/**
57 57
      * Get app js options
58 58
      *
59 59
      * @return string
60 60
      */
61
-    public function getJsOptions(): string
62
-    {
63
-        return $this->getLibOption('js.app.options', '');
64
-    }
61
+public function getJsOptions(): string
62
+{
63
+return $this->getLibOption('js.app.options', '');
64
+}
65 65
 
66
-    /**
66
+/**
67 67
      * Check if the assets of this plugin shall be included in Jaxon generated code.
68 68
      *
69 69
      * @param AbstractPlugin $xPlugin
70 70
      *
71 71
      * @return bool
72 72
      */
73
-    public function shallIncludeAssets(AbstractPlugin $xPlugin): bool
74
-    {
75
-        $sPluginOptionName = 'assets.include.' . $xPlugin->getName();
76
-        if($this->hasLibOption($sPluginOptionName))
77
-        {
78
-            return $this->getLibOption($sPluginOptionName);
79
-        }
80
-        return $this->getLibOption('assets.include.all', true);
81
-    }
82
-
83
-    /**
73
+public function shallIncludeAssets(AbstractPlugin $xPlugin): bool
74
+{
75
+$sPluginOptionName = 'assets.include.' . $xPlugin->getName();
76
+if($this->hasLibOption($sPluginOptionName))
77
+{
78
+return $this->getLibOption($sPluginOptionName);
79
+}
80
+return $this->getLibOption('assets.include.all', true);
81
+}
82
+
83
+/**
84 84
      * Get the HTML tags to include Jaxon javascript files into the page
85 85
      *
86 86
      * @return array
87 87
      */
88
-    public function getJsLibFiles(): array
89
-    {
90
-        $sJsExtension = $this->getLibOption('js.app.minify') ? '.min.js' : '.js';
91
-        // The URI for the javascript library files
92
-        $sJsLibUri = $this->getLibOption('js.lib.uri', self::JS_LIB_URL);
93
-        $sJsLibUri = rtrim($sJsLibUri, '/');
94
-
95
-        // Add component files to the javascript file array;
96
-        $aJsFiles = [
97
-            $this->getLibOption('js.lib.jq', "$sJsLibUri/libs/chibi/chibi$sJsExtension"),
98
-            "$sJsLibUri/jaxon.core$sJsExtension",
99
-        ];
100
-        if($this->getLibOption('core.debug.on'))
101
-        {
102
-            $sLanguage = $this->getLibOption('core.language');
103
-            $aJsFiles[] = "$sJsLibUri/jaxon.debug$sJsExtension";
104
-            $aJsFiles[] = "$sJsLibUri/lang/jaxon.$sLanguage$sJsExtension";
105
-        }
106
-
107
-        return $aJsFiles;
108
-    }
109
-
110
-    /**
88
+public function getJsLibFiles(): array
89
+{
90
+$sJsExtension = $this->getLibOption('js.app.minify') ? '.min.js' : '.js';
91
+// The URI for the javascript library files
92
+$sJsLibUri = $this->getLibOption('js.lib.uri', self::JS_LIB_URL);
93
+$sJsLibUri = rtrim($sJsLibUri, '/');
94
+
95
+// Add component files to the javascript file array;
96
+$aJsFiles = [
97
+$this->getLibOption('js.lib.jq', "$sJsLibUri/libs/chibi/chibi$sJsExtension"),
98
+"$sJsLibUri/jaxon.core$sJsExtension",
99
+];
100
+if($this->getLibOption('core.debug.on'))
101
+{
102
+$sLanguage = $this->getLibOption('core.language');
103
+$aJsFiles[] = "$sJsLibUri/jaxon.debug$sJsExtension";
104
+$aJsFiles[] = "$sJsLibUri/lang/jaxon.$sLanguage$sJsExtension";
105
+}
106
+
107
+return $aJsFiles;
108
+}
109
+
110
+/**
111 111
      * Get the javascript file name
112 112
      *
113 113
      * @return bool
114 114
      */
115
-    public function shallCreateJsFiles(): bool
116
-    {
117
-        // Check config options
118
-        // - The js.app.export option must be set to true
119
-        // - The js.app.uri and js.app.dir options must be set to non null values
120
-        if(!$this->getLibOption('js.app.export', false) ||
121
-            !$this->getLibOption('js.app.uri') || !$this->getLibOption('js.app.dir'))
122
-        {
123
-            return false;
124
-        }
125
-        return true;
126
-    }
127
-
128
-    /**
115
+public function shallCreateJsFiles(): bool
116
+{
117
+// Check config options
118
+// - The js.app.export option must be set to true
119
+// - The js.app.uri and js.app.dir options must be set to non null values
120
+if(!$this->getLibOption('js.app.export', false) ||
121
+!$this->getLibOption('js.app.uri') || !$this->getLibOption('js.app.dir'))
122
+{
123
+return false;
124
+}
125
+return true;
126
+}
127
+
128
+/**
129 129
      * Write javascript files and return the corresponding URI
130 130
      *
131 131
      * @param CodeGenerator $xCodeGenerator
132 132
      *
133 133
      * @return string
134 134
      */
135
-    public function createJsFiles(CodeGenerator $xCodeGenerator): string
136
-    {
137
-        // Check dir access
138
-        $sJsFileName = $this->getLibOption('js.app.file') ?: $xCodeGenerator->getHash();
139
-        $sJsDirectory = rtrim($this->getLibOption('js.app.dir'), '\/') . DIRECTORY_SEPARATOR;
140
-        // - The js.app.dir must be writable
141
-        if(!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
142
-        {
143
-            return '';
144
-        }
145
-
146
-        $sJsFilePath = $sJsDirectory . $sJsFileName . '.js';
147
-        $sJsMinFilePath = $sJsDirectory . $sJsFileName . '.min.js';
148
-        $sJsFileUri = rtrim($this->getLibOption('js.app.uri'), '/') . "/$sJsFileName";
149
-
150
-        if(!is_file($sJsFilePath) &&
151
-            !@file_put_contents($sJsFilePath, $xCodeGenerator->getJsScript()))
152
-        {
153
-            return '';
154
-        }
155
-        if(!$this->getLibOption('js.app.minify', false))
156
-        {
157
-            return $sJsFileUri . '.js';
158
-        }
159
-        if(!is_file($sJsMinFilePath) &&
160
-            !$this->xMinifier->minify($sJsFilePath, $sJsMinFilePath))
161
-        {
162
-            // If the file cannot be minified, return the plain js file.
163
-            return $sJsFileUri . '.js';
164
-        }
165
-        return $sJsFileUri . '.min.js';
166
-    }
135
+public function createJsFiles(CodeGenerator $xCodeGenerator): string
136
+{
137
+// Check dir access
138
+$sJsFileName = $this->getLibOption('js.app.file') ?: $xCodeGenerator->getHash();
139
+$sJsDirectory = rtrim($this->getLibOption('js.app.dir'), '\/') . DIRECTORY_SEPARATOR;
140
+// - The js.app.dir must be writable
141
+if(!$sJsFileName || !is_dir($sJsDirectory) || !is_writable($sJsDirectory))
142
+{
143
+return '';
144
+}
145
+
146
+$sJsFilePath = $sJsDirectory . $sJsFileName . '.js';
147
+$sJsMinFilePath = $sJsDirectory . $sJsFileName . '.min.js';
148
+$sJsFileUri = rtrim($this->getLibOption('js.app.uri'), '/') . "/$sJsFileName";
149
+
150
+if(!is_file($sJsFilePath) &&
151
+!@file_put_contents($sJsFilePath, $xCodeGenerator->getJsScript()))
152
+{
153
+return '';
154
+}
155
+if(!$this->getLibOption('js.app.minify', false))
156
+{
157
+return $sJsFileUri . '.js';
158
+}
159
+if(!is_file($sJsMinFilePath) &&
160
+!$this->xMinifier->minify($sJsFilePath, $sJsMinFilePath))
161
+{
162
+// If the file cannot be minified, return the plain js file.
163
+return $sJsFileUri . '.js';
164
+}
165
+return $sJsFileUri . '.min.js';
166
+}
167 167
 }
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Request/CallableClass/SortedFileIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public function __construct(string $sDirectory)
29 29
     {
30 30
         $itFile = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sDirectory));
31
-        foreach($itFile as $xFile)
31
+        foreach ($itFile as $xFile)
32 32
         {
33 33
             $this->insert($xFile);
34 34
         }
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Request/CallableClass/CallableDirPlugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     private function checkDirectory(string $sDirectory): string
69 69
     {
70 70
         $sDirectory = rtrim(trim($sDirectory), '/\\');
71
-        if(!is_dir($sDirectory))
71
+        if (!is_dir($sDirectory))
72 72
         {
73 73
             throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration'));
74 74
         }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function checkOptions(string $sCallable, $xOptions): array
83 83
     {
84
-        if(is_string($xOptions))
84
+        if (is_string($xOptions))
85 85
         {
86 86
             $xOptions = ['namespace' => $xOptions];
87 87
         }
88
-        if(!is_array($xOptions))
88
+        if (!is_array($xOptions))
89 89
         {
90 90
             throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration'));
91 91
         }
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
         $xOptions['directory'] = $this->checkDirectory($sCallable);
94 94
         // Check the namespace
95 95
         $sNamespace = $xOptions['namespace'] ?? '';
96
-        if(!($xOptions['namespace'] = trim($sNamespace, ' \\')))
96
+        if (!($xOptions['namespace'] = trim($sNamespace, ' \\')))
97 97
         {
98 98
             $xOptions['namespace'] = '';
99 99
         }
100 100
 
101 101
         // Change the keys in $xOptions to have "\" as separator
102 102
         $_aOptions = [];
103
-        foreach($xOptions as $sName => $aOption)
103
+        foreach ($xOptions as $sName => $aOption)
104 104
         {
105 105
             $sName = trim(str_replace('.', '\\', $sName), ' \\');
106 106
             $_aOptions[$sName] = $aOption;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     public function register(string $sType, string $sCallable, array $aOptions): bool
115 115
     {
116 116
         // The $sCallable var is not used here because the checkOptions() method copied it into the $aOptions array.
117
-        if(($aOptions['namespace']))
117
+        if (($aOptions['namespace']))
118 118
         {
119 119
             $this->xRegistry->registerNamespace($aOptions['namespace'], $aOptions);
120 120
             return true;
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Request/CallableFunction/CallableFunction.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function configure(string $sName, string $sValue): void
106 106
     {
107
-        switch($sName)
107
+        switch ($sName)
108 108
         {
109 109
         case 'class': // The user function is a method in the given class
110 110
             $this->xPhpFunction = [$sValue, $this->xPhpFunction];
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function call(array $aArgs = []): void
130 130
     {
131
-        if($this->sInclude !== '')
131
+        if ($this->sInclude !== '')
132 132
         {
133 133
             require_once $this->sInclude;
134 134
         }
135 135
         // If the function is an alias for a class method, then instantiate the class
136
-        if(is_array($this->xPhpFunction) && is_string($this->xPhpFunction[0]))
136
+        if (is_array($this->xPhpFunction) && is_string($this->xPhpFunction[0]))
137 137
         {
138 138
             $sClassName = $this->xPhpFunction[0];
139 139
             $this->xPhpFunction[0] = $this->di->h($sClassName) ?
Please login to merge, or discard this patch.
jaxon-core/src/Plugin/Request/CallableFunction/CallableFunctionPlugin.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@  discard block
 block discarded – undo
92 92
         if(is_string($xOptions))
93 93
         {
94 94
             $xOptions = ['include' => $xOptions];
95
-        }
96
-        elseif(!is_array($xOptions))
95
+        } elseif(!is_array($xOptions))
97 96
         {
98 97
             throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration'));
99 98
         }
@@ -236,8 +235,7 @@  discard block
 block discarded – undo
236 235
         {
237 236
             /** @var CallableFunction */
238 237
             $xFunction = $this->getCallable($sRequestedFunction);
239
-        }
240
-        catch(Exception $e)
238
+        } catch(Exception $e)
241 239
         {
242 240
             // Unable to find the requested function
243 241
             $this->throwException($e, $this->xTranslator->trans('errors.functions.invalid',
@@ -246,8 +244,7 @@  discard block
 block discarded – undo
246 244
         try
247 245
         {
248 246
             $xFunction->call($this->xTarget->args());
249
-        }
250
-        catch(Exception $e)
247
+        } catch(Exception $e)
251 248
         {
252 249
             // Unable to execute the requested function
253 250
             $this->throwException($e, $this->xTranslator->trans('errors.functions.call',
Please login to merge, or discard this patch.
Spacing   +13 added lines, -15 removed lines patch added patch discarded remove patch
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function checkOptions(string $sCallable, $xOptions): array
88 88
     {
89
-        if(!$this->xValidator->validateFunction(trim($sCallable)))
89
+        if (!$this->xValidator->validateFunction(trim($sCallable)))
90 90
         {
91 91
             throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration'));
92 92
         }
93
-        if(is_string($xOptions))
93
+        if (is_string($xOptions))
94 94
         {
95 95
             $xOptions = ['include' => $xOptions];
96 96
         }
97
-        elseif(!is_array($xOptions))
97
+        elseif (!is_array($xOptions))
98 98
         {
99 99
             throw new SetupException($this->xTranslator->trans('errors.objects.invalid-declaration'));
100 100
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $sPhpFunction = trim($sCallable);
116 116
         $sFunction = $sPhpFunction;
117 117
         // Check if an alias is defined
118
-        if(isset($aOptions['alias']))
118
+        if (isset($aOptions['alias']))
119 119
         {
120 120
             $sFunction = (string)$aOptions['alias'];
121 121
             unset($aOptions['alias']);
@@ -139,13 +139,13 @@  discard block
 block discarded – undo
139 139
     public function getCallable(string $sCallable): CallableFunction|null
140 140
     {
141 141
         $sFunction = trim($sCallable);
142
-        if(!isset($this->aFunctions[$sFunction]))
142
+        if (!isset($this->aFunctions[$sFunction]))
143 143
         {
144 144
             return null;
145 145
         }
146 146
         $xCallable = new CallableFunction($this->di, $sFunction,
147 147
             $this->sPrefix . $sFunction, $this->aFunctions[$sFunction]);
148
-        foreach($this->aOptions[$sFunction] as $sName => $sValue)
148
+        foreach ($this->aOptions[$sFunction] as $sName => $sValue)
149 149
         {
150 150
             $xCallable->configure($sName, $sValue);
151 151
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     private function getCallableScript(CallableFunction $xFunction): string
163 163
     {
164 164
         $aOptions = [];
165
-        foreach($xFunction->getOptions() as $sKey => $sValue)
165
+        foreach ($xFunction->getOptions() as $sKey => $sValue)
166 166
         {
167 167
             $aOptions[] = "$sKey: $sValue";
168 168
         }
@@ -170,8 +170,7 @@  discard block
 block discarded – undo
170 170
         return $this->xTemplateEngine->render('jaxon::callables/function.js', [
171 171
             'sName' => $xFunction->getName(),
172 172
             'sJsName' => $xFunction->getJsName(),
173
-            'sArguments' => count($aOptions) === 0 ? 'args' :
174
-                'args, { ' . implode(',', $aOptions) . ' }',
173
+            'sArguments' => count($aOptions) === 0 ? 'args' : 'args, { ' . implode(',', $aOptions) . ' }',
175 174
         ]);
176 175
     }
177 176
 
@@ -181,7 +180,7 @@  discard block
 block discarded – undo
181 180
     public function getScript(): string
182 181
     {
183 182
         $code = '';
184
-        foreach(array_keys($this->aFunctions) as $sFunction)
183
+        foreach (array_keys($this->aFunctions) as $sFunction)
185 184
         {
186 185
             $xFunction = $this->getCallable($sFunction);
187 186
             $code .= $this->getCallableScript($xFunction);
@@ -219,8 +218,7 @@  discard block
 block discarded – undo
219 218
     private function throwException(Exception $xException, string $sErrorMessage): void
220 219
     {
221 220
         $this->di->getLogger()->error($xException->getMessage());
222
-        throw new RequestException($sErrorMessage . (!$this->bDebug ? '' :
223
-            "\n" . $xException->getMessage()));
221
+        throw new RequestException($sErrorMessage . (!$this->bDebug ? '' : "\n" . $xException->getMessage()));
224 222
     }
225 223
 
226 224
     /**
@@ -232,7 +230,7 @@  discard block
 block discarded – undo
232 230
         $sRequestedFunction = $this->xTarget->getFunctionName();
233 231
 
234 232
         // Security check: make sure the requested function was registered.
235
-        if(!$this->xValidator->validateFunction($sRequestedFunction) ||
233
+        if (!$this->xValidator->validateFunction($sRequestedFunction) ||
236 234
             !isset($this->aFunctions[$sRequestedFunction]))
237 235
         {
238 236
             // Unable to find the requested function
@@ -245,7 +243,7 @@  discard block
 block discarded – undo
245 243
             /** @var CallableFunction */
246 244
             $xFunction = $this->getCallable($sRequestedFunction);
247 245
         }
248
-        catch(Exception $e)
246
+        catch (Exception $e)
249 247
         {
250 248
             // Unable to find the requested function
251 249
             $this->throwException($e, $this->xTranslator->trans('errors.functions.invalid',
@@ -255,7 +253,7 @@  discard block
 block discarded – undo
255 253
         {
256 254
             $xFunction->call($this->xTarget->args());
257 255
         }
258
-        catch(Exception $e)
256
+        catch (Exception $e)
259 257
         {
260 258
             // Unable to execute the requested function
261 259
             $this->throwException($e, $this->xTranslator->trans('errors.functions.call',
Please login to merge, or discard this patch.
jaxon-core/src/App/I18n/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function onChange(Config $xConfig, string $sName): void
27 27
     {
28 28
         // Set the library language any time the config is changed.
29
-        if($sName === '' || $sName === 'core.language')
29
+        if ($sName === '' || $sName === 'core.language')
30 30
         {
31 31
             $this->setLocale($xConfig->getOption('core.language'));
32 32
         }
Please login to merge, or discard this patch.