Completed
Push — master ( 1df19b...3d6a4b )
by Trevor N.
11s
created

AbstractDelegateContextualBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * Incoming
4
 *
5
 * @author    Trevor Suarez (Rican7)
6
 * @copyright (c) Trevor Suarez
7
 * @link      https://github.com/Rican7/incoming
8
 * @license   MIT
9
 */
10
11
declare(strict_types=1);
12
13
namespace Incoming\Hydrator;
14
15
use Incoming\Structure\Map;
16
17
/**
18
 * An abstract, context enabled extension of the `AbstractDelegateBuilder`.
19
 *
20
 * @see AbstractDelegateBuilder
21
 */
22
abstract class AbstractDelegateContextualBuilder extends AbstractDelegateBuilder implements ContextualBuilder
23
{
24
25
    /**
26
     * {@inheritdoc}
27
     *
28
     * @param mixed $incoming The input data.
29
     * @param Map|null $context An optional generic key-value map, for providing
30
     *  contextual values during the build process.
31
     * @return mixed The built model.
32
     */
33 3
    public function build($incoming, Map $context = null)
34
    {
35 3
        $callable = $this->getDelegate();
36
37 3
        return $callable($incoming, $context);
38
    }
39
}
40