Passed
Push — main ( c6b105...31af8b )
by Thierry
07:02
created
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.
jaxon-core/src/App/Stash/Stash.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function get(string $key, mixed $default = null): mixed
32 32
     {
33 33
         $value = $this->values[$key] ?? $default;
34
-        if(is_callable($value))
34
+        if (is_callable($value))
35 35
         {
36 36
             $value = $value();
37 37
             // Save the value returned by the callback in the stash.
Please login to merge, or discard this patch.
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,38 +6,38 @@
 block discarded – undo
6 6
 
7 7
 class Stash
8 8
 {
9
-    /**
9
+/**
10 10
      * @var array
11 11
      */
12
-    private array $values = [];
12
+private array $values = [];
13 13
 
14
-    /**
14
+/**
15 15
      * @param string $key
16 16
      * @param mixed $value
17 17
      *
18 18
      * @return void
19 19
      */
20
-    public function set(string $key, mixed $value): void
21
-    {
22
-        $this->values[$key] = $value;
23
-    }
20
+public function set(string $key, mixed $value): void
21
+{
22
+$this->values[$key] = $value;
23
+}
24 24
 
25
-    /**
25
+/**
26 26
      * @param string $key
27 27
      * @param mixed $default
28 28
      *
29 29
      * @return mixed
30 30
      */
31
-    public function get(string $key, mixed $default = null): mixed
32
-    {
33
-        $value = $this->values[$key] ?? $default;
34
-        if(is_callable($value))
35
-        {
36
-            $value = $value();
37
-            // Save the value returned by the callback in the stash.
38
-            $this->values[$key] = $value;
39
-        }
31
+public function get(string $key, mixed $default = null): mixed
32
+{
33
+$value = $this->values[$key] ?? $default;
34
+if(is_callable($value))
35
+{
36
+$value = $value();
37
+// Save the value returned by the callback in the stash.
38
+$this->values[$key] = $value;
39
+}
40 40
 
41
-        return $value;
42
-    }
41
+return $value;
42
+}
43 43
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Ajax/Bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
             'export' => $bExport,
92 92
             'minify' => $bMinify,
93 93
         ];
94
-        if($sUri !== '')
94
+        if ($sUri !== '')
95 95
         {
96 96
             $aJsOptions['uri'] = $sUri;
97 97
         }
98
-        if($sDir !== '')
98
+        if ($sDir !== '')
99 99
         {
100 100
             $aJsOptions['dir'] = $sDir;
101 101
         }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         // Popping the callbacks makes each of them to be called once.
153 153
         $aBootCallbacks = $this->xCallbackManager->popBootCallbacks();
154
-        foreach($aBootCallbacks as $aBootCallback)
154
+        foreach ($aBootCallbacks as $aBootCallback)
155 155
         {
156 156
             call_user_func($aBootCallback);
157 157
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Ajax/App.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function setup(string $sConfigFile = ''): void
31 31
     {
32
-        if(!file_exists($sConfigFile))
32
+        if (!file_exists($sConfigFile))
33 33
         {
34 34
             throw new SetupException($this->translator()
35 35
                 ->trans('errors.file.access', ['path' => $sConfigFile]));
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
         $aOptions = $this->config()->read($sConfigFile);
40 40
         $aLibOptions = $aOptions['lib'] ?? [];
41 41
         $aAppOptions = $aOptions['app'] ?? [];
42
-        if(!is_array($aLibOptions) || !is_array($aAppOptions))
42
+        if (!is_array($aLibOptions) || !is_array($aAppOptions))
43 43
         {
44 44
             throw new SetupException($sMessage = $this->translator()
45 45
                 ->trans('errors.file.content', ['path' => $sConfigFile]));
46 46
         }
47 47
 
48 48
         // The bootstrap set this to false. It needs to be changed.
49
-        if(!isset($aLibOptions['core']['response']['send']))
49
+        if (!isset($aLibOptions['core']['response']['send']))
50 50
         {
51 51
             $aLibOptions['core']['response']['send'] = true;
52 52
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Ajax/Traits/SendResponseTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,20 +59,20 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function httpResponse(string $sCode = '200'): mixed
61 61
     {
62
-        if(!$this->config()->getOption('core.response.send', false))
62
+        if (!$this->config()->getOption('core.response.send', false))
63 63
         {
64 64
             return null;
65 65
         }
66 66
 
67 67
         // Check to see if headers have already been sent out, in which case we can't do our job
68
-        if(headers_sent($sFilename, $nLineNumber))
68
+        if (headers_sent($sFilename, $nLineNumber))
69 69
         {
70 70
             throw new RequestException($this->translator()
71 71
                 ->trans('errors.output.already-sent', [
72 72
                     'location' => "$sFilename:$nLineNumber",
73 73
                 ]) . "\n" . $this->translator()->trans('errors.output.advice'));
74 74
         }
75
-        if(empty($sContent = $this->getResponseManager()->getOutput()))
75
+        if (empty($sContent = $this->getResponseManager()->getOutput()))
76 76
         {
77 77
             return null;
78 78
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         // Set the HTTP response code
81 81
         http_response_code(intval($sCode));
82 82
 
83
-        if($this->di()->getRequest()->getMethod() === 'GET')
83
+        if ($this->di()->getRequest()->getMethod() === 'GET')
84 84
         {
85 85
             header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
86 86
             header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         header('Content-Type: ' . $this->getResponseManager()->getContentType());
91 91
 
92 92
         print $sContent;
93
-        if($this->config()->getOption('core.process.exit', false))
93
+        if ($this->config()->getOption('core.process.exit', false))
94 94
         {
95 95
             exit();
96 96
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Config/ConfigManager.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -70,22 +70,22 @@  discard block
 block discarded – undo
70 70
         {
71 71
             return $this->xConfigReader->read($sConfigFile);
72 72
         }
73
-        catch(YamlExtension $e)
73
+        catch (YamlExtension $e)
74 74
         {
75 75
             $sMessage = $this->xTranslator->trans('errors.yaml.install');
76 76
             throw new SetupException($sMessage);
77 77
         }
78
-        catch(FileExtension $e)
78
+        catch (FileExtension $e)
79 79
         {
80 80
             $sMessage = $this->xTranslator->trans('errors.file.extension', ['path' => $sConfigFile]);
81 81
             throw new SetupException($sMessage);
82 82
         }
83
-        catch(FileAccess $e)
83
+        catch (FileAccess $e)
84 84
         {
85 85
             $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]);
86 86
             throw new SetupException($sMessage);
87 87
         }
88
-        catch(FileContent $e)
88
+        catch (FileContent $e)
89 89
         {
90 90
             $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]);
91 91
             throw new SetupException($sMessage);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             // Call the config change listeners.
112 112
             $this->xEventManager->libConfigChanged($this->xLibConfig, '');
113 113
         }
114
-        catch(DataDepth $e)
114
+        catch (DataDepth $e)
115 115
         {
116 116
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
117 117
                 'key' => $e->sPrefix,
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             $this->xEventManager->libConfigChanged($this->xLibConfig, '');
141 141
             return $this->xLibConfig->changed();
142 142
         }
143
-        catch(DataDepth $e)
143
+        catch (DataDepth $e)
144 144
         {
145 145
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
146 146
                 'key' => $e->sPrefix,
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             $this->xEventManager->appConfigChanged($this->xAppConfig, '');
248 248
             return $this->xAppConfig->changed();
249 249
         }
250
-        catch(DataDepth $e)
250
+        catch (DataDepth $e)
251 251
         {
252 252
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
253 253
                 'key' => $e->sPrefix,
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         {
298 298
             return $this->xConfigSetter->newConfig($aOptions, $sNamePrefix);
299 299
         }
300
-        catch(DataDepth $e)
300
+        catch (DataDepth $e)
301 301
         {
302 302
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
303 303
                 'key' => $e->sPrefix,
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     public function globals(bool $bForce = false): void
338 338
     {
339
-        if($bForce || $this->getAppOption('helpers.global', true))
339
+        if ($bForce || $this->getAppOption('helpers.global', true))
340 340
         {
341 341
             require_once dirname(__DIR__, 2) . '/globals.php';
342 342
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -69,23 +69,19 @@  discard block
 block discarded – undo
69 69
         try
70 70
         {
71 71
             return $this->xConfigReader->read($sConfigFile);
72
-        }
73
-        catch(YamlExtension $e)
72
+        } catch(YamlExtension $e)
74 73
         {
75 74
             $sMessage = $this->xTranslator->trans('errors.yaml.install');
76 75
             throw new SetupException($sMessage);
77
-        }
78
-        catch(FileExtension $e)
76
+        } catch(FileExtension $e)
79 77
         {
80 78
             $sMessage = $this->xTranslator->trans('errors.file.extension', ['path' => $sConfigFile]);
81 79
             throw new SetupException($sMessage);
82
-        }
83
-        catch(FileAccess $e)
80
+        } catch(FileAccess $e)
84 81
         {
85 82
             $sMessage = $this->xTranslator->trans('errors.file.access', ['path' => $sConfigFile]);
86 83
             throw new SetupException($sMessage);
87
-        }
88
-        catch(FileContent $e)
84
+        } catch(FileContent $e)
89 85
         {
90 86
             $sMessage = $this->xTranslator->trans('errors.file.content', ['path' => $sConfigFile]);
91 87
             throw new SetupException($sMessage);
@@ -110,8 +106,7 @@  discard block
 block discarded – undo
110 106
                 ->setOptions($this->xLibConfig, $this->read($sConfigFile), $sConfigSection);
111 107
             // Call the config change listeners.
112 108
             $this->xEventManager->libConfigChanged($this->xLibConfig, '');
113
-        }
114
-        catch(DataDepth $e)
109
+        } catch(DataDepth $e)
115 110
         {
116 111
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
117 112
                 'key' => $e->sPrefix,
@@ -139,8 +134,7 @@  discard block
 block discarded – undo
139 134
             // Call the config change listeners.
140 135
             $this->xEventManager->libConfigChanged($this->xLibConfig, '');
141 136
             return $this->xLibConfig->changed();
142
-        }
143
-        catch(DataDepth $e)
137
+        } catch(DataDepth $e)
144 138
         {
145 139
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
146 140
                 'key' => $e->sPrefix,
@@ -246,8 +240,7 @@  discard block
 block discarded – undo
246 240
             // Call the config change listeners.
247 241
             $this->xEventManager->appConfigChanged($this->xAppConfig, '');
248 242
             return $this->xAppConfig->changed();
249
-        }
250
-        catch(DataDepth $e)
243
+        } catch(DataDepth $e)
251 244
         {
252 245
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
253 246
                 'key' => $e->sPrefix,
@@ -296,8 +289,7 @@  discard block
 block discarded – undo
296 289
         try
297 290
         {
298 291
             return $this->xConfigSetter->newConfig($aOptions, $sNamePrefix);
299
-        }
300
-        catch(DataDepth $e)
292
+        } catch(DataDepth $e)
301 293
         {
302 294
             $sMessage = $this->xTranslator->trans('errors.data.depth', [
303 295
                 'key' => $e->sPrefix,
Please login to merge, or discard this patch.
jaxon-core/src/App/Config/ConfigEventManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function libConfigChanged(Config $xConfig, string $sName): void
62 62
     {
63
-        foreach($this->aLibConfigListeners as $sListener)
63
+        foreach ($this->aLibConfigListeners as $sListener)
64 64
         {
65 65
             $this->di->g($sListener)->onChange($xConfig, $sName);
66 66
         }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function appConfigChanged(Config $xConfig, string $sName): void
73 73
     {
74
-        foreach($this->aAppConfigListeners as $sListener)
74
+        foreach ($this->aAppConfigListeners as $sListener)
75 75
         {
76 76
             $this->di->g($sListener)->onChange($xConfig, $sName);
77 77
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/UploadData.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     protected function validateField(string $sField): void
53 53
     {
54
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
54
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
55 55
         {
56 56
             return;
57 57
         }
Please login to merge, or discard this patch.
Switch Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -20,63 +20,63 @@
 block discarded – undo
20 20
 
21 21
 class UploadData extends AbstractData
22 22
 {
23
-    /**
23
+/**
24 24
      * The id of the upload field
25 25
      *
26 26
      * @var string
27 27
      */
28
-    protected $sField = '';
28
+protected $sField = '';
29 29
 
30
-    /**
30
+/**
31 31
      * @return string
32 32
      */
33
-    public function getName(): string
34
-    {
35
-        return 'upload';
36
-    }
33
+public function getName(): string
34
+{
35
+return 'upload';
36
+}
37 37
 
38
-    /**
38
+/**
39 39
      * @return mixed
40 40
      */
41
-    public function getValue(): mixed
42
-    {
43
-        // The field id is surrounded with simple quotes.
44
-        return "'{$this->sField}'";
45
-    }
41
+public function getValue(): mixed
42
+{
43
+// The field id is surrounded with simple quotes.
44
+return "'{$this->sField}'";
45
+}
46 46
 
47
-    /**
47
+/**
48 48
      * @param string $sField
49 49
      *
50 50
      * @return void
51 51
      */
52
-    protected function validateField(string $sField): void
53
-    {
54
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
55
-        {
56
-            return;
57
-        }
58
-        throw new SetupException("$sField is not a valid \"field\" value for upload");
59
-    }
52
+protected function validateField(string $sField): void
53
+{
54
+if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
55
+{
56
+return;
57
+}
58
+throw new SetupException("$sField is not a valid \"field\" value for upload");
59
+}
60 60
 
61
-    /**
61
+/**
62 62
      * @param string $sField
63 63
      *
64 64
      * @return void
65 65
      */
66
-    public function setValue(string $sField): void
67
-    {
68
-        $this->validateField($sField);
66
+public function setValue(string $sField): void
67
+{
68
+$this->validateField($sField);
69 69
 
70
-        $this->sField = $sField;
71
-    }
70
+$this->sField = $sField;
71
+}
72 72
 
73
-    /**
73
+/**
74 74
      * @inheritDoc
75 75
      */
76
-    public function encode(string $sVarName): array
77
-    {
78
-        return [
79
-            "{$sVarName}->setValue('{$this->sField}');",
80
-        ];
81
-    }
76
+public function encode(string $sVarName): array
77
+{
78
+return [
79
+"{$sVarName}->setValue('{$this->sField}');",
80
+];
81
+}
82 82
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/CallbackData.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
      */
51 51
     protected function validateObjectName(string $sName): void
52 52
     {
53
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
53
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
54 54
         {
55 55
             return;
56 56
         }
Please login to merge, or discard this patch.
Switch Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,60 +21,60 @@
 block discarded – undo
21 21
 
22 22
 class CallbackData extends AbstractData
23 23
 {
24
-    /**
24
+/**
25 25
      * The callback js objects
26 26
      *
27 27
      * @var string
28 28
      */
29
-    protected $aNames = [];
29
+protected $aNames = [];
30 30
 
31
-    /**
31
+/**
32 32
      * @return string
33 33
      */
34
-    public function getName(): string
35
-    {
36
-        return 'callback';
37
-    }
34
+public function getName(): string
35
+{
36
+return 'callback';
37
+}
38 38
 
39
-    /**
39
+/**
40 40
      * @return mixed
41 41
      */
42
-    public function getValue(): mixed
43
-    {
44
-        return $this->aNames;
45
-    }
42
+public function getValue(): mixed
43
+{
44
+return $this->aNames;
45
+}
46 46
 
47
-    /**
47
+/**
48 48
      * @param string $sName
49 49
      *
50 50
      * @return void
51 51
      */
52
-    protected function validateObjectName(string $sName): void
53
-    {
54
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
55
-        {
56
-            return;
57
-        }
58
-        throw new SetupException("$sName is not a valid \"name\" value for callback");
59
-    }
52
+protected function validateObjectName(string $sName): void
53
+{
54
+if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
55
+{
56
+return;
57
+}
58
+throw new SetupException("$sName is not a valid \"name\" value for callback");
59
+}
60 60
 
61
-    /**
61
+/**
62 62
      * @param string $sName
63 63
      *
64 64
      * @return void
65 65
      */
66
-    public function addValue(string $sName): void
67
-    {
68
-        $this->validateObjectName($sName);
66
+public function addValue(string $sName): void
67
+{
68
+$this->validateObjectName($sName);
69 69
 
70
-        $this->aNames[] = $sName;
71
-    }
70
+$this->aNames[] = $sName;
71
+}
72 72
 
73
-    /**
73
+/**
74 74
      * @inheritDoc
75 75
      */
76
-    public function encode(string $sVarName): array
77
-    {
78
-        return array_map(fn($sName) => "{$sVarName}->addValue('$sName');", $this->aNames);
79
-    }
76
+public function encode(string $sVarName): array
77
+{
78
+return array_map(fn($sName) => "{$sVarName}->addValue('$sName');", $this->aNames);
79
+}
80 80
 }
Please login to merge, or discard this patch.