Skip to content

Commit 743a893

Browse files
committed
Fix phpcs - use imports instead of FQN
1 parent f513207 commit 743a893

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/BaseSeed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ protected function runCall(string $seeder, array $options = []): void
263263

264264
$options += [
265265
'connection' => $connection,
266-
'plugin' => $pluginName ?? ($config instanceof \Migrations\Config\ConfigInterface ? $config['plugin'] : null),
267-
'source' => $config instanceof \Migrations\Config\ConfigInterface ? $config['source'] : null,
266+
'plugin' => $pluginName ?? ($config instanceof ConfigInterface ? $config['plugin'] : null),
267+
'source' => $config instanceof ConfigInterface ? $config['source'] : null,
268268
];
269269
$factory = new ManagerFactory([
270270
'connection' => $options['connection'],

src/Db/Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function getConnection(): Connection
194194
$this->connection = $this->getOption('connection');
195195
$this->connect();
196196
}
197-
if (!$this->connection instanceof \Cake\Database\Connection) {
197+
if (!$this->connection instanceof Connection) {
198198
throw new RuntimeException('Unable to establish database connection. Ensure a connection is configured.');
199199
}
200200

src/Util/TableFinder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Cake\Core\Plugin as CorePlugin;
1818
use Cake\Database\Schema\CollectionInterface;
1919
use Cake\Datasource\ConnectionManager;
20+
use Cake\ORM\Association;
2021
use Cake\ORM\TableRegistry;
2122
use ReflectionClass;
2223

@@ -178,7 +179,7 @@ public function fetchTableName(string $className, ?string $pluginName = null): a
178179
$table = TableRegistry::getTableLocator()->get($className);
179180
foreach ($table->associations()->keys() as $key) {
180181
$association = $table->associations()->get($key);
181-
if ($association instanceof \Cake\ORM\Association && $association->type() === 'belongsToMany') {
182+
if ($association instanceof Association && $association->type() === 'belongsToMany') {
182183
/** @var \Cake\ORM\Association\BelongsToMany $belongsToMany */
183184
$belongsToMany = $association;
184185
$tables[] = $belongsToMany->junction()->getTable();

tests/TestCase/Command/ResetCommandTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Migrations\Test\TestCase\Command;
55

6+
use Cake\Console\TestSuite\StubConsoleOutput;
67
use Cake\Datasource\ConnectionManager;
78
use Cake\Event\EventInterface;
89
use Cake\Event\EventManager;
@@ -39,7 +40,7 @@ protected function tearDown(): void
3940

4041
protected function resetOutput(): void
4142
{
42-
if ($this->_out instanceof \Cake\Console\TestSuite\StubConsoleOutput) {
43+
if ($this->_out instanceof StubConsoleOutput) {
4344
$property = new ReflectionProperty($this->_out, '_out');
4445
$property->setValue($this->_out, []);
4546
}

0 commit comments

Comments
 (0)