change private to protected
This commit is contained in:
parent
c08d34ead9
commit
bdb7350994
1 changed files with 9 additions and 6 deletions
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue