Class lajax\translatemanager\services\scanners\ScannerPhpFunction

Inheritancelajax\translatemanager\services\scanners\ScannerPhpFunction » lajax\translatemanager\services\scanners\ScannerFile » yii\console\controllers\MessageController
Available since version1.0

Class for processing PHP files.

Language elements detected in PHP files: "t" functions:

::t('category of language element', 'language element');
::t('category of language element', 'language element {replace}', ['replace' => 'String']);
::t('category of language element', "language element");
::t('category of language element', "language element {replace}", ['replace' => 'String']);

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$files array Array to store patsh to project files. lajax\translatemanager\services\scanners\ScannerFile

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkTokens() lajax\translatemanager\services\scanners\ScannerFile
concatMessage() Recursice concatenation of multiple-piece language elements. lajax\translatemanager\services\scanners\ScannerPhpFunction
extractMessages() Extracts messages from a file lajax\translatemanager\services\scanners\ScannerFile
getLanguageItem() Returns language elements in the token buffer. lajax\translatemanager\services\scanners\ScannerPhpFunction
isValidCategory() Determines whether the category received as a parameter can be processed. lajax\translatemanager\services\scanners\ScannerFile

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
EXTENSION '*.php' Extension of PHP files. lajax\translatemanager\services\scanners\ScannerPhpFunction

Method Details

concatMessage() protected method

Recursice concatenation of multiple-piece language elements.

protected array concatMessage ( $buffer )
$buffer array

Array to store language element pieces.

return array

Sorted list of language element pieces.

getLanguageItem() protected method

Returns language elements in the token buffer.

If there are no recognisable language elements in the array, returns null

protected array|null getLanguageItem ( $buffer )
$buffer array
run() public method

Start scanning PHP files.

public void run ( $route, $params = [] )
$route string
$params array