Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(symfony-upgrade): update command signatures, replace obsolet… #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Command/PullCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ protected function getCommandDescription(): string
return self::COMMAND_DESCRIPTION;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->handlePullDisplay($output);
$this->translationService->pull(
$input->getOption('filePath'),
$input->getOption('locale')
);

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/PushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ protected function getCommandDescription(): string
return self::COMMAND_DESCRIPTION;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->handlePushDisplay($output);
$this->translationService->push(
$input->getOption('filePath'),
$input->getOption('locale')
);

return 0;
}
}
4 changes: 3 additions & 1 deletion Command/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ protected function getCommandDescription(): string
return self::COMMAND_DESCRIPTION;
}

protected function execute(InputInterface $input, OutputInterface $output): void
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln("<info>Updating translations</info>\n");
$this->handlePullDisplay($output);
$this->handlePushDisplay($output);
$this->translationService->update();

return 0;
}
}
2 changes: 1 addition & 1 deletion Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<argument type="string">%openclassrooms_onesky.file_format%</argument>
</call>
<call method="setKernelRootDir">
<argument type="string">%kernel.root_dir%</argument>
<argument type="string">%kernel.project_dir%</argument>
</call>
<call method="setProjectId">
<argument type="string">%openclassrooms_onesky.project_id%</argument>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Command/CommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function getContainer()
'openclassrooms_onesky.file_paths' => [self::$filePaths],
'openclassrooms_onesky.requestedLocales' => self::$locales,
'openclassrooms_onesky.project_id' => self::$projectId,
'kernel.root_dir' => __DIR__.'/../',
'kernel.project_dir' => __DIR__.'/../',
],
[
'openclassrooms.onesky.services.language_service' => new LanguageServiceMock(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function container_compile()

$bundle->build($container);

$container->setParameter('kernel.root_dir', __DIR__.'/../../');
$container->setParameter('kernel.project_dir', __DIR__.'/../../');
$container->compile();
$this->assertTrue($container->isFrozen());
}
Expand Down