-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.php
35 lines (29 loc) · 861 Bytes
/
examples.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
use ByteHello\ConditionBuilder\Builder;
use ByteHello\ConditionBuilder\Condition\AndConditionGroup;
use ByteHello\ConditionBuilder\Condition\OrConditionGroup;
use ByteHello\ConditionBuilder\ConditionConfig\ConfigData;
require 'vendor/autoload.php';
$andConditionG1 = new AndConditionGroup();
$andConditionG1->addMultiple(
[
new ConfigData('Test', 'check1'),
new ConfigData('Test', 'check2'),
]
);
$orConditionG1 = new OrConditionGroup();
$orConditionG1->addMultiple(
[
new ConfigData('Test', 'check3'),
$andConditionG1
]
);
$andConditionG2 = new AndConditionGroup();
$andConditionG2->addMultiple([
new ConfigData('Test', 'check4'),
new ConfigData('Test', 'check5'),
$orConditionG1
]);
$node = Builder::generateCode($andConditionG2);
echo Builder::getPrintedStatements($node);
echo PHP_EOL;