Completed
Pull Request — master (#37)
by Greg
03:21 queued 01:22
created

CallableRenderer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Consolidation\OutputFormatters\StructuredData;
3
4
use Consolidation\OutputFormatters\Options\FormatterOptions;
5
6
class CallableRenderer implements RenderCellInterface
7
{
8
    /** @var callable */
9
    protected $renderFunction;
10
11
    public function __construct(callable $renderFunction)
12
    {
13
        $this->renderFunction = $renderFunction;
14
    }
15
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function renderCell($key, $cellData, FormatterOptions $options)
20
    {
21
        return ($this->renderFunction)($key, $cellData, $options);
22
    }
23
}
24