Skip to content

Commit 5034731

Browse files
committed
Pass the filesystem as dependency and remove the Contao 3 migrations
1 parent 51fb5c7 commit 5034731

File tree

5 files changed

+9
-192
lines changed

5 files changed

+9
-192
lines changed

core-bundle/src/Migration/Version303/Version330Update.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

core-bundle/src/Migration/Version305/Version350Update.php

Lines changed: 0 additions & 81 deletions
This file was deleted.

core-bundle/src/Migration/Version408/Version480Update.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@ class Version480Update extends AbstractMigration
2929
*/
3030
private $connection;
3131

32+
/**
33+
* @var Filesystem
34+
*/
35+
private $filesystem;
36+
3237
/**
3338
* @var string
3439
*/
3540
private $projectDir;
3641

37-
public function __construct(Connection $connection, string $projectDir)
42+
public function __construct(Connection $connection, Filesystem $filesystem, string $projectDir)
3843
{
3944
$this->connection = $connection;
45+
$this->filesystem = $filesystem;
4046
$this->projectDir = $projectDir;
4147
}
4248

@@ -154,7 +160,7 @@ public function run(): MigrationResult
154160

155161
// Convert the important part to relative values as fractions
156162
while (false !== ($file = $statement->fetch(\PDO::FETCH_OBJ))) {
157-
if (!(new Filesystem())->exists($this->projectDir.'/'.$file->path) || is_dir($this->projectDir.'/'.$file->path)) {
163+
if (!$this->filesystem->exists($this->projectDir.'/'.$file->path) || is_dir($this->projectDir.'/'.$file->path)) {
158164
continue;
159165
}
160166

core-bundle/src/Resources/config/migrations.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ services:
44

55
Contao\CoreBundle\Migration\MigrationCollection: ~
66

7-
Contao\CoreBundle\Migration\Version303\Version330Update:
8-
arguments:
9-
- '@database_connection'
10-
11-
Contao\CoreBundle\Migration\Version305\Version350Update:
12-
arguments:
13-
- '@database_connection'
14-
157
Contao\CoreBundle\Migration\Version400\Version400Update:
168
arguments:
179
- '@database_connection'
@@ -52,6 +44,7 @@ services:
5244
Contao\CoreBundle\Migration\Version408\Version480Update:
5345
arguments:
5446
- '@database_connection'
47+
- '@filesystem'
5548
- '%kernel.project_dir%'
5649

5750
Contao\CoreBundle\Migration\Version409\CeAccessMigration:

phpstan.neon.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ parameters:
2727
# Ignore the missing TL_SCRIPT constant in the InitializeController class
2828
- '#Constant TL_SCRIPT not found\.#'
2929

30-
# Ignore the missing array_insert function in the Version330Update class
31-
- '#Function array_insert not found\.#'
32-
3330
# Ignore backwards compatibility layers when preferring lowest dependencies
3431
- '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\.#'
3532

0 commit comments

Comments
 (0)