CallableRenderer::renderCell()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
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, $rowData)
20
    {
21
        return call_user_func($this->renderFunction, $key, $cellData, $options, $rowData);
22
    }
23
}
24