Skip to content

Commit

Permalink
fix run sync action
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrajodas committed Aug 14, 2024
1 parent e365d94 commit e8c2e9a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ protected function run(): void
$config = $this->getConfig();

$application = new Application($config, $this->getLogger());
$application->run();
}

switch ($config->getAction()) {
case 'run':
$application->run();
break;
case 'generate-read-credentials':
echo json_encode($application->generateReadCredentials());
break;
}
public function generateReadCredentialsAction(): array
{
/** @var Config $config */
$config = $this->getConfig();
$application = new Application($config, $this->getLogger());

return $application->generateReadCredentials();
}

protected function getSyncActions(): array
{
return [
'generate-read-credentials' => 'generateReadCredentialsAction',
];
}

protected function getConfigClass(): string
Expand Down

0 comments on commit e8c2e9a

Please sign in to comment.