Skip to content

Commit 49b7f21

Browse files
committed
fixed phpstan issues
1 parent 9eecc27 commit 49b7f21

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ parameters:
55
level: 5
66
paths:
77
- src
8-
- config
9-
- database
108
tmpDir: build/phpstan
119
checkOctaneCompatibility: true
1210
checkModelProperties: true

src/Actions/Synchronize.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22

33
namespace Rokde\CloneDatabase\Actions;
44

5-
use Illuminate\Database\ConnectionResolverInterface;
5+
use Illuminate\Database\DatabaseManager;
66
use Rokde\CloneDatabase\Models\DatabaseSyncConfiguration;
77

88
readonly class Synchronize
99
{
1010
public function __construct(
11-
protected ConnectionResolverInterface $connections,
11+
protected DatabaseManager $connections,
1212
protected DatabaseSyncConfiguration $config
1313
) {
1414

1515
}
1616

1717
public function __invoke(): void
1818
{
19-
/** @var \Illuminate\Database\Connection|\Illuminate\Database\ConnectionInterface $sourceConnection */
19+
/** @var \Illuminate\Database\Connection $sourceConnection */
2020
$sourceConnection = $this->connections->connectUsing(
2121
$this->config->sourceConnectionName(),
2222
$this->config->sourceConnectionConfig(),
2323
true,
2424
);
2525

26-
/** @var \Illuminate\Database\Connection|\Illuminate\Database\ConnectionInterface $targetConnection */
26+
/** @var \Illuminate\Database\Connection $targetConnection */
2727
$targetConnection = $this->connections->connectUsing(
2828
$this->config->targetConnectionName(),
2929
$this->config->targetConnectionConfig(),

src/Actions/SynchronizeStructure.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Rokde\CloneDatabase\Actions;
44

55
use Doctrine\DBAL\Schema\AbstractSchemaManager;
6-
use Illuminate\Database\ConnectionInterface;
6+
use Illuminate\Database\Connection;
77
use Rokde\CloneDatabase\Events\TableCreated;
88
use Rokde\CloneDatabase\Events\TableDropped;
99

@@ -19,8 +19,8 @@ public function __construct(
1919
* @throws \Doctrine\DBAL\Exception
2020
*/
2121
public function __invoke(
22-
ConnectionInterface $sourceConnection,
23-
ConnectionInterface $targetConnection
22+
Connection $sourceConnection,
23+
Connection $targetConnection
2424
): void {
2525
// prevent "Unknown database type enum requested, Doctrine\DBAL\Platforms\*Platform may not support it."
2626
$sourceConnection->getDoctrineConnection()

src/Commands/DatabaseCloneCommandCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Rokde\CloneDatabase\Commands;
44

55
use Illuminate\Console\Command;
6-
use Illuminate\Database\ConnectionResolverInterface;
6+
use Illuminate\Database\DatabaseManager;
77
use Illuminate\Support\Facades\Event;
88
use Rokde\CloneDatabase\Actions\CountRecords;
99
use Rokde\CloneDatabase\Actions\DeleteRecords;
@@ -29,7 +29,7 @@ class DatabaseCloneCommandCommand extends Command
2929

3030
private ?Stopwatch $stopwatch = null;
3131

32-
public function handle(ConnectionResolverInterface $connections): int
32+
public function handle(DatabaseManager $connections): int
3333
{
3434
$this->stopwatch = Stopwatch::make();
3535

src/Models/DatabaseSyncConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Illuminate\Support\Arr;
77
use InvalidArgumentException;
88

9-
class DatabaseSyncConfiguration implements Arrayable
9+
final class DatabaseSyncConfiguration implements Arrayable
1010
{
1111
const DROP_TABLES = 'dropTables';
1212

@@ -38,7 +38,7 @@ class DatabaseSyncConfiguration implements Arrayable
3838

3939
public static function make(array $config = []): static
4040
{
41-
return new static($config);
41+
return new self($config);
4242
}
4343

4444
public function __construct(array $config)

0 commit comments

Comments
 (0)