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

Separate concerns on Translations::download #2

Open
csrui opened this issue Dec 21, 2020 · 0 comments · May be fixed by #10
Open

Separate concerns on Translations::download #2

csrui opened this issue Dec 21, 2020 · 0 comments · May be fixed by #10
Labels
enhancement New feature or request

Comments

@csrui
Copy link
Contributor

csrui commented Dec 21, 2020

The Translations::download method is currently handling transformation here and it shouldn't.

We can move this responsibility to a namespace Parsers. Here's a rough idea.

  1. Check if TwentySixB\Translations\Parsers\{$format} class exists.
  2. Initialize it with the parameters: $downloads, $config.
  3. Call parse method.
  4. Grab the return and save.

Given the existing example

https://github.com/26B/translation-helper/blob/fd960eb1fb34ae85637e669f27465891e7baa811/lib/Translations.php#L42

This method's logic

https://github.com/26B/translation-helper/blob/fd960eb1fb34ae85637e669f27465891e7baa811/lib/Translations.php#L101

would be refactored into TwentySixB\Translations\Parsers\Jed::parse

@csrui csrui added the enhancement New feature or request label Dec 21, 2020
@goncaloasimoes goncaloasimoes linked a pull request Dec 28, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant