Skip to content

Commit fbf31e0

Browse files
update Drop class methods,covnert return void to self
1 parent e6aa523 commit fbf31e0

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

src/Operations/Drop.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,68 +95,76 @@ public function index($name): self
9595
/**
9696
* Set the target to drop a database.
9797
*/
98-
public function dropDatabase(): void
98+
public function dropDatabase(): self
9999
{
100100
$this->setAttribute('target', 'database');
101+
return $this;
101102
}
102103

103104
/**
104105
* Set the target to drop a table.
105106
*/
106-
public function dropTable(): void
107+
public function dropTable(): self
107108
{
108109
$this->setAttribute('target', 'table');
110+
return $this;
109111
}
110112

111113
/**
112114
* Set the target to drop a column.
113115
*/
114-
public function dropColumn(): void
116+
public function dropColumn(): self
115117
{
116118
$this->setAttribute('target', 'column');
119+
return $this;
117120
}
118121

119122
/**
120123
* Set the target to drop a key.
121124
*/
122-
public function dropKey(): void
125+
public function dropKey(): self
123126
{
124127
$this->setAttribute('target', 'key');
128+
return $this;
125129
}
126130

127131
/**
128132
* Set the target to drop a primary key.
129133
*/
130-
public function dropPrimaryKey(): void
134+
public function dropPrimaryKey(): self
131135
{
132136
$this->dropKey();
133137
$this->setAttribute('type', 'primary_key');
138+
return $this;
134139
}
135140

136141
/**
137142
* Set the target to drop a foreign key.
138143
*/
139-
public function dropForeignKey(): void
144+
public function dropForeignKey(): self
140145
{
141146
$this->dropKey();
142147
$this->setAttribute('type', 'foreign_key');
148+
return $this;
143149
}
144150

145151
/**
146152
* Set the target to drop a unique key.
147153
*/
148-
public function dropUniqueKey(): void
154+
public function dropUniqueKey(): self
149155
{
150156
$this->dropIndex();
151157
$this->setAttribute('type', 'unique_key');
158+
return $this;
152159
}
153160

154161
/**
155162
* Set the target to drop an index.
156163
*/
157-
public function dropIndex(): void
164+
public function dropIndex(): self
158165
{
159166
$this->setAttribute('target', 'index');
167+
return $this;
160168
}
161169

162170
/**

0 commit comments

Comments
 (0)