ReadonlyHandler::alterColumn()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 3
dl 0
loc 1
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of Cycle ORM package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Database\Driver;
13
14
use Cycle\Database\Schema\AbstractColumn;
0 ignored issues
show
Bug introduced by
The type Cycle\Database\Schema\AbstractColumn was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Cycle\Database\Schema\AbstractForeignKey;
16
use Cycle\Database\Schema\AbstractIndex;
17
use Cycle\Database\Schema\AbstractTable;
18
19
final class ReadonlyHandler implements HandlerInterface
20
{
21
    public function __construct(
22
        private HandlerInterface $parent,
23
    ) {}
24
25
    public function withDriver(DriverInterface $driver): HandlerInterface
26
    {
27
        $handler = clone $this;
28
        $handler->parent = $handler->parent->withDriver($driver);
29
30
        return $handler;
31
    }
32
33
    public function getTableNames(string $prefix = ''): array
34
    {
35
        return $this->parent->getTableNames();
36
    }
37
38
    /**
39
     * @psalm-param non-empty-string $table
40
     */
41
    public function hasTable(string $table): bool
42
    {
43
        return $this->parent->hasTable($table);
44
    }
45
46
    /**
47
     * @psalm-param non-empty-string $table
48
     */
49
    public function getSchema(string $table, ?string $prefix = null): AbstractTable
50
    {
51
        return $this->parent->getSchema($table, $prefix);
52
    }
53
54
    public function createTable(AbstractTable $table): void {}
55
56
    public function eraseTable(AbstractTable $table): void
57
    {
58
        $this->parent->eraseTable($table);
59
    }
60
61
    public function dropTable(AbstractTable $table): void {}
62
63
    public function syncTable(AbstractTable $table, int $operation = self::DO_ALL): void {}
64
65
    /**
66
     * @psalm-param non-empty-string $table
67
     * @psalm-param non-empty-string $name
68
     */
69
    public function renameTable(string $table, string $name): void {}
70
71
    public function createColumn(AbstractTable $table, AbstractColumn $column): void {}
72
73
    public function dropColumn(AbstractTable $table, AbstractColumn $column): void {}
74
75
    public function alterColumn(AbstractTable $table, AbstractColumn $initial, AbstractColumn $column): void {}
76
77
    public function createIndex(AbstractTable $table, AbstractIndex $index): void {}
78
79
    public function dropIndex(AbstractTable $table, AbstractIndex $index): void {}
80
81
    public function alterIndex(AbstractTable $table, AbstractIndex $initial, AbstractIndex $index): void {}
82
83
    public function createForeignKey(AbstractTable $table, AbstractForeignKey $foreignKey): void {}
84
85
    public function dropForeignKey(AbstractTable $table, AbstractForeignKey $foreignKey): void {}
86
87
    public function alterForeignKey(
88
        AbstractTable $table,
89
        AbstractForeignKey $initial,
90
        AbstractForeignKey $foreignKey,
91
    ): void {}
92
93
    /**
94
     * @psalm-param non-empty-string $constraint
95
     */
96
    public function dropConstrain(AbstractTable $table, string $constraint): void {}
97
}
98