1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

change private to protected

This commit is contained in:
fogelito 2024-05-28 19:50:37 +03:00
parent c08d34ead9
commit bdb7350994

View file

@ -30,8 +30,8 @@ use Utopia\Queue\Message;
class Migrations extends Action class Migrations extends Action
{ {
private ?Database $dbForProject = null; protected ?Database $dbForProject = null;
private ?Database $dbForConsole = null; protected ?Database $dbForConsole = null;
public static function getName(): string public static function getName(): string
{ {
@ -93,13 +93,15 @@ class Migrations extends Action
} }
/** /**
* @param string $source * @param Document $document
* @param array $credentials
* @return Source * @return Source
* @throws Exception * @throws Exception
*/ */
protected function processSource(string $source, array $credentials): Source protected function processSource(Document $document): Source
{ {
$source = $document->getAttribute('source');
$credentials = $document->getAttribute('credentials');
return match ($source) { return match ($source) {
Firebase::getName() => new Firebase( Firebase::getName() => new Firebase(
json_decode($credentials['serviceAccount'], true), json_decode($credentials['serviceAccount'], true),
@ -263,7 +265,8 @@ class Migrations extends Action
$log->addTag('type', $migrationDocument->getAttribute('source')); $log->addTag('type', $migrationDocument->getAttribute('source'));
$source = $this->processSource($migrationDocument->getAttribute('source'), $migrationDocument->getAttribute('credentials')); //$source = $this->processSource($migrationDocument->getAttribute('source'), $migrationDocument->getAttribute('credentials'));
$source = $this->processSource($migrationDocument);
$source->report(); $source->report();