PhpExtractor
class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
PhpExtractor extracts translation messages from a PHP template.
Constants
MESSAGE_TOKEN | |
METHOD_ARGUMENTS_TOKEN | |
DOMAIN_TOKEN | |
Properties
protected array | $sequences | The sequence that captures translation messages. | |
Methods
Details
Parameters
string|array | $resource | Files, a file or a directory |
Return Value
protected bool
isFile(string $file)
Parameters
Return Value
Exceptions
Parameters
Return Value
Exceptions
Parameters
Return Value
array | files to be extracted |
Extracts translation messages from files, a file or a directory to the catalogue.
Parameters
setPrefix(string $prefix)
Sets the prefix that should be used for new found messages.
Parameters
string | $prefix | The prefix |
protected string
normalizeToken(mixed $token)
Normalizes a token.
Parameters
Return Value
protected
parseTokens(array $tokens, MessageCatalogue $catalog)
Extracts trans message from PHP tokens.
Parameters