Class lajax\projectscanner\scanners\PhpFunctionScanner

Inheritancelajax\projectscanner\scanners\PhpFunctionScanner » lajax\projectscanner\scanners\FileScannerAbstract » yii\base\Object
Implementslajax\projectscanner\scanners\ScannerInterface
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']);

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$extension string Extension of PHP files. lajax\projectscanner\scanners\FileScannerAbstract
$scanner lajax\projectscanner\Scanner Object containing the detected language elements lajax\projectscanner\scanners\FileScannerAbstract
$translators array List of the PHP function for translating messages. lajax\projectscanner\scanners\PhpFunctionScanner

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$files array Array to store paths to project files. lajax\projectscanner\scanners\FileScannerAbstract

Public Methods

Hide inherited methods

MethodDescriptionDefined By
execute() Start scanning PHP files. lajax\projectscanner\scanners\PhpFunctionScanner
scanProject() Scanning project filesistem. lajax\projectscanner\scanners\FileScannerAbstract

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkTokens() lajax\projectscanner\scanners\FileScannerAbstract
concatMessage() Recursice concatenation of multiple-piece language elements. lajax\projectscanner\scanners\PhpFunctionScanner
containsTranslator() Determines whether the file has any of the translators. lajax\projectscanner\scanners\FileScannerAbstract
extractMessages() Extracts messages from a file lajax\projectscanner\scanners\FileScannerAbstract
getLanguageItem() Returns language elements in the token buffer. lajax\projectscanner\scanners\PhpFunctionScanner
isValidCategory() Determines whether the category received as a parameter can be processed. lajax\projectscanner\scanners\FileScannerAbstract
tokensEqual() Finds out if two PHP tokens are equal lajax\projectscanner\scanners\FileScannerAbstract

Property Details

$translators public property

List of the PHP function for translating messages.

public array $translators = ['::t']

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.

execute() public method

Start scanning PHP files.

public void execute ( )
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