Issues (90)

src/database/Index.php (3 issues)

Labels
Severity
1
<?php
2
namespace yentu\database;
3
4
5
class Index extends BasicKey
6
{
7
    protected $unique = false;
8
9
    public function unique($unique = true)
10
    {
11
        $this->unique = $unique;
12
        return $this;
13
    }
14
15
    #[\Override]
16
    protected function doesKeyExist($constraint)
17
    {
18
        return $this->getChangeLogger()->doesIndexExist($constraint);
0 ignored issues
show
The method doesIndexExist() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

18
        return $this->getChangeLogger()->/** @scrutinizer ignore-call */ doesIndexExist($constraint);
Loading history...
19
    }
20
21
    #[\Override]
22
    protected function addKey($constraint)
23
    {
24
        $this->getChangeLogger()->addIndex($constraint);
0 ignored issues
show
The method addIndex() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

24
        $this->getChangeLogger()->/** @scrutinizer ignore-call */ addIndex($constraint);
Loading history...
25
    }
26
27
    #[\Override]
28
    protected function dropKey($constraint)
29
    {
30
        $this->getChangeLogger()->dropIndex($constraint);
0 ignored issues
show
The method dropIndex() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

30
        $this->getChangeLogger()->/** @scrutinizer ignore-call */ dropIndex($constraint);
Loading history...
31
    }
32
33
    #[\Override]
34
    protected function getNamePostfix()
35
    {
36
        return 'idx';
37
    }
38
39
    #[\Override]
40
    public function buildDescription()
41
    {
42
        return parent::buildDescription() + ['unique' => $this->unique];
43
    }
44
}
45