@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.
@drzraf I've refactored your code to be more aligned with the gettext code.
TwigFunctionsScanner
responsability is just extract the functions in the code.TwigScanner
is a generical scanner for twig templatesTimberScanner
extendsTwigScanner
and has the handlers for the specific timber functions. I think this code should be moved to a different repositoryphp-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.