Skip to content

Commit 2d4a205

Browse files
dereuromarkclaude
andcommitted
Fix missing imports and add return types after merge
- Add missing `use Exception` and `use Migrations\Db\Table` imports to AbstractAdapter - Add `: void` return types to algorithm/lock test methods in MysqlAdapterTest - Fix alphabetical ordering of use statements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3cb3bfb commit 2d4a205

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/Db/Adapter/AbstractAdapter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Cake\Database\Schema\SchemaDialect;
2121
use Cake\I18n\Date;
2222
use Cake\I18n\DateTime;
23+
use Exception;
2324
use InvalidArgumentException;
2425
use Migrations\Config\Config;
2526
use Migrations\Db\Action\AddColumn;
@@ -41,6 +42,7 @@
4142
use Migrations\Db\AlterInstructions;
4243
use Migrations\Db\InsertMode;
4344
use Migrations\Db\Literal;
45+
use Migrations\Db\Table;
4446
use Migrations\Db\Table\CheckConstraint;
4547
use Migrations\Db\Table\Column;
4648
use Migrations\Db\Table\ForeignKey;

tests/TestCase/Db/Adapter/MysqlAdapterTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,7 @@ public function testDropTrigger(): void
28882888
$this->assertCount(0, $rows);
28892889
}
28902890

2891-
public function testAddColumnWithAlgorithmInstant()
2891+
public function testAddColumnWithAlgorithmInstant(): void
28922892
{
28932893
$table = new Table('users', [], $this->adapter);
28942894
$table->addColumn('email', 'string')
@@ -2902,7 +2902,7 @@ public function testAddColumnWithAlgorithmInstant()
29022902
$this->assertTrue($this->adapter->hasColumn('users', 'status'));
29032903
}
29042904

2905-
public function testAddColumnWithAlgorithmAndLock()
2905+
public function testAddColumnWithAlgorithmAndLock(): void
29062906
{
29072907
$table = new Table('products', [], $this->adapter);
29082908
$table->addColumn('name', 'string')
@@ -2920,7 +2920,7 @@ public function testAddColumnWithAlgorithmAndLock()
29202920
$this->assertTrue($this->adapter->hasColumn('products', 'price'));
29212921
}
29222922

2923-
public function testChangeColumnWithAlgorithm()
2923+
public function testChangeColumnWithAlgorithm(): void
29242924
{
29252925
$table = new Table('items', [], $this->adapter);
29262926
$table->addColumn('description', 'string', ['limit' => 100])
@@ -2940,7 +2940,7 @@ public function testChangeColumnWithAlgorithm()
29402940
}
29412941
}
29422942

2943-
public function testBatchedOperationsWithSameAlgorithm()
2943+
public function testBatchedOperationsWithSameAlgorithm(): void
29442944
{
29452945
$table = new Table('batch_test', [], $this->adapter);
29462946
$table->addColumn('col1', 'string')
@@ -2960,7 +2960,7 @@ public function testBatchedOperationsWithSameAlgorithm()
29602960
$this->assertTrue($this->adapter->hasColumn('batch_test', 'col3'));
29612961
}
29622962

2963-
public function testBatchedOperationsWithConflictingAlgorithmsThrowsException()
2963+
public function testBatchedOperationsWithConflictingAlgorithmsThrowsException(): void
29642964
{
29652965
$table = new Table('conflict_test', [], $this->adapter);
29662966
$table->addColumn('col1', 'string')
@@ -2980,7 +2980,7 @@ public function testBatchedOperationsWithConflictingAlgorithmsThrowsException()
29802980
->update();
29812981
}
29822982

2983-
public function testBatchedOperationsWithConflictingLocksThrowsException()
2983+
public function testBatchedOperationsWithConflictingLocksThrowsException(): void
29842984
{
29852985
$table = new Table('lock_conflict_test', [], $this->adapter);
29862986
$table->addColumn('col1', 'string')
@@ -3002,7 +3002,7 @@ public function testBatchedOperationsWithConflictingLocksThrowsException()
30023002
->update();
30033003
}
30043004

3005-
public function testInvalidAlgorithmThrowsException()
3005+
public function testInvalidAlgorithmThrowsException(): void
30063006
{
30073007
$table = new Table('invalid_algo', [], $this->adapter);
30083008
$table->addColumn('col1', 'string')
@@ -3016,7 +3016,7 @@ public function testInvalidAlgorithmThrowsException()
30163016
])->update();
30173017
}
30183018

3019-
public function testInvalidLockThrowsException()
3019+
public function testInvalidLockThrowsException(): void
30203020
{
30213021
$table = new Table('invalid_lock', [], $this->adapter);
30223022
$table->addColumn('col1', 'string')
@@ -3030,7 +3030,7 @@ public function testInvalidLockThrowsException()
30303030
])->update();
30313031
}
30323032

3033-
public function testAlgorithmInstantWithExplicitLockThrowsException()
3033+
public function testAlgorithmInstantWithExplicitLockThrowsException(): void
30343034
{
30353035
$table = new Table('instant_lock_test', [], $this->adapter);
30363036
$table->addColumn('col1', 'string')
@@ -3046,23 +3046,23 @@ public function testAlgorithmInstantWithExplicitLockThrowsException()
30463046
])->update();
30473047
}
30483048

3049-
public function testAlgorithmConstantsAreDefined()
3049+
public function testAlgorithmConstantsAreDefined(): void
30503050
{
30513051
$this->assertEquals('DEFAULT', MysqlAdapter::ALGORITHM_DEFAULT);
30523052
$this->assertEquals('INSTANT', MysqlAdapter::ALGORITHM_INSTANT);
30533053
$this->assertEquals('INPLACE', MysqlAdapter::ALGORITHM_INPLACE);
30543054
$this->assertEquals('COPY', MysqlAdapter::ALGORITHM_COPY);
30553055
}
30563056

3057-
public function testLockConstantsAreDefined()
3057+
public function testLockConstantsAreDefined(): void
30583058
{
30593059
$this->assertEquals('DEFAULT', MysqlAdapter::LOCK_DEFAULT);
30603060
$this->assertEquals('NONE', MysqlAdapter::LOCK_NONE);
30613061
$this->assertEquals('SHARED', MysqlAdapter::LOCK_SHARED);
30623062
$this->assertEquals('EXCLUSIVE', MysqlAdapter::LOCK_EXCLUSIVE);
30633063
}
30643064

3065-
public function testAlgorithmWithMixedCase()
3065+
public function testAlgorithmWithMixedCase(): void
30663066
{
30673067
$table = new Table('mixed_case', [], $this->adapter);
30683068
$table->addColumn('col1', 'string')

0 commit comments

Comments
 (0)