Completed
Pull Request — 8.x-3.x (#481)
by Sebastian
05:33
created

SubRequestResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getResult() 0 3 1
1
<?php
2
3
namespace Drupal\graphql\GraphQL\Buffers;
4
5
use Symfony\Component\HttpFoundation\Response;
6
7
class SubRequestResponse extends Response {
8
9
  /**
10
   * The request result.
11
   *
12
   * @var mixed
13
   */
14
  protected $result;
15
16
  /**
17
   * SubrequestResponse constructor.
18
   *
19
   * @param mixed $result
20
   *   The request result.
21
   * @param int $status
22
   *   The response status code.
23
   * @param array $headers
24
   *   An array of response headers.
25
   */
26
  public function __construct(array $result, $status = 200, array $headers = []) {
27
    parent::__construct('', $status, $headers);
28
    $this->result = $result;
29
  }
30
31
  /**
32
   * Gets the request result.
33
   *
34
   * @return mixed
35
   *   The request result.
36
   */
37
  public function getResult() {
38
    return $this->result;
39
  }
40
41
}