Passed
Push — main ( 87fed9...27211a )
by Thierry
04:04
created
jaxon-core/src/App/Pagination/RendererInterface.php 1 patch
Switch Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 interface RendererInterface
18 18
 {
19
-    /**
19
+/**
20 20
      * Render an array of pagination links
21 21
      *
22 22
      * @param Page[] $aPages
@@ -25,5 +25,5 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return string
27 27
      */
28
-    public function render(array $aPages, Page $xPrevPage, Page $xNextPage): string;
28
+public function render(array $aPages, Page $xPrevPage, Page $xNextPage): string;
29 29
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Pagination/Renderer.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,30 +21,30 @@  discard block
 block discarded – undo
21 21
 
22 22
 class Renderer implements RendererInterface
23 23
 {
24
-    /**
24
+/**
25 25
      * The constructor.
26 26
      *
27 27
      * @param ViewRenderer $xRenderer
28 28
      */
29
-    public function __construct(private ViewRenderer $xRenderer)
30
-    {
31
-        $this->xRenderer = $xRenderer;
32
-    }
29
+public function __construct(private ViewRenderer $xRenderer)
30
+{
31
+$this->xRenderer = $xRenderer;
32
+}
33 33
 
34
-    /**
34
+/**
35 35
      * @param Page $xPage
36 36
      *
37 37
      * @return string
38 38
      */
39
-    private function renderPage(Page $xPage): string
40
-    {
41
-        return $this->xRenderer->render("pagination::links/{$xPage->sType}", [
42
-            'page' => $xPage->nNumber,
43
-            'text' => $xPage->sText,
44
-        ])->__toString();
45
-    }
39
+private function renderPage(Page $xPage): string
40
+{
41
+return $this->xRenderer->render("pagination::links/{$xPage->sType}", [
42
+'page' => $xPage->nNumber,
43
+'text' => $xPage->sText,
44
+])->__toString();
45
+}
46 46
 
47
-    /**
47
+/**
48 48
      * Render an array of pagination links
49 49
      *
50 50
      * @param Page[] $aPages
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @return string
55 55
      */
56
-    public function render(array $aPages, Page $xPrevPage, Page $xNextPage): string
57
-    {
58
-        return trim($this->xRenderer->render('pagination::wrapper', [
59
-            'links' => array_map(fn($xPage) => $this->renderPage($xPage), $aPages),
60
-            'prev' => $this->renderPage($xPrevPage),
61
-            'next' => $this->renderPage($xNextPage),
62
-        ])->__toString());
63
-    }
56
+public function render(array $aPages, Page $xPrevPage, Page $xNextPage): string
57
+{
58
+return trim($this->xRenderer->render('pagination::wrapper', [
59
+'links' => array_map(fn($xPage) => $this->renderPage($xPage), $aPages),
60
+'prev' => $this->renderPage($xPrevPage),
61
+'next' => $this->renderPage($xNextPage),
62
+])->__toString());
63
+}
64 64
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Pagination/Page.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,25 +13,25 @@
 block discarded – undo
13 13
 
14 14
 class Page
15 15
 {
16
-    /**
16
+/**
17 17
      * @var string
18 18
      */
19
-    public $sType;
19
+public $sType;
20 20
 
21
-    /**
21
+/**
22 22
      * @var string
23 23
      */
24
-    public $sText;
24
+public $sText;
25 25
 
26
-    /**
26
+/**
27 27
      * @var string
28 28
      */
29
-    public $nNumber;
29
+public $nNumber;
30 30
 
31
-    public function __construct(string $sType, string $sText, int $nNumber)
32
-    {
33
-        $this->sType = $sType;
34
-        $this->sText = $sText;
35
-        $this->nNumber = $nNumber;
36
-    }
31
+public function __construct(string $sType, string $sText, int $nNumber)
32
+{
33
+$this->sType = $sType;
34
+$this->sText = $sText;
35
+$this->nNumber = $nNumber;
36
+}
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
jaxon-core/src/App/NodeComponent.php 1 patch
Switch Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -8,71 +8,71 @@
 block discarded – undo
8 8
 
9 9
 abstract class NodeComponent extends Component\AbstractComponent
10 10
 {
11
-    use Component\HelperTrait;
12
-    use Component\NodeResponseTrait;
13
-    use Component\AjaxResponseTrait;
14
-    use Component\ComponentTrait;
11
+use Component\HelperTrait;
12
+use Component\NodeResponseTrait;
13
+use Component\AjaxResponseTrait;
14
+use Component\ComponentTrait;
15 15
 
16
-    /**
16
+/**
17 17
      * @inheritDoc
18 18
      */
19
-    final protected function initComponent(Container $di, ComponentHelper $xHelper): void
20
-    {
21
-        $this->setHelper($xHelper);
22
-        $this->setNodeResponse($di);
23
-        $this->setAjaxResponse($di);
24
-    }
19
+final protected function initComponent(Container $di, ComponentHelper $xHelper): void
20
+{
21
+$this->setHelper($xHelper);
22
+$this->setNodeResponse($di);
23
+$this->setAjaxResponse($di);
24
+}
25 25
 
26
-    /**
26
+/**
27 27
      * @return string|Stringable
28 28
      */
29
-    abstract public function html(): string|Stringable;
29
+abstract public function html(): string|Stringable;
30 30
 
31
-    /**
31
+/**
32 32
      * Called before rendering the component.
33 33
      *
34 34
      * @return void
35 35
      */
36
-    protected function before(): void
37
-    {}
36
+protected function before(): void
37
+{}
38 38
 
39
-    /**
39
+/**
40 40
      * Called after rendering the component.
41 41
      *
42 42
      * @return void
43 43
      */
44
-    protected function after(): void
45
-    {}
44
+protected function after(): void
45
+{}
46 46
 
47
-    /**
47
+/**
48 48
      * Set the attached DOM node content with the component HTML code.
49 49
      *
50 50
      * @return void
51 51
      */
52
-    final public function render(): void
53
-    {
54
-        $this->before();
55
-        $this->node()->html((string)$this->html());
56
-        $this->after();
57
-    }
52
+final public function render(): void
53
+{
54
+$this->before();
55
+$this->node()->html((string)$this->html());
56
+$this->after();
57
+}
58 58
 
59
-    /**
59
+/**
60 60
      * Clear the attached DOM node content.
61 61
      *
62 62
      * @return void
63 63
      */
64
-    final public function clear(): void
65
-    {
66
-        $this->node()->clear();
67
-    }
64
+final public function clear(): void
65
+{
66
+$this->node()->clear();
67
+}
68 68
 
69
-    /**
69
+/**
70 70
      * Show/hide the attached DOM node.
71 71
      *
72 72
      * @return void
73 73
      */
74
-    final public function visible(bool $bVisible): void
75
-    {
76
-        $bVisible ? $this->node()->jq()->show() : $this->node()->jq()->hide();
77
-    }
74
+final public function visible(bool $bVisible): void
75
+{
76
+$bVisible ? $this->node()->jq()->show() : $this->node()->jq()->hide();
77
+}
78 78
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Config/ConfigListenerInterface.php 1 patch
Switch Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 interface ConfigListenerInterface
20 20
 {
21
-    /**
21
+/**
22 22
      * Config option changed, in case of multiple changes, the name is an empty string
23 23
      *
24 24
      * @param Config $xConfig
@@ -26,5 +26,5 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @return void
28 28
      */
29
-    public function onChange(Config $xConfig, string $sName): void;
29
+public function onChange(Config $xConfig, string $sName): void;
30 30
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Config/ConfigTrait.php 1 patch
Switch Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 
17 17
 trait ConfigTrait
18 18
 {
19
-    /**
19
+/**
20 20
      * @return ConfigManager
21 21
      */
22
-    abstract protected function config(): ConfigManager;
22
+abstract protected function config(): ConfigManager;
23 23
 
24
-    /**
24
+/**
25 25
      * Get the value of a config option
26 26
      *
27 27
      * @param string $sName The option name
@@ -29,24 +29,24 @@  discard block
 block discarded – undo
29 29
      *
30 30
      * @return mixed
31 31
      */
32
-    public function getLibOption(string $sName, $xDefault = null): mixed
33
-    {
34
-        return $this->config()->getOption($sName, $xDefault);
35
-    }
32
+public function getLibOption(string $sName, $xDefault = null): mixed
33
+{
34
+return $this->config()->getOption($sName, $xDefault);
35
+}
36 36
 
37
-    /**
37
+/**
38 38
      * Check the presence of a config option
39 39
      *
40 40
      * @param string $sName The option name
41 41
      *
42 42
      * @return bool
43 43
      */
44
-    public function hasLibOption(string $sName): bool
45
-    {
46
-        return $this->config()->hasOption($sName);
47
-    }
44
+public function hasLibOption(string $sName): bool
45
+{
46
+return $this->config()->hasOption($sName);
47
+}
48 48
 
49
-    /**
49
+/**
50 50
      * Set the value of a config option
51 51
      *
52 52
      * @param string $sName The option name
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
      *
55 55
      * @return void
56 56
      */
57
-    public function setLibOption(string $sName, $xValue): void
58
-    {
59
-        $this->config()->setOption($sName, $xValue);
60
-    }
57
+public function setLibOption(string $sName, $xValue): void
58
+{
59
+$this->config()->setOption($sName, $xValue);
60
+}
61 61
 
62
-    /**
62
+/**
63 63
      * Get the value of an application config option
64 64
      *
65 65
      * @param string $sName The option name
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @return mixed
69 69
      */
70
-    public function getAppOption(string $sName, $xDefault = null): mixed
71
-    {
72
-        return $this->config()->getAppOption($sName, $xDefault);
73
-    }
70
+public function getAppOption(string $sName, $xDefault = null): mixed
71
+{
72
+return $this->config()->getAppOption($sName, $xDefault);
73
+}
74 74
 
75
-    /**
75
+/**
76 76
      * Check the presence of an application config option
77 77
      *
78 78
      * @param string $sName The option name
79 79
      *
80 80
      * @return bool
81 81
      */
82
-    public function hasAppOption(string $sName): bool
83
-    {
84
-        return $this->config()->hasAppOption($sName);
85
-    }
82
+public function hasAppOption(string $sName): bool
83
+{
84
+return $this->config()->hasAppOption($sName);
85
+}
86 86
 
87
-    /**
87
+/**
88 88
      * Set the value of a config option
89 89
      *
90 90
      * @param string $sName The option name
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return void
94 94
      */
95
-    public function setAppOption(string $sName, $xValue): void
96
-    {
97
-        $this->config()->setAppOption($sName, $xValue);
98
-    }
95
+public function setAppOption(string $sName, $xValue): void
96
+{
97
+$this->config()->setAppOption($sName, $xValue);
98
+}
99 99
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/HookData.php 2 patches
Switch Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -21,59 +21,59 @@
 block discarded – undo
21 21
 
22 22
 abstract class HookData extends AbstractData
23 23
 {
24
-    /**
24
+/**
25 25
      * @var array
26 26
      */
27
-    protected $aCalls = [];
27
+protected $aCalls = [];
28 28
 
29
-    /**
29
+/**
30 30
      * @return string
31 31
      */
32
-    abstract protected function getType(): string;
32
+abstract protected function getType(): string;
33 33
 
34
-    /**
34
+/**
35 35
      * @return string
36 36
      */
37
-    public function getName(): string
38
-    {
39
-        return '__' . $this->getType();
40
-    }
37
+public function getName(): string
38
+{
39
+return '__' . $this->getType();
40
+}
41 41
 
42
-    /**
42
+/**
43 43
      * @return mixed
44 44
      */
45
-    public function getValue(): mixed
46
-    {
47
-        return $this->aCalls;
48
-    }
45
+public function getValue(): mixed
46
+{
47
+return $this->aCalls;
48
+}
49 49
 
50
-    /**
50
+/**
51 51
      * @param string $sMethod
52 52
      * @param array $aParams
53 53
      *
54 54
      * @return void
55 55
      */
56
-    public function addCall(string $sMethod, array $aParams): void
57
-    {
58
-        if(!$this->validateMethod($sMethod))
59
-        {
60
-            $sType = $this->getType();
61
-            throw new SetupException("'$sMethod' is not a valid \"call\" value for $sType.");
62
-        }
63
-        $this->aCalls[$sMethod] = $aParams;
64
-    }
56
+public function addCall(string $sMethod, array $aParams): void
57
+{
58
+if(!$this->validateMethod($sMethod))
59
+{
60
+$sType = $this->getType();
61
+throw new SetupException("'$sMethod' is not a valid \"call\" value for $sType.");
62
+}
63
+$this->aCalls[$sMethod] = $aParams;
64
+}
65 65
 
66
-    /**
66
+/**
67 67
      * @inheritDoc
68 68
      */
69
-    public function encode(string $sVarName): array
70
-    {
71
-        $aCalls = [];
72
-        foreach($this->aCalls as $sMethod => $aParams)
73
-        {
74
-            $sParams = addslashes(json_encode($aParams));
75
-            $aCalls[] = "{$sVarName}->addCall('$sMethod', json_decode(\"$sParams\", true));";
76
-        }
77
-        return $aCalls;
78
-    }
69
+public function encode(string $sVarName): array
70
+{
71
+$aCalls = [];
72
+foreach($this->aCalls as $sMethod => $aParams)
73
+{
74
+$sParams = addslashes(json_encode($aParams));
75
+$aCalls[] = "{$sVarName}->addCall('$sMethod', json_decode(\"$sParams\", true));";
76
+}
77
+return $aCalls;
78
+}
79 79
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function addCall(string $sMethod, array $aParams): void
57 57
     {
58
-        if(!$this->validateMethod($sMethod))
58
+        if (!$this->validateMethod($sMethod))
59 59
         {
60 60
             $sType = $this->getType();
61 61
             throw new SetupException("'$sMethod' is not a valid \"call\" value for $sType.");
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function encode(string $sVarName): array
70 70
     {
71 71
         $aCalls = [];
72
-        foreach($this->aCalls as $sMethod => $aParams)
72
+        foreach ($this->aCalls as $sMethod => $aParams)
73 73
         {
74 74
             $sParams = addslashes(json_encode($aParams));
75 75
             $aCalls[] = "{$sVarName}->addCall('$sMethod', json_decode(\"$sParams\", true));";
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/AbstractData.php 1 patch
Switch Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,22 +18,22 @@
 block discarded – undo
18 18
 
19 19
 abstract class AbstractData
20 20
 {
21
-    /**
21
+/**
22 22
      * Generate the PHP code to populate a Metadata object
23 23
      *
24 24
      * @param string $sVarName
25 25
      *
26 26
      * @return array
27 27
      */
28
-    abstract public function encode(string $sVarName): array;
28
+abstract public function encode(string $sVarName): array;
29 29
 
30
-    /**
30
+/**
31 31
      * @param string $sMethod
32 32
      *
33 33
      * @return bool
34 34
      */
35
-    protected function validateMethod(string $sMethod): bool
36
-    {
37
-        return preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sMethod) > 0;
38
-    }
35
+protected function validateMethod(string $sMethod): bool
36
+{
37
+return preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sMethod) > 0;
38
+}
39 39
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/ExportData.php 2 patches
Switch Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -22,53 +22,53 @@
 block discarded – undo
22 22
 
23 23
 class ExportData extends AbstractData
24 24
 {
25
-    /**
25
+/**
26 26
      * @var array
27 27
      */
28
-    private array $aMethods = [];
28
+private array $aMethods = [];
29 29
 
30
-    /**
30
+/**
31 31
      * @return string
32 32
      */
33
-    public function getName(): string
34
-    {
35
-        return 'export';
36
-    }
33
+public function getName(): string
34
+{
35
+return 'export';
36
+}
37 37
 
38
-    /**
38
+/**
39 39
      * @return mixed
40 40
      */
41
-    public function getMethods(): mixed
42
-    {
43
-        return $this->aMethods;
44
-    }
41
+public function getMethods(): mixed
42
+{
43
+return $this->aMethods;
44
+}
45 45
 
46
-    /**
46
+/**
47 47
      * @param array $aMethods
48 48
      *
49 49
      * @return void
50 50
      */
51
-    public function setMethods(array $aMethods): void
51
+public function setMethods(array $aMethods): void
52
+{
53
+foreach(['base', 'only', 'except'] as $sKey)
54
+{
55
+foreach($aMethods[$sKey] as $sMethod)
56
+{
57
+    if(!is_string($sMethod) || !$this->validateMethod($sMethod))
52 58
     {
53
-        foreach(['base', 'only', 'except'] as $sKey)
54
-        {
55
-            foreach($aMethods[$sKey] as $sMethod)
56
-            {
57
-                if(!is_string($sMethod) || !$this->validateMethod($sMethod))
58
-                {
59
-                    throw new SetupException("'$sMethod' is not a valid method name.");
60
-                }
61
-            }
62
-        }
63
-        $this->aMethods = $aMethods;
59
+        throw new SetupException("'$sMethod' is not a valid method name.");
64 60
     }
61
+}
62
+}
63
+$this->aMethods = $aMethods;
64
+}
65 65
 
66
-    /**
66
+/**
67 67
      * @inheritDoc
68 68
      */
69
-    public function encode(string $sVarName): array
70
-    {
71
-        $sMethods = addslashes(json_encode($this->aMethods));
72
-        return ["{$sVarName}->setMethods(json_decode(\"$sMethods\", true));"];
73
-    }
69
+public function encode(string $sVarName): array
70
+{
71
+$sMethods = addslashes(json_encode($this->aMethods));
72
+return ["{$sVarName}->setMethods(json_decode(\"$sMethods\", true));"];
73
+}
74 74
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@
 block discarded – undo
50 50
      */
51 51
     public function setMethods(array $aMethods): void
52 52
     {
53
-        foreach(['base', 'only', 'except'] as $sKey)
53
+        foreach (['base', 'only', 'except'] as $sKey)
54 54
         {
55
-            foreach($aMethods[$sKey] as $sMethod)
55
+            foreach ($aMethods[$sKey] as $sMethod)
56 56
             {
57
-                if(!is_string($sMethod) || !$this->validateMethod($sMethod))
57
+                if (!is_string($sMethod) || !$this->validateMethod($sMethod))
58 58
                 {
59 59
                     throw new SetupException("'$sMethod' is not a valid method name.");
60 60
                 }
Please login to merge, or discard this patch.