Completed
Push — master ( 7f2d14...7fc8f2 )
by Fabien
02:11
created

Rows   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 12 2
1
<?php
2
namespace Fab\Vidi\View\Grid;
3
4
/*
5
 * This file is part of the Fab/Vidi project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10
11
use TYPO3\CMS\Core\Utility\GeneralUtility;
12
13
/**
14
 * View helper for rendering multiple rows.
15
 */
16
class Rows
17
{
18
19
    /**
20
     * Returns rows of content as array.
21
     *
22
     * @param array $objects
23
     * @param array $columns
24
     * @return array
25
     * @throws \Exception
26
     * @throws \InvalidArgumentException
27
     */
28
    public function render(array $objects = [], array $columns = array())
29
    {
30
        $rows = [];
31
32
        /** @var Row $row */
33
        $row = GeneralUtility::makeInstance(Row::class, $columns);
34
        foreach ($objects as $index => $object) {
35
            $rows[] = $row->render($object, $index);
36
        }
37
38
        return $rows;
39
    }
40
}
41