Passed
Push — master ( 37e483...d2fc64 )
by Wilmer
11:53 queued 09:06
created

BaseCommandPDOProvider::bindParam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 17
rs 9.8666
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Provider;
6
7
use PDO;
8
9
final class BaseCommandPDOProvider
10
{
11
    public function bindParam(): array
12
    {
13
        return [
14
            [
15
                'id',
16
                ':id',
17
                1,
18
                PDO::PARAM_STR,
19
                null,
20
                null,
21
                [
22
                    'id' => '1',
23
                    'email' => '[email protected]',
24
                    'name' => 'user1',
25
                    'address' => 'address1',
26
                    'status' => '1',
27
                    'profile_id' => '1',
28
                ],
29
            ],
30
        ];
31
    }
32
33
    public function bindParamsNonWhere(): array
34
    {
35
        return [
36
            [
37
                <<<SQL
38
                SELECT SUBSTR(name, :len) FROM [[customer]] WHERE [[email]] = :email GROUP BY SUBSTR(name, :len)
39
                SQL,
40
            ],
41
            [
42
                <<<SQL
43
                SELECT SUBSTR(name, :len) FROM [[customer]] WHERE [[email]] = :email ORDER BY SUBSTR(name, :len)
44
                SQL,
45
            ],
46
            [
47
                <<<SQL
48
                SELECT SUBSTR(name, :len) FROM [[customer]] WHERE [[email]] = :email
49
                SQL,
50
            ],
51
        ];
52
    }
53
}
54