Passed
Push — master ( 80d492...171be0 )
by Jonas
02:45
created

SqliteGrammar::compileMemberOf()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Staudenmeir\EloquentJsonRelations\Grammars;
4
5
use Illuminate\Database\ConnectionInterface;
6
use Illuminate\Database\Query\Grammars\SQLiteGrammar as Base;
7
use RuntimeException;
8
9
class SqliteGrammar extends Base implements JsonGrammar
10
{
11
    /**
12
     * Compile a "JSON array" statement into SQL.
13
     *
14
     * @param string $column
15
     * @return string
16
     */
17
    public function compileJsonArray($column)
18
    {
19
        return $this->wrap($column);
20
    }
21
22
    /**
23
     * Compile a "JSON object" statement into SQL.
24
     *
25
     * @param string $column
26
     * @param int $levels
27
     * @return string
28
     */
29
    public function compileJsonObject($column, $levels)
30
    {
31
        throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore
32
    }
33
34
    /**
35
     * Compile a "JSON value select" statement into SQL.
36
     *
37
     * @param string $column
38
     * @return string
39
     */
40
    public function compileJsonValueSelect(string $column): string
41
    {
42
        return $this->wrap($column);
43
    }
44
45
    /**
46
     * Determine whether the database supports the "member of" operator.
47
     *
48
     * @param \Illuminate\Database\ConnectionInterface $connection
49
     * @return bool
50
     */
51
    public function supportsMemberOf(ConnectionInterface $connection): bool
52
    {
53
        return false;
54
    }
55
56
    /**
57
     * Compile a "member of" statement into SQL.
58
     *
59
     * @param string $column
60
     * @param string|null $objectKey
61
     * @param mixed $value
62
     * @return string
63
     */
64
    public function compileMemberOf(string $column, ?string $objectKey, mixed $value): string
65
    {
66
        throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore
67
    }
68
69
    /**
70
     * Prepare the bindings for a "member of" statement.
71
     *
72
     * @param mixed $value
73
     * @return array
74
     */
75
    public function prepareBindingsForMemberOf(mixed $value): array
76
    {
77
        throw new RuntimeException('This database is not supported.'); // @codeCoverageIgnore
78
    }
79
}
80