1
<?php
2

3
namespace Nuwave\Lighthouse\Execution;
4

5
/**
6
 * May be returned from listeners of the event:.
7
 * @see \Nuwave\Lighthouse\Events\BuildExtensionsResponse
8
 */
9
class ExtensionsResponse
10
{
11
    /**
12
     * Will be used as the key in the response map.
13
     *
14
     * @var string
15
     */
16
    protected $key;
17

18
    /**
19
     * @var mixed JSON-encodable content of the extension.
20
     */
21
    protected $content;
22

23
    /**
24
     * @param  mixed  $content JSON-encodable content
25
     */
26 1
    public function __construct(string $key, $content)
27
    {
28 1
        $this->key = $key;
29 1
        $this->content = $content;
30
    }
31

32
    /**
33
     * Return the key of the extension.
34
     */
35 1
    public function key(): string
36
    {
37 1
        return $this->key;
38
    }
39

40
    /**
41
     * @return mixed JSON-encodable content of the extension.
42
     */
43 1
    public function content()
44
    {
45 1
        return $this->content;
46
    }
47
}

Read our documentation on viewing source code .

Loading