class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface

TwigExtractor extracts translation messages from a twig template.

Methods

array
extractFiles(string|array $resource)

No description

bool
isFile(string $file)

No description

bool
canBeExtracted(string $file)

No description

array
extractFromDirectory(string|array $directory)

No description

__construct(Environment $twig)

No description

extract(string|array $resource, MessageCatalogue $catalogue)

Extracts translation messages from files, a file or a directory to the catalogue.

setPrefix(string $prefix)

Sets the prefix that should be used for new found messages.

extractTemplate($template, MessageCatalogue $catalogue)

No description

Details

in AbstractFileExtractor at line 28
protected array extractFiles(string|array $resource)

Parameters

string|array $resource Files, a file or a directory

Return Value

array

in AbstractFileExtractor at line 58
protected bool isFile(string $file)

Parameters

string $file

Return Value

bool

Exceptions

InvalidArgumentException

at line 103
protected bool canBeExtracted(string $file)

Parameters

string $file

Return Value

bool

at line 113
protected array extractFromDirectory(string|array $directory)

Parameters

string|array $directory

Return Value

array files to be extracted

at line 47
__construct(Environment $twig)

Parameters

Environment $twig

at line 55
extract(string|array $resource, MessageCatalogue $catalogue)

Extracts translation messages from files, a file or a directory to the catalogue.

Parameters

string|array $resource Files, a file or a directory
MessageCatalogue $catalogue The catalogue

at line 79
setPrefix(string $prefix)

Sets the prefix that should be used for new found messages.

Parameters

string $prefix The prefix

at line 84
protected extractTemplate($template, MessageCatalogue $catalogue)

Parameters

$template
MessageCatalogue $catalogue