File tree Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ parameters:
5
5
level: 5
6
6
paths:
7
7
- src
8
- - config
9
- - database
10
8
tmpDir: build/phpstan
11
9
checkOctaneCompatibility: true
12
10
checkModelProperties: true
Original file line number Diff line number Diff line change 2
2
3
3
namespace Rokde \CloneDatabase \Actions ;
4
4
5
- use Illuminate \Database \ConnectionResolverInterface ;
5
+ use Illuminate \Database \DatabaseManager ;
6
6
use Rokde \CloneDatabase \Models \DatabaseSyncConfiguration ;
7
7
8
8
readonly class Synchronize
9
9
{
10
10
public function __construct (
11
- protected ConnectionResolverInterface $ connections ,
11
+ protected DatabaseManager $ connections ,
12
12
protected DatabaseSyncConfiguration $ config
13
13
) {
14
14
15
15
}
16
16
17
17
public function __invoke (): void
18
18
{
19
- /** @var \Illuminate\Database\Connection|\Illuminate\Database\ConnectionInterface $sourceConnection */
19
+ /** @var \Illuminate\Database\Connection $sourceConnection */
20
20
$ sourceConnection = $ this ->connections ->connectUsing (
21
21
$ this ->config ->sourceConnectionName (),
22
22
$ this ->config ->sourceConnectionConfig (),
23
23
true ,
24
24
);
25
25
26
- /** @var \Illuminate\Database\Connection|\Illuminate\Database\ConnectionInterface $targetConnection */
26
+ /** @var \Illuminate\Database\Connection $targetConnection */
27
27
$ targetConnection = $ this ->connections ->connectUsing (
28
28
$ this ->config ->targetConnectionName (),
29
29
$ this ->config ->targetConnectionConfig (),
Original file line number Diff line number Diff line change 3
3
namespace Rokde \CloneDatabase \Actions ;
4
4
5
5
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
6
- use Illuminate \Database \ConnectionInterface ;
6
+ use Illuminate \Database \Connection ;
7
7
use Rokde \CloneDatabase \Events \TableCreated ;
8
8
use Rokde \CloneDatabase \Events \TableDropped ;
9
9
@@ -19,8 +19,8 @@ public function __construct(
19
19
* @throws \Doctrine\DBAL\Exception
20
20
*/
21
21
public function __invoke (
22
- ConnectionInterface $ sourceConnection ,
23
- ConnectionInterface $ targetConnection
22
+ Connection $ sourceConnection ,
23
+ Connection $ targetConnection
24
24
): void {
25
25
// prevent "Unknown database type enum requested, Doctrine\DBAL\Platforms\*Platform may not support it."
26
26
$ sourceConnection ->getDoctrineConnection ()
Original file line number Diff line number Diff line change 3
3
namespace Rokde \CloneDatabase \Commands ;
4
4
5
5
use Illuminate \Console \Command ;
6
- use Illuminate \Database \ConnectionResolverInterface ;
6
+ use Illuminate \Database \DatabaseManager ;
7
7
use Illuminate \Support \Facades \Event ;
8
8
use Rokde \CloneDatabase \Actions \CountRecords ;
9
9
use Rokde \CloneDatabase \Actions \DeleteRecords ;
@@ -29,7 +29,7 @@ class DatabaseCloneCommandCommand extends Command
29
29
30
30
private ?Stopwatch $ stopwatch = null ;
31
31
32
- public function handle (ConnectionResolverInterface $ connections ): int
32
+ public function handle (DatabaseManager $ connections ): int
33
33
{
34
34
$ this ->stopwatch = Stopwatch::make ();
35
35
Original file line number Diff line number Diff line change 6
6
use Illuminate \Support \Arr ;
7
7
use InvalidArgumentException ;
8
8
9
- class DatabaseSyncConfiguration implements Arrayable
9
+ final class DatabaseSyncConfiguration implements Arrayable
10
10
{
11
11
const DROP_TABLES = 'dropTables ' ;
12
12
@@ -38,7 +38,7 @@ class DatabaseSyncConfiguration implements Arrayable
38
38
39
39
public static function make (array $ config = []): static
40
40
{
41
- return new static ($ config );
41
+ return new self ($ config );
42
42
}
43
43
44
44
public function __construct (array $ config )
You can’t perform that action at this time.
0 commit comments