Skip to content
Prev Previous commit
Next Next commit
Suppress psalm errors
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Feb 15, 2022
commit ebe7931802427e414556d0d4d90c81f7fb63a66d
16 changes: 16 additions & 0 deletions lib/Service/UserMigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class UserMigrationService {

protected ContainerInterface $container;

// Allow use of the private Coordinator class here to get and run registered migrators
/**
* @psalm-suppress UndefinedClass
*/
protected Coordinator $coordinator;

public function __construct(
Expand All @@ -68,6 +72,9 @@ public function __construct(
ITempManager $tempManager,
IUserManager $userManager,
ContainerInterface $container,
/**
* @psalm-suppress UndefinedClass
*/
Coordinator $coordinator
) {
$this->root = $rootFolder;
Expand All @@ -76,6 +83,9 @@ public function __construct(
$this->tempManager = $tempManager;
$this->userManager = $userManager;
$this->container = $container;
/**
* @psalm-suppress UndefinedClass
*/
$this->coordinator = $coordinator;
}

Expand Down Expand Up @@ -126,6 +136,9 @@ public function export(IUser $user, ?OutputInterface $output = null): string {
);

// Run exports of registered migrators
/**
* @psalm-suppress UndefinedClass
*/
$context = $this->coordinator->getRegistrationContext();

if ($context !== null) {
Expand Down Expand Up @@ -156,6 +169,9 @@ public function import(string $path, ?OutputInterface $output = null): void {
$this->importFiles($user, $importSource, $output);

// Run imports of registered migrators
/**
* @psalm-suppress UndefinedClass
*/
$context = $this->coordinator->getRegistrationContext();

if ($context !== null) {
Expand Down