PHP Class PHPMD\TextUI\CommandLineOptions

Author: Manuel Pichler ([email protected])
Afficher le fichier Open project: phpmd/phpmd Class Usage Examples

Protected Properties

Свойство Type Description
$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?

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

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

createCustomRenderer() protected méthode

protected createCustomRenderer ( ) : PHPMD\AbstractRenderer
Résultat PHPMD\AbstractRenderer

createHtmlRenderer() protected méthode

protected createHtmlRenderer ( ) : PHPMD\Renderer\HTMLRenderer
Résultat PHPMD\Renderer\HTMLRenderer

createRenderer() public méthode

Valid renderers are:
  • xml
  • html
  • text
public createRenderer ( string $reportFormat = null ) : PHPMD\AbstractRenderer
$reportFormat string
Résultat PHPMD\AbstractRenderer

createTextRenderer() protected méthode

protected createTextRenderer ( ) : XMLRenderer
Résultat PHPMD\Renderer\XMLRenderer

createXmlRenderer() protected méthode

protected createXmlRenderer ( ) : XMLRenderer
Résultat PHPMD\Renderer\XMLRenderer

getCoverageReport() public méthode

Returns the file name of a supplied code coverage report or NULL if the user has not supplied the --coverage option.
public getCoverageReport ( ) : string
Résultat string

getExtensions() public méthode

Returns a string of comma-separated extensions for valid php source code filenames or null when this argument was not set.
public getExtensions ( ) : string
Résultat string

getIgnore() public méthode

Returns string of comma-separated pattern that is used to exclude directories or null when this argument was not set.
public getIgnore ( ) : string
Résultat string

getInputPath() public méthode

Returns a php source code filename or directory.
public getInputPath ( ) : string
Résultat string

getMinimumPriority() public méthode

Returns the minimum rule priority.
public getMinimumPriority ( ) : integer
Résultat integer

getReportFile() public méthode

Returns the output filename for a generated report or null when the report should be displayed in STDOUT.
public getReportFile ( ) : string
Résultat string

getReportFiles() public méthode

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
Résultat array

getReportFormat() public méthode

Returns the specified report format.
public getReportFormat ( ) : string
Résultat string

getRuleSets() public méthode

Returns a ruleset filename or a comma-separated string of ruleset
public getRuleSets ( ) : string
Résultat string

hasStrict() public méthode

Was the --strict option passed to PHPMD's command line interface?
Since: 1.2.0
public hasStrict ( ) : boolean
Résultat boolean

hasVersion() public méthode

Was the --version passed to PHPMD's command line interface?
public hasVersion ( ) : boolean
Résultat boolean

ignoreViolationsOnExit() public méthode

Was the --ignore-violations-on-exit passed to PHPMD's command line interface?
public ignoreViolationsOnExit ( ) : boolean
Résultat boolean

logDeprecated() protected méthode

Logs a deprecated option to the current user interface.
protected logDeprecated ( string $deprecatedName, string $newName ) : void
$deprecatedName string
$newName string
Résultat void

readInputFile() protected méthode

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.
Since: 1.1.0
protected readInputFile ( string $inputFile ) : string
$inputFile string Specified input file name.
Résultat string

usage() public méthode

Returns usage information for the PHPMD command line interface.
public usage ( ) : string
Résultat string

Property Details

$availableRuleSets protected_oe property

List of available rule-sets.
protected array(string) $availableRuleSets
Résultat array(string)

$coverageReport protected_oe property

File name of a PHPUnit code coverage report.
protected string $coverageReport
Résultat string

$extensions protected_oe property

A string of comma-separated extensions for valid php source code filenames.
protected string $extensions
Résultat string

$ignore protected_oe property

A string of comma-separated pattern that is used to exclude directories.
protected string $ignore
Résultat string

$ignoreViolationsOnExit protected_oe property

Should PHPMD exit without error code even if violation is found?
protected bool $ignoreViolationsOnExit
Résultat boolean

$inputPath protected_oe property

A php source code filename or directory.
protected string $inputPath
Résultat string

$minimumPriority protected_oe property

The minimum rule priority.
protected int $minimumPriority
Résultat integer

$reportFile protected_oe property

An optional filename for the generated report.
protected string $reportFile
Résultat string

$reportFiles protected_oe property

Additional report files.
protected array $reportFiles
Résultat array

$reportFormat protected_oe property

The specified report format.
protected string $reportFormat
Résultat string

$ruleSets protected_oe property

A ruleset filename or a comma-separated string of ruleset filenames.
protected string $ruleSets
Résultat string

$strict protected_oe property

Should PHPMD run in strict mode?
Since: 1.2.0
protected bool $strict
Résultat boolean

$version protected_oe property

Should the shell show the current phpmd version?
protected bool $version
Résultat boolean