@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected $customRules; |
32 | 32 | |
33 | - protected $hasCustomRules = false; |
|
33 | + protected $hasCustomRules=false; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | protected $optional; |
42 | 42 | |
43 | 43 | public function __construct($identifier) { |
44 | - $this->identifier = $identifier; |
|
45 | - $this->rules = []; |
|
44 | + $this->identifier=$identifier; |
|
45 | + $this->rules=[]; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function getIdentifier() { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | public function setIdentifier($identifier) { |
53 | - $this->identifier = $identifier; |
|
53 | + $this->identifier=$identifier; |
|
54 | 54 | return $this; |
55 | 55 | } |
56 | 56 | |
@@ -65,47 +65,47 @@ discard block |
||
65 | 65 | * @param string $value |
66 | 66 | * @return Rule |
67 | 67 | */ |
68 | - public function addRule($type, $prompt = NULL, $value = NULL) { |
|
68 | + public function addRule($type, $prompt=NULL, $value=NULL) { |
|
69 | 69 | if ($type instanceof Rule) { |
70 | - $rule = $type; |
|
70 | + $rule=$type; |
|
71 | 71 | if ($type instanceof CustomRule) { |
72 | - $this->customRules[] = $type; |
|
73 | - $this->hasCustomRules = true; |
|
72 | + $this->customRules[]=$type; |
|
73 | + $this->hasCustomRules=true; |
|
74 | 74 | } |
75 | 75 | } elseif (\is_array($type)) { |
76 | - $value = JArray::getValue($type, "value", 2); |
|
77 | - $prompt = JArray::getValue($type, "prompt", 1); |
|
78 | - $type = JArray::getValue($type, "type", 0); |
|
79 | - $rule = new Rule($type, $prompt, $value); |
|
76 | + $value=JArray::getValue($type, "value", 2); |
|
77 | + $prompt=JArray::getValue($type, "prompt", 1); |
|
78 | + $type=JArray::getValue($type, "type", 0); |
|
79 | + $rule=new Rule($type, $prompt, $value); |
|
80 | 80 | } else { |
81 | - $rule = new Rule($type, $prompt, $value); |
|
81 | + $rule=new Rule($type, $prompt, $value); |
|
82 | 82 | } |
83 | - $this->rules[] = $rule; |
|
83 | + $this->rules[]=$rule; |
|
84 | 84 | return $rule; |
85 | 85 | } |
86 | 86 | |
87 | 87 | # [\ReturnTypeWillChange] |
88 | 88 | public function jsonSerialize() { |
89 | - $result = [ |
|
89 | + $result=[ |
|
90 | 90 | "identifier" => $this->identifier, |
91 | 91 | "rules" => $this->rules |
92 | 92 | ]; |
93 | 93 | if ($this->optional) { |
94 | - $result["optional"] = true; |
|
94 | + $result["optional"]=true; |
|
95 | 95 | } |
96 | 96 | if (isset($this->depends)) { |
97 | - $result["depends"] = $this->depends; |
|
97 | + $result["depends"]=$this->depends; |
|
98 | 98 | } |
99 | 99 | return $result; |
100 | 100 | } |
101 | 101 | |
102 | 102 | public function setDepends($depends) { |
103 | - $this->depends = $depends; |
|
103 | + $this->depends=$depends; |
|
104 | 104 | return $this; |
105 | 105 | } |
106 | 106 | |
107 | 107 | public function setOptional($optional) { |
108 | - $this->optional = $optional; |
|
108 | + $this->optional=$optional; |
|
109 | 109 | return $this; |
110 | 110 | } |
111 | 111 |