PHP_CodeSniffer
[ class tree: PHP_CodeSniffer ] [ index: PHP_CodeSniffer ] [ all elements ]

Class: PHP_CodeSniffer_CLI

Source Location: /PHP_CodeSniffer-1.5.2/CodeSniffer/CLI.php

Class Overview


A class to process command line phpcs scripts.


Author(s):

Version:

  • Release: 1.5.2

Copyright:

  • 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 32]
A class to process command line phpcs scripts.


[ Top ]


Class Variables

$dieOnUnknownArg =  true

[line 64]

Whether or not to kill the process when an unknown command line arg is found.

If FALSE, arguments that are not command line options or file/directory paths will be ignored and execution will continue.

  • Access: public

Type:   bool


[ Top ]

$errorSeverity =  0

[line 47]

The minimum severity level errors must have to be displayed.
  • Access: public

Type:   bool


[ Top ]

$values = array()

[line 40]

An array of all values specified on the command line.
  • Access: protected

Type:   array


[ Top ]

$warningSeverity =  0

[line 54]

The minimum severity level warnings must have to be displayed.
  • Access: public

Type:   bool


[ Top ]



Method Detail

checkRequirements   [line 72]

array checkRequirements( )

Exits if the minimum requirements of PHP_CodSniffer are not met.
  • Access: public

[ Top ]

explainStandard   [line 757]

void explainStandard( string $standard)

Prints a report showing the sniffs contained in a standard.
  • Access: public

Parameters:

string   $standard   —  The standard to validate.

[ Top ]

getCommandLineValues   [line 179]

array getCommandLineValues( )

Process the command line arguments and returns the values.
  • Access: public

[ Top ]

getDefaults   [line 93]

array getDefaults( )

Get a list of default values for all possible command line arguments.
  • Access: public

[ Top ]

printErrorReport   [line 654]

int printErrorReport( PHP_CodeSniffer $phpcs, array $reports, bool $showSources, string $reportFile, int $reportWidth)

Prints the error report for the run.

Note that this function may actually print multiple reports as the user may have specified a number of output formats.

  • Return: The number of error and warning messages shown.
  • Access: public

Parameters:

PHP_CodeSniffer   $phpcs   —  The PHP_CodeSniffer object containing the errors.
array   $reports   —  A list of reports to print.
bool   $showSources   —  TRUE if report should show error sources (not used by all reports).
string   $reportFile   —  A default file to log report output to.
int   $reportWidth   —  How wide the screen reports should be.

[ Top ]

printInstalledStandards   [line 860]

void printInstalledStandards( )

Prints out a list of installed coding standards.
  • Access: public

[ Top ]

printUsage   [line 811]

void printUsage( )

Prints out the usage information for this script.
  • Access: public

[ Top ]

process   [line 515]

int process( [array $values = array()])

Runs PHP_CodeSniffer over files and directories.

Parameters:

array   $values   —  An array of values determined from CLI args.

[ Top ]

processLongArgument   [line 302]

array processLongArgument( string $arg, int $pos, array $values)

Processes a long (--example) command line argument.

Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.
array   $values   —  An array of values determined from CLI args.

[ Top ]

processShortArgument   [line 237]

array processShortArgument( string $arg, int $pos, array $values)

Processes a short (-e) command line argument.

Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.
array   $values   —  An array of values determined from CLI args.

[ Top ]

processUnknownArgument   [line 476]

array processUnknownArgument( string $arg, int $pos, array $values)

Processes an unknown command line argument.

Assumes all unknown arguments are files and folders to check.


Parameters:

string   $arg   —  The command line argument.
int   $pos   —  The position of the argument on the command line.
array   $values   —  An array of values determined from CLI args.

[ Top ]

validateStandard   [line 716]

array validateStandard( array $standards)

Convert the passed standards into valid standards.

Checks things like default values and case.

  • Access: public

Parameters:

array   $standards   —  The standards to validate.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:56:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.