PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
← All changes | includes/Admin/Builder/Rule.php +36 -36 3.4.24.9.2 View file →
@@ -4,44 +4,44 @@
4 4
5 5 use JsonSerializable;
6 6
7 7 class Rule implements JsonSerializable {
8 - public $condition;
9 - public $name;
10 - public $value;
11 - public function __construct( $condition, $name, $value ) {
12 - $this->condition = $condition;
13 - $this->name = $name;
14 - $this->value = $value;
15 - }
8 + public $condition;
9 + public $name;
10 + public $value;
11 + public function __construct( $condition, $name, $value ) {
12 + $this->condition = $condition;
13 + $this->name = $name;
14 + $this->value = $value;
15 + }
16 16
17 - public function add_value( $value ) {
18 - if ( ! is_array( $this->value ) ) {
19 - $this->value = [$this->value];
20 - }
21 - if ( is_a( $value, 'NotificationX\Core\Rule' ) ) {
22 - $value = $value->value;
23 - }
24 - if ( is_array( $value ) ) {
25 - $this->value = array_merge( $this->value, $value );
26 - } else {
27 - $this->value[] = $value;
28 - }
29 - $this->value = array_values( array_unique( $this->value ) );
30 - }
17 + public function add_value( $value ) {
18 + if ( ! is_array( $this->value ) ) {
19 + $this->value = [ $this->value ];
20 + }
21 + if ( is_a( $value, 'NotificationX\Core\Rule' ) ) {
22 + $value = $value->value;
23 + }
24 + if ( is_array( $value ) ) {
25 + $this->value = array_merge( $this->value, $value );
26 + } else {
27 + $this->value[] = $value;
28 + }
29 + $this->value = array_values( array_unique( $this->value ) );
30 + }
31 31
32 - public function can_add( $rule ) {
33 - if ( $this->condition == 'includes' && $this->condition == $rule->condition && $this->name == $rule->name ) {
34 - return true;
35 - }
36 - return false;
37 - }
32 + public function can_add( $rule ) {
33 + if ( $this->condition == 'includes' && $this->condition == $rule->condition && $this->name == $rule->name ) {
34 + return true;
35 + }
36 + return false;
37 + }
38 38
39 - #[\ReturnTypeWillChange]
40 - public function jsonSerialize() {
41 - return [
42 - $this->condition,
43 - $this->name,
44 - $this->value
45 - ];
46 - }
39 + #[\ReturnTypeWillChange]
40 + public function jsonSerialize() {
41 + return [
42 + $this->condition,
43 + $this->name,
44 + $this->value
45 + ];
46 + }
47 47 }