Skip to content

Refactored Twig scanner#1

Merged
drzraf merged 2 commits intomasterfrom
refactor
May 1, 2020
Merged

Refactored Twig scanner#1
drzraf merged 2 commits intomasterfrom
refactor

Conversation

@oscarotero
Copy link
Member

@drzraf I've refactored your code to be more aligned with the gettext code.

  • The TwigFunctionsScanner responsability is just extract the functions in the code.
  • TwigScanner is a generical scanner for twig templates
  • TimberScanner extends TwigScanner and has the handlers for the specific timber functions. I think this code should be moved to a different repository php-gettext/timber-scanner, but we can keep it here for now, for convenience.

The tests are failing. I'm not very familiarized with Timber or Twig, so just provided a basic structured code as basis.

- Get the tests to pass again.
- Use twig PSR4
- Fix a couple of renamed variables in TwigFunctionsScanner
@drzraf
Copy link
Collaborator

drzraf commented May 1, 2020

That's indeed way cleaner now.
Added a couple of fixes. Testsuite green again.

@drzraf drzraf merged commit d9c4d6c into master May 1, 2020
@drzraf
Copy link
Collaborator

drzraf commented May 1, 2020

sorry to ask, but btw could you please grant me back the admin role on the repository.

@oscarotero
Copy link
Member Author

Yes, sorry. You're admin now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants