1 | <?php |
||
8 | class MaxComplexityQueryVisitor implements QueryVisitorInterface { |
||
9 | |||
10 | /** |
||
11 | * The allowed maximum complexity; |
||
12 | * |
||
13 | * @var int |
||
14 | */ |
||
15 | protected $maxComplexity; |
||
16 | |||
17 | /** |
||
18 | * MaxComplexityQueryVisitor constructor. |
||
19 | * |
||
20 | * @param int $maxComplexity |
||
21 | * The allowed maximum complexity. |
||
22 | */ |
||
23 | public function __construct($maxComplexity) { |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function visit(array $args, FieldInterface $field, $child) { |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function reduce($carry, $current) { |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function initial() { |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function finish($result) { |
||
64 | } |