BulkSqlTrait::iterateOverItems()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace League\Database\Traits;
4
5
trait BulkSqlTrait
6
{
7
    /**
8
     * Iterate over prepared items to be executed, to prepare statement and bind params
9
     *
10
     * @param array    $items
11
     * @param callable $callback
12
     *
13
     * @return array
14
     */
15
    private function iterateOverItems(array $items, callable $callback) : array
16
    {
17
        $result = [];
18
        $count = count($items);
19
20
        for ($i = 0; $i < $count; $i++) {
21
            $result[] = $callback($i);
22
        }
23
24
        return $result;
25
    }
26
}
27