Completed
Push — master ( 4bb4eb...402013 )
by Arthur
03:35
created

ContainerContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Arthem\GraphQLMapper\Mapping\Context;
4
5
use Arthem\GraphQLMapper\Mapping\Field;
6
use Arthem\GraphQLMapper\Mapping\FieldContainer;
7
use Arthem\GraphQLMapper\Mapping\SchemaContainer;
8
9
class ContainerContext
10
{
11
    /**
12
     * @var FieldContainer
13
     */
14
    private $container;
15
16
    /**
17
     * @var SchemaContainer
18
     */
19
    private $schema;
20
21
    /**
22
     * @param FieldContainer  $container
23
     * @param SchemaContainer $schema
24
     */
25
    public function __construct(FieldContainer $container, SchemaContainer $schema)
26
    {
27
        $this->container = $container;
28
        $this->schema    = $schema;
29
    }
30
31
    /**
32
     * @return FieldContainer
33
     */
34
    public function getContainer()
35
    {
36
        return $this->container;
37
    }
38
39
    /**
40
     * @return SchemaContainer
41
     */
42
    public function getSchema()
43
    {
44
        return $this->schema;
45
    }
46
47
    /**
48
     * @param Field $field
49
     * @return FieldContext
50
     */
51
    public function createFieldContext(Field $field)
52
    {
53
        return new FieldContext($field, $this->container, $this->schema);
54
    }
55
}
56