Class lajax\projectscanner\Scanner

Inheritancelajax\projectscanner\Scanner » yii\base\Component
Uses Traitslajax\projectscanner\ConsoleOutputTrait
Available since version1.0

Scanner component for scanning project, detecting new language elements

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$ignoredCategories array List of the categories being ignored. lajax\projectscanner\Scanner
$ignoredItems array Directories/files being ignored. lajax\projectscanner\Scanner
$patterns array List of file extensions that contain language elements. lajax\projectscanner\Scanner
$roots array The root directory of the scanning. lajax\projectscanner\Scanner
$scanTimeLimit integer The max_execution_time used when scanning, when set to null the default max_execution_time will not be modified. lajax\projectscanner\Scanner
$scanners lajax\projectscanner\scanners\ScannerInterface lajax\projectscanner\Scanner

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addLanguageItem() Adding language elements to the array. lajax\projectscanner\Scanner
addLanguageItems() Adding language elements to the array. lajax\projectscanner\Scanner
execute() Scanning project for text not stored in database. lajax\projectscanner\Scanner
init() lajax\projectscanner\Scanner
isColorEnabled() Returns a value indicating whether ANSI color is enabled. lajax\projectscanner\ConsoleOutputTrait
loadScanner() Loads the scanner with the specified ID. lajax\projectscanner\Scanner
stderr() Prints a string to STDERR lajax\projectscanner\ConsoleOutputTrait
stdout() Prints a string to STDOUT lajax\projectscanner\ConsoleOutputTrait

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
coreScanners() Returns the list of the core scanner configurations. lajax\projectscanner\Scanner
initRoots() Initializing the root directories of the scaning. lajax\projectscanner\Scanner

Property Details

$ignoredCategories public property

List of the categories being ignored.

$ignoredItems public property

Directories/files being ignored.

public array $ignoredItems = ['.svn''.git''.gitignore''.gitkeep''.hgignore''.hgkeep''/messages''/BaseYii.php''runtime''bower''nikic']
$patterns public property

List of file extensions that contain language elements. Only files with these extensions will be processed.

public array $patterns = ['*.php''*.js']
$roots public property

The root directory of the scanning.

public array $roots null
$scanTimeLimit public property

The max_execution_time used when scanning, when set to null the default max_execution_time will not be modified.

public integer $scanTimeLimit null
$scanners public property

Method Details

addLanguageItem() public method

Adding language elements to the array.

public void addLanguageItem ( $category, $message )
$category string

Category of the language element.

$message string

The languageElement.

addLanguageItems() public method

Adding language elements to the array.

public void addLanguageItems ( $languageItems )
$languageItems array

Example:

[
     [
         'category' => 'language',
         'message' => 'Active'
     ],
     [
         'category' => 'language',
         'message' => 'Inactive'
     ],
]
coreScanners() protected method

Returns the list of the core scanner configurations.

protected array coreScanners ( )
return array

The list of the core scanner configurations.

execute() public method

Scanning project for text not stored in database.

public lajax\projectscanner\ScanResult execute ( )
init() public method

public void init ( )
initRoots() protected method

Initializing the root directories of the scaning.

protected void initRoots ( )
loadScanner() public method

Loads the scanner with the specified ID.

public lajax\projectscanner\scanners\ScannerInterface loadScanner ( $id )
$id string

The ID of the scanner to be loaded.

return lajax\projectscanner\scanners\ScannerInterface

The loaded scanner

throws \lajax\projectscanner\NotFoundHttpException