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

AbstractQueryVisitor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
rs 10
ccs 5
cts 5
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getMemo() 0 3 1
visit() 0 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
}