PreparedStatements::generatePlaceholdersString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 1
c 2
b 1
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace WebServCo\Framework\Database\Utils;
6
7
final class PreparedStatements
8
{
9
    /**
10
    * @param array<int,float|int|string> $data
11
    */
12
    public static function generatePlaceholdersString(array $data = []): string
13
    {
14
        /**
15
        * Pre PHP 7.4 Anonymous function: `static function () { return '?';}`
16
        */
17
        return \implode(', ', \array_map(static fn () => '?', $data));
18
    }
19
}
20