PHP Класс PHPMD\TextUI\CommandLineOptions

Автор: Manuel Pichler ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$availableRuleSets array(string) List of available rule-sets.
$coverageReport string File name of a PHPUnit code coverage report.
$extensions string A string of comma-separated extensions for valid php source code filenames.
$ignore string A string of comma-separated pattern that is used to exclude directories.
$ignoreViolationsOnExit boolean Should PHPMD exit without error code even if violation is found?
$inputPath string A php source code filename or directory.
$minimumPriority integer The minimum rule priority.
$reportFile string An optional filename for the generated report.
$reportFiles array Additional report files.
$reportFormat string The specified report format.
$ruleSets string A ruleset filename or a comma-separated string of ruleset filenames.
$strict boolean Should PHPMD run in strict mode?
$version boolean Should the shell show the current phpmd version?

Открытые методы

Метод Описание
__construct ( array $args, array $availableRuleSets = [] ) Constructs a new command line options instance.
createRenderer ( string $reportFormat = null ) : PHPMD\AbstractRenderer Creates a report renderer instance based on the user's command line argument.
getCoverageReport ( ) : string Returns the file name of a supplied code coverage report or NULL if the user has not supplied the --coverage option.
getExtensions ( ) : string Returns a string of comma-separated extensions for valid php source code filenames or null when this argument was not set.
getIgnore ( ) : string Returns string of comma-separated pattern that is used to exclude directories or null when this argument was not set.
getInputPath ( ) : string Returns a php source code filename or directory.
getMinimumPriority ( ) : integer Returns the minimum rule priority.
getReportFile ( ) : string Returns the output filename for a generated report or null when the report should be displayed in STDOUT.
getReportFiles ( ) : array Returns a hash with report files specified for different renderers. The key represents the report format and the value the report file location.
getReportFormat ( ) : string Returns the specified report format.
getRuleSets ( ) : string Returns a ruleset filename or a comma-separated string of ruleset
hasStrict ( ) : boolean Was the --strict option passed to PHPMD's command line interface?
hasVersion ( ) : boolean Was the --version passed to PHPMD's command line interface?
ignoreViolationsOnExit ( ) : boolean Was the --ignore-violations-on-exit passed to PHPMD's command line interface?
usage ( ) : string Returns usage information for the PHPMD command line interface.

Защищенные методы

Метод Описание
createCustomRenderer ( ) : PHPMD\AbstractRenderer
createHtmlRenderer ( ) : PHPMD\Renderer\HTMLRenderer
createTextRenderer ( ) : XMLRenderer
createXmlRenderer ( ) : XMLRenderer
logDeprecated ( string $deprecatedName, string $newName ) : void Logs a deprecated option to the current user interface.
readInputFile ( string $inputFile ) : string This method takes the given input file, reads the newline separated paths from that file and creates a comma separated string of the file paths. If the given $inputFile not exists, this method will throw an exception.

Описание методов

__construct() публичный Метод

Constructs a new command line options instance.
public __construct ( array $args, array $availableRuleSets = [] )
$args array
$availableRuleSets array

createCustomRenderer() защищенный Метод

protected createCustomRenderer ( ) : PHPMD\AbstractRenderer
Результат PHPMD\AbstractRenderer

createHtmlRenderer() защищенный Метод

protected createHtmlRenderer ( ) : PHPMD\Renderer\HTMLRenderer
Результат PHPMD\Renderer\HTMLRenderer

createRenderer() публичный Метод

Valid renderers are:
  • xml
  • html
  • text
public createRenderer ( string $reportFormat = null ) : PHPMD\AbstractRenderer
$reportFormat string
Результат PHPMD\AbstractRenderer

createTextRenderer() защищенный Метод

protected createTextRenderer ( ) : XMLRenderer
Результат PHPMD\Renderer\XMLRenderer

createXmlRenderer() защищенный Метод

protected createXmlRenderer ( ) : XMLRenderer
Результат PHPMD\Renderer\XMLRenderer

getCoverageReport() публичный Метод

Returns the file name of a supplied code coverage report or NULL if the user has not supplied the --coverage option.
public getCoverageReport ( ) : string
Результат string

getExtensions() публичный Метод

Returns a string of comma-separated extensions for valid php source code filenames or null when this argument was not set.
public getExtensions ( ) : string
Результат string

getIgnore() публичный Метод

Returns string of comma-separated pattern that is used to exclude directories or null when this argument was not set.
public getIgnore ( ) : string
Результат string

getInputPath() публичный Метод

Returns a php source code filename or directory.
public getInputPath ( ) : string
Результат string

getMinimumPriority() публичный Метод

Returns the minimum rule priority.
public getMinimumPriority ( ) : integer
Результат integer

getReportFile() публичный Метод

Returns the output filename for a generated report or null when the report should be displayed in STDOUT.
public getReportFile ( ) : string
Результат string

getReportFiles() публичный Метод

Returns a hash with report files specified for different renderers. The key represents the report format and the value the report file location.
public getReportFiles ( ) : array
Результат array

getReportFormat() публичный Метод

Returns the specified report format.
public getReportFormat ( ) : string
Результат string

getRuleSets() публичный Метод

Returns a ruleset filename or a comma-separated string of ruleset
public getRuleSets ( ) : string
Результат string

hasStrict() публичный Метод

Was the --strict option passed to PHPMD's command line interface?
С версии: 1.2.0
public hasStrict ( ) : boolean
Результат boolean

hasVersion() публичный Метод

Was the --version passed to PHPMD's command line interface?
public hasVersion ( ) : boolean
Результат boolean

ignoreViolationsOnExit() публичный Метод

Was the --ignore-violations-on-exit passed to PHPMD's command line interface?
public ignoreViolationsOnExit ( ) : boolean
Результат boolean

logDeprecated() защищенный Метод

Logs a deprecated option to the current user interface.
protected logDeprecated ( string $deprecatedName, string $newName ) : void
$deprecatedName string
$newName string
Результат void

readInputFile() защищенный Метод

This method takes the given input file, reads the newline separated paths from that file and creates a comma separated string of the file paths. If the given $inputFile not exists, this method will throw an exception.
С версии: 1.1.0
protected readInputFile ( string $inputFile ) : string
$inputFile string Specified input file name.
Результат string

usage() публичный Метод

Returns usage information for the PHPMD command line interface.
public usage ( ) : string
Результат string

Описание свойств

$availableRuleSets защищенное свойство

List of available rule-sets.
protected array(string) $availableRuleSets
Результат array(string)

$coverageReport защищенное свойство

File name of a PHPUnit code coverage report.
protected string $coverageReport
Результат string

$extensions защищенное свойство

A string of comma-separated extensions for valid php source code filenames.
protected string $extensions
Результат string

$ignore защищенное свойство

A string of comma-separated pattern that is used to exclude directories.
protected string $ignore
Результат string

$ignoreViolationsOnExit защищенное свойство

Should PHPMD exit without error code even if violation is found?
protected bool $ignoreViolationsOnExit
Результат boolean

$inputPath защищенное свойство

A php source code filename or directory.
protected string $inputPath
Результат string

$minimumPriority защищенное свойство

The minimum rule priority.
protected int $minimumPriority
Результат integer

$reportFile защищенное свойство

An optional filename for the generated report.
protected string $reportFile
Результат string

$reportFiles защищенное свойство

Additional report files.
protected array $reportFiles
Результат array

$reportFormat защищенное свойство

The specified report format.
protected string $reportFormat
Результат string

$ruleSets защищенное свойство

A ruleset filename or a comma-separated string of ruleset filenames.
protected string $ruleSets
Результат string

$strict защищенное свойство

Should PHPMD run in strict mode?
С версии: 1.2.0
protected bool $strict
Результат boolean

$version защищенное свойство

Should the shell show the current phpmd version?
protected bool $version
Результат boolean