Completed
Push — master ( e891dc...f1a729 )
by Alexandr
03:27
created

AbstractQueryVisitor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
* Abstract query visitor.
4
*
5
* @author Ben Roberts <[email protected]>
6
* created: 7/11/16 11:03 AM
7
*/
8
9
namespace Youshido\GraphQL\Execution\Visitor;
10
11
12
use Youshido\GraphQL\Config\Field\FieldConfig;
13
14
abstract class AbstractQueryVisitor {
15
16
  protected $initialValue = 0;
17
18
  protected $memo;
19
20 2
  public function __construct() {
21 2
    $this->memo = $this->initialValue;
22 2
  }
23
24 2
  public function getMemo() {
25 2
    return $this->memo;
26
  }
27
28
  /**
29
   * @param array       $args
30
   * @param FieldConfig $fieldConfig
31
   * @param int         $childScore
32
   *
33
   * @return int|null
34
   */
35
  abstract public function visit(array $args, FieldConfig $fieldConfig, $childScore = 0);
36
}