Passed
Push — main ( faeaf0...5f5b5b )
by Thierry
36:26 queued 28:38
created

GrammarTrait::autoIncrement()   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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Lagdo\DbAdmin\Driver\Db;
4
5
use Lagdo\DbAdmin\Driver\Entity\TableFieldEntity;
6
7
use function substr;
8
use function str_replace;
9
10
trait GrammarTrait
11
{
12
    /**
13
     * @inheritDoc
14
     */
15
    public function escapeId(string $idf)
16
    {
17
        return $idf;
18
    }
19
20
    /**
21
     * @inheritDoc
22
     */
23
    public function unescapeId(string $idf)
24
    {
25
        $last = substr($idf, -1);
26
        return str_replace($last . $last, $last, substr($idf, 1, -1));
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function convertField(TableFieldEntity $field)
0 ignored issues
show
Unused Code introduced by
The parameter $field is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function convertField(/** @scrutinizer ignore-unused */ TableFieldEntity $field)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        return '';
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function unconvertField(TableFieldEntity $field, string $value)
0 ignored issues
show
Unused Code introduced by
The parameter $field is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

40
    public function unconvertField(/** @scrutinizer ignore-unused */ TableFieldEntity $field, string $value)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        return $value;
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function getCreateTableQuery(string $table, bool $autoIncrement, string $style)
0 ignored issues
show
Unused Code introduced by
The parameter $style is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

48
    public function getCreateTableQuery(string $table, bool $autoIncrement, /** @scrutinizer ignore-unused */ string $style)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $autoIncrement is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

48
    public function getCreateTableQuery(string $table, /** @scrutinizer ignore-unused */ bool $autoIncrement, string $style)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

48
    public function getCreateTableQuery(/** @scrutinizer ignore-unused */ string $table, bool $autoIncrement, string $style)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
49
    {
50
        return '';
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56
    public function getCreateIndexQuery(string $table, string $type, string $name, string $columns)
0 ignored issues
show
Unused Code introduced by
The parameter $columns is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

56
    public function getCreateIndexQuery(string $table, string $type, string $name, /** @scrutinizer ignore-unused */ string $columns)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

56
    public function getCreateIndexQuery(string $table, /** @scrutinizer ignore-unused */ string $type, string $name, string $columns)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $name is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

56
    public function getCreateIndexQuery(string $table, string $type, /** @scrutinizer ignore-unused */ string $name, string $columns)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

56
    public function getCreateIndexQuery(/** @scrutinizer ignore-unused */ string $table, string $type, string $name, string $columns)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
57
    {
58
        return '';
59
    }
60
61
    /**
62
     * @inheritDoc
63
     */
64
    public function getUseDatabaseQuery(string $database)
0 ignored issues
show
Unused Code introduced by
The parameter $database is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

64
    public function getUseDatabaseQuery(/** @scrutinizer ignore-unused */ string $database)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
65
    {
66
        return '';
67
    }
68
69
    /**
70
     * @inheritDoc
71
     */
72
    public function getForeignKeysQuery(string $table)
0 ignored issues
show
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

72
    public function getForeignKeysQuery(/** @scrutinizer ignore-unused */ string $table)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
73
    {
74
        return '';
75
    }
76
77
    /**
78
     * @inheritDoc
79
     */
80
    public function getTruncateTableQuery(string $table)
0 ignored issues
show
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

80
    public function getTruncateTableQuery(/** @scrutinizer ignore-unused */ string $table)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
81
    {
82
        return '';
83
    }
84
85
    /**
86
     * @inheritDoc
87
     */
88
    public function getCreateTriggerQuery(string $table)
0 ignored issues
show
Unused Code introduced by
The parameter $table is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

88
    public function getCreateTriggerQuery(/** @scrutinizer ignore-unused */ string $table)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
89
    {
90
        return '';
91
    }
92
93
    /**
94
     * @inheritDoc
95
     */
96
    public function getAutoIncrementModifier()
97
    {
98
        return '';
99
    }
100
}
101