Passed
Push — main ( 238af9...5ca287 )
by Thierry
20:54 queued 15:16
created
jaxon-core/src/Script/Action/Attr.php 1 patch
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -4,38 +4,38 @@  discard block
 block discarded – undo
4 4
 
5 5
 class Attr extends TypedValue
6 6
 {
7
-    /**
7
+/**
8 8
      * The constructor
9 9
      *
10 10
      * @param array $aValue
11 11
      */
12
-    public function __construct(private array $aValue)
13
-    {}
12
+public function __construct(private array $aValue)
13
+{}
14 14
 
15
-    /**
15
+/**
16 16
      * @inheritDoc
17 17
      */
18
-    public function getType(): string
19
-    {
20
-        return $this->aValue['_type'] ?? '_';
21
-    }
18
+public function getType(): string
19
+{
20
+return $this->aValue['_type'] ?? '_';
21
+}
22 22
 
23
-    /**
23
+/**
24 24
      * Create an abject to get the value of an attribute
25 25
      *
26 26
      * @param string $sAttrName    The attribute name
27 27
      *
28 28
      * @return Attr
29 29
      */
30
-    public static function get(string $sAttrName): Attr
31
-    {
32
-        return new Attr([
33
-            '_type' => 'attr',
34
-            '_name' => $sAttrName,
35
-        ]);
36
-    }
30
+public static function get(string $sAttrName): Attr
31
+{
32
+return new Attr([
33
+'_type' => 'attr',
34
+'_name' => $sAttrName,
35
+]);
36
+}
37 37
 
38
-    /**
38
+/**
39 39
      * Create an abject to set the value of an attribute
40 40
      *
41 41
      * @param string $sAttrName    The attribute name
@@ -43,22 +43,22 @@  discard block
 block discarded – undo
43 43
      *
44 44
      * @return Attr
45 45
      */
46
-    public static function set(string $sAttrName, $xAttrValue): Attr
47
-    {
48
-        return new Attr([
49
-            '_type' => 'attr',
50
-            '_name' => $sAttrName,
51
-            'value' => TypedValue::make($xAttrValue)->jsonSerialize(),
52
-        ]);
53
-    }
46
+public static function set(string $sAttrName, $xAttrValue): Attr
47
+{
48
+return new Attr([
49
+'_type' => 'attr',
50
+'_name' => $sAttrName,
51
+'value' => TypedValue::make($xAttrValue)->jsonSerialize(),
52
+]);
53
+}
54 54
 
55
-    /**
55
+/**
56 56
      * Convert this call to array, when converting the response into json.
57 57
      *
58 58
      * @return array
59 59
      */
60
-    public function jsonSerialize(): array
61
-    {
62
-        return $this->aValue;
63
-    }
60
+public function jsonSerialize(): array
61
+{
62
+return $this->aValue;
63
+}
64 64
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Action/TypedValue.php 1 patch
Switch Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,36 +19,36 @@
 block discarded – undo
19 19
 
20 20
 abstract class TypedValue implements JsonSerializable
21 21
 {
22
-    /**
22
+/**
23 23
      * @return string
24 24
      */
25
-    abstract public function getType(): string;
25
+abstract public function getType(): string;
26 26
 
27
-    /**
27
+/**
28 28
      * @param mixed $xValue
29 29
      *
30 30
      * @return TypedValue
31 31
      */
32
-    public static function make(mixed $xValue): TypedValue
33
-    {
34
-        return $xValue instanceof TypedValue ? $xValue : new SimpleValue($xValue);
35
-    }
32
+public static function make(mixed $xValue): TypedValue
33
+{
34
+return $xValue instanceof TypedValue ? $xValue : new SimpleValue($xValue);
35
+}
36 36
 
37
-    /**
37
+/**
38 38
      * @return PageValue
39 39
      */
40
-    public static function page(): PageValue
41
-    {
42
-        return new PageValue();
43
-    }
40
+public static function page(): PageValue
41
+{
42
+return new PageValue();
43
+}
44 44
 
45
-    /**
45
+/**
46 46
      * @param mixed $xValue
47 47
      *
48 48
      * @return bool
49 49
      */
50
-    public static function isPage(mixed $xValue): bool
51
-    {
52
-        return is_a($xValue, PageValue::class);
53
-    }
50
+public static function isPage(mixed $xValue): bool
51
+{
52
+return is_a($xValue, PageValue::class);
53
+}
54 54
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Action/HtmlReader.php 1 patch
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -16,59 +16,59 @@
 block discarded – undo
16 16
 
17 17
 class HtmlReader
18 18
 {
19
-    /**
19
+/**
20 20
      * The class constructor
21 21
      *
22 22
      * @param string $sElementId
23 23
      */
24
-    public function __construct(private string $sElementId = '')
25
-    {}
24
+public function __construct(private string $sElementId = '')
25
+{}
26 26
 
27
-    /**
27
+/**
28 28
      * @return array
29 29
      */
30
-    public function form(): array
31
-    {
32
-        return ['_type' => 'form', '_name' => $this->sElementId];
33
-    }
30
+public function form(): array
31
+{
32
+return ['_type' => 'form', '_name' => $this->sElementId];
33
+}
34 34
 
35
-    /**
35
+/**
36 36
      * @return array
37 37
      */
38
-    public function checked(): array
39
-    {
40
-        return ['_type' => 'checked', '_name' => $this->sElementId];
41
-    }
38
+public function checked(): array
39
+{
40
+return ['_type' => 'checked', '_name' => $this->sElementId];
41
+}
42 42
 
43
-    /**
43
+/**
44 44
      * @return HtmlValue
45 45
      */
46
-    public function input(): HtmlValue
47
-    {
48
-        return new HtmlValue(['_type' => 'input', '_name' => $this->sElementId]);
49
-    }
46
+public function input(): HtmlValue
47
+{
48
+return new HtmlValue(['_type' => 'input', '_name' => $this->sElementId]);
49
+}
50 50
 
51
-    /**
51
+/**
52 52
      * @return HtmlValue
53 53
      */
54
-    public function select(): HtmlValue
55
-    {
56
-        return $this->input();
57
-    }
54
+public function select(): HtmlValue
55
+{
56
+return $this->input();
57
+}
58 58
 
59
-    /**
59
+/**
60 60
      * @return HtmlValue
61 61
      */
62
-    public function html(): HtmlValue
63
-    {
64
-        return new HtmlValue(['_type' => 'html', '_name' => $this->sElementId]);
65
-    }
62
+public function html(): HtmlValue
63
+{
64
+return new HtmlValue(['_type' => 'html', '_name' => $this->sElementId]);
65
+}
66 66
 
67
-    /**
67
+/**
68 68
      * @return PageValue
69 69
      */
70
-    public function page(): PageValue
71
-    {
72
-        return TypedValue::page();
73
-    }
70
+public function page(): PageValue
71
+{
72
+return TypedValue::page();
73
+}
74 74
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Action/Selector.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,36 +9,36 @@
 block discarded – undo
9 9
 
10 10
 class Selector implements JsonSerializable
11 11
 {
12
-    /**
12
+/**
13 13
      * @var array
14 14
      */
15
-    private $aCall;
15
+private $aCall;
16 16
 
17
-    /**
17
+/**
18 18
      * The constructor.
19 19
      *
20 20
      * @param string $sMode    The selector mode: 'jq' or 'js'
21 21
      * @param string $sPath    The selector path
22 22
      * @param mixed $xContext    A context associated to the selector
23 23
      */
24
-    public function __construct(string $sMode, string $sPath, $xContext = null)
25
-    {
26
-        $sName = trim($sPath) ?: 'this';
27
-        $this->aCall = ['_type' => 'select', '_name' => $sName, 'mode' => $sMode];
28
-        if($sName !== 'this' && $xContext !== null)
29
-        {
30
-            $this->aCall['context'] = is_a($xContext, JsonSerializable::class) ?
31
-                $xContext->jsonSerialize() : $xContext;
32
-        }
33
-    }
24
+public function __construct(string $sMode, string $sPath, $xContext = null)
25
+{
26
+$sName = trim($sPath) ?: 'this';
27
+$this->aCall = ['_type' => 'select', '_name' => $sName, 'mode' => $sMode];
28
+if($sName !== 'this' && $xContext !== null)
29
+{
30
+$this->aCall['context'] = is_a($xContext, JsonSerializable::class) ?
31
+    $xContext->jsonSerialize() : $xContext;
32
+}
33
+}
34 34
 
35
-    /**
35
+/**
36 36
      * Convert this call to array, when converting the response into json.
37 37
      *
38 38
      * @return array
39 39
      */
40
-    public function jsonSerialize(): array
41
-    {
42
-        return $this->aCall;
43
-    }
40
+public function jsonSerialize(): array
41
+{
42
+return $this->aCall;
43
+}
44 44
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Call/JsObjectCall.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,25 +19,25 @@
 block discarded – undo
19 19
 
20 20
 class JsObjectCall extends AbstractJsCall
21 21
 {
22
-    /**
22
+/**
23 23
      * The class constructor
24 24
      *
25 25
      * @param Closure|null $xExprCb
26 26
      * @param string $sJsObject
27 27
      */
28
-    public function __construct(?Closure $xExprCb, protected string $sJsObject)
29
-    {
30
-        parent::__construct($xExprCb);
31
-    }
28
+public function __construct(?Closure $xExprCb, protected string $sJsObject)
29
+{
30
+parent::__construct($xExprCb);
31
+}
32 32
 
33
-    /**
33
+/**
34 34
      * Get the call to add to the expression
35 35
      *
36 36
      * @return Attr
37 37
      */
38
-    protected function _exprCall(): Attr
39
-    {
40
-        // If the value is '', return the js "window" object, otherwise, the corresponding js object.
41
-        return Attr::get($this->sJsObject ?: 'window');
42
-    }
38
+protected function _exprCall(): Attr
39
+{
40
+// If the value is '', return the js "window" object, otherwise, the corresponding js object.
41
+return Attr::get($this->sJsObject ?: 'window');
42
+}
43 43
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Call/JqSelectorCall.php 1 patch
Switch Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -20,31 +20,31 @@  discard block
 block discarded – undo
20 20
 
21 21
 class JqSelectorCall extends AbstractJsCall
22 22
 {
23
-    /**
23
+/**
24 24
      * The constructor.
25 25
      *
26 26
      * @param Closure|null $xExprCb
27 27
      * @param string $sSelector    The jQuery selector path
28 28
      * @param mixed $xContext    A context associated to the selector
29 29
      */
30
-    public function __construct(?Closure $xExprCb, protected string $sSelector,
31
-        protected $xContext = null)
32
-    {
33
-        parent::__construct($xExprCb);
34
-    }
30
+public function __construct(?Closure $xExprCb, protected string $sSelector,
31
+protected $xContext = null)
32
+{
33
+parent::__construct($xExprCb);
34
+}
35 35
 
36
-    /**
36
+/**
37 37
      * Get the call to add to the expression
38 38
      *
39 39
      * @return Selector
40 40
      */
41
-    protected function _exprCall(): Selector
42
-    {
43
-        // If the value is '', return the js "this" object, otherwise, the selected DOM element.
44
-        return new Selector('jq', $this->sSelector ?: 'this', $this->xContext);
45
-    }
41
+protected function _exprCall(): Selector
42
+{
43
+// If the value is '', return the js "this" object, otherwise, the selected DOM element.
44
+return new Selector('jq', $this->sSelector ?: 'this', $this->xContext);
45
+}
46 46
 
47
-    /**
47
+/**
48 48
      * Set an event handler on the first selected element
49 49
      *
50 50
      * @param string $sName
@@ -52,20 +52,20 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return JsExpr
54 54
      */
55
-    public function on(string $sName, JsExpr $xHandler): JsExpr
56
-    {
57
-        return $this->_expr()->event('jq', $sName, $xHandler);
58
-    }
55
+public function on(string $sName, JsExpr $xHandler): JsExpr
56
+{
57
+return $this->_expr()->event('jq', $sName, $xHandler);
58
+}
59 59
 
60
-    /**
60
+/**
61 61
      * Set an "click" event handler on the first selected element
62 62
      *
63 63
      * @param JsExpr $xHandler
64 64
      *
65 65
      * @return JsExpr
66 66
      */
67
-    public function click(JsExpr $xHandler): JsExpr
68
-    {
69
-        return $this->_expr()->event('jq', 'click', $xHandler);
70
-    }
67
+public function click(JsExpr $xHandler): JsExpr
68
+{
69
+return $this->_expr()->event('jq', 'click', $xHandler);
70
+}
71 71
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Call/JxnClassCall.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@
 block discarded – undo
16 16
  
17 17
 class JxnClassCall extends JxnCall
18 18
 {
19
-    /**
19
+/**
20 20
      * The class constructor
21 21
      *
22 22
      * @param string $sJsObject
23 23
      */
24
-    public function __construct(protected string $sJsObject)
25
-    {
26
-        parent::__construct("$sJsObject.");
27
-    }
24
+public function __construct(protected string $sJsObject)
25
+{
26
+parent::__construct("$sJsObject.");
27
+}
28 28
 
29
-    /**
29
+/**
30 30
      * Get the js class name
31 31
      *
32 32
      * @return string
33 33
      */
34
-    public function _class(): string
35
-    {
36
-        return $this->sJsObject;
37
-    }
34
+public function _class(): string
35
+{
36
+return $this->sJsObject;
37
+}
38 38
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Call/AbstractJsCall.php 1 patch
Switch Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,47 +21,47 @@  discard block
 block discarded – undo
21 21
 
22 22
 abstract class AbstractJsCall extends AbstractCall
23 23
 {
24
-    /**
24
+/**
25 25
      * The constructor.
26 26
      *
27 27
      * @param Closure|null $xExprCb
28 28
      */
29
-    protected function __construct(protected ?Closure $xExprCb)
30
-    {}
29
+protected function __construct(protected ?Closure $xExprCb)
30
+{}
31 31
 
32
-    /**
32
+/**
33 33
      * Get the call to add to the expression
34 34
      *
35 35
      * @return Attr|Selector
36 36
      */
37
-    abstract protected function _exprCall(): Attr|Selector;
37
+abstract protected function _exprCall(): Attr|Selector;
38 38
 
39
-    /**
39
+/**
40 40
      * Get the json expression
41 41
      *
42 42
      * @return JsExpr
43 43
      */
44
-    protected function _expr(): JsExpr
45
-    {
46
-        $xJsExpr = new JsExpr($this->_exprCall());
47
-        // Apply the callback, if one was defined.
48
-        $this->xExprCb !== null && ($this->xExprCb)($xJsExpr);
49
-        return $xJsExpr;
50
-    }
44
+protected function _expr(): JsExpr
45
+{
46
+$xJsExpr = new JsExpr($this->_exprCall());
47
+// Apply the callback, if one was defined.
48
+$this->xExprCb !== null && ($this->xExprCb)($xJsExpr);
49
+return $xJsExpr;
50
+}
51 51
 
52
-    /**
52
+/**
53 53
      * Get the value of an attribute of the current object
54 54
      *
55 55
      * @param string  $sAttribute
56 56
      *
57 57
      * @return JsExpr
58 58
      */
59
-    public function __get(string $sAttribute): JsExpr
60
-    {
61
-        return $this->_expr()->__get( $sAttribute);
62
-    }
59
+public function __get(string $sAttribute): JsExpr
60
+{
61
+return $this->_expr()->__get( $sAttribute);
62
+}
63 63
 
64
-    /**
64
+/**
65 65
      * Set the value of an attribute of the current object
66 66
      *
67 67
      * @param string $sAttribute
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return void
71 71
      */
72
-    public function __set(string $sAttribute, $xValue)
73
-    {
74
-        return $this->_expr()->__set($sAttribute, $xValue);
75
-    }
72
+public function __set(string $sAttribute, $xValue)
73
+{
74
+return $this->_expr()->__set($sAttribute, $xValue);
75
+}
76 76
 }
Please login to merge, or discard this patch.
jaxon-core/src/Script/Call/JxnCall.php 1 patch
Switch Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -19,25 +19,25 @@  discard block
 block discarded – undo
19 19
 
20 20
 class JxnCall extends AbstractCall
21 21
 {
22
-    /**
22
+/**
23 23
      * The constructor.
24 24
      *
25 25
      * @param string $sPrefix The call prefix
26 26
      */
27
-    public function __construct(protected string $sPrefix)
28
-    {}
27
+public function __construct(protected string $sPrefix)
28
+{}
29 29
 
30
-    /**
30
+/**
31 31
      * Create a js expression
32 32
      *
33 33
      * @return JsExpr
34 34
      */
35
-    protected function _expr(): JsExpr
36
-    {
37
-        return new JsExpr();
38
-    }
35
+protected function _expr(): JsExpr
36
+{
37
+return new JsExpr();
38
+}
39 39
 
40
-    /**
40
+/**
41 41
      * Add a call to a js function on the current object
42 42
      *
43 43
      * @param string  $sMethod
@@ -45,36 +45,36 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @return JsExpr
47 47
      */
48
-    public function __call(string $sMethod, array $aArguments): JsExpr
49
-    {
50
-        return parent::__call("{$this->sPrefix}{$sMethod}", $aArguments);
51
-    }
48
+public function __call(string $sMethod, array $aArguments): JsExpr
49
+{
50
+return parent::__call("{$this->sPrefix}{$sMethod}", $aArguments);
51
+}
52 52
 
53
-    /**
53
+/**
54 54
      * @return string
55 55
      */
56
-    public function _class(): string
57
-    {
58
-        return '';
59
-    }
56
+public function _class(): string
57
+{
58
+return '';
59
+}
60 60
 
61
-    /**
61
+/**
62 62
      * Convert this call to array, when converting the response into json.
63 63
      *
64 64
      * @return array
65 65
      */
66
-    public function jsonSerialize(): array
67
-    {
68
-        return (new JsExpr(Attr::get($this->_class())))->jsonSerialize();
69
-    }
66
+public function jsonSerialize(): array
67
+{
68
+return (new JsExpr(Attr::get($this->_class())))->jsonSerialize();
69
+}
70 70
 
71
-    /**
71
+/**
72 72
      * Returns a call to jaxon as a string
73 73
      *
74 74
      * @return string
75 75
      */
76
-    public function __toString(): string
77
-    {
78
-        return (new JsExpr(Attr::get($this->_class())))->__toString();
79
-    }
76
+public function __toString(): string
77
+{
78
+return (new JsExpr(Attr::get($this->_class())))->__toString();
79
+}
80 80
 }
Please login to merge, or discard this patch.