Completed
Pull Request — 8.x-3.x (#525)
by Sebastian
02:21
created

CacheMetadataCalculator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A calculate() 0 3 1
1
<?php
2
3
namespace Drupal\graphql\GraphQL\Visitors;
4
5
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
6
use GraphQL\Language\AST\OperationDefinition;
7
use GraphQL\Validator\ValidationContext;
8
9
class CacheMetadataCalculator {
10
11
  /**
12
   * @var \Drupal\Core\Cache\RefinableCacheableDependencyInterface
13
   */
14
  protected $metadata;
15
16
  /**
17
   * CacheMetadataCalculator constructor.
18
   *
19
   * @param \Drupal\Core\Cache\RefinableCacheableDependencyInterface $metadata
20
   */
21
  public function __construct(RefinableCacheableDependencyInterface $metadata) {
22
    $this->metadata = $metadata;
23
  }
24
25
  /**
26
   * {@inheritdoc}
27
   */
28
  public function calculate(OperationDefinition $definition, ValidationContext $context, \ArrayObject $variables, \ArrayObject $structure) {
0 ignored issues
show
Unused Code introduced by
The parameter $definition is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $variables is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $structure is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    // TODO: Calculate cache metadata.
30
  }
31
}