BulkSqlTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A iterateOverItems() 0 11 2
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