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

Class: Runner

Source Location: /PHP_CodeSniffer-3.1.1/src/Runner.php

Class Overview


Responsible for running PHPCS and PHPCBF.


Author(s):

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 24]
Responsible for running PHPCS and PHPCBF.

After creating an object of this class, you probably just want to call runPHPCS() or runPHPCBF().



[ Top ]


Class Variables

$config =  null

[line 32]

The config data for the run.
  • Access: public

Type:   \PHP_CodeSniffer\Config


[ Top ]

$reporter =  null

[line 46]

The reporter used for generating reports after the run.
  • Access: public

Type:   \PHP_CodeSniffer\Reporter


[ Top ]

$ruleset =  null

[line 39]

The ruleset used for the run.
  • Access: public

Type:   \PHP_CodeSniffer\Ruleset


[ Top ]



Method Detail

checkRequirements   [line 230]

array checkRequirements( )

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

[ Top ]

handleErrors   [line 555]

void handleErrors( int $code, string $message, string $file, int $line)

Converts all PHP errors into exceptions.

This method forces a sniff to stop processing if it is not able to handle a specific piece of code, instead of continuing and potentially getting into a loop.

  • Access: public

Parameters:

int   $code   —  The level of error raised.
string   $message   —  The error message.
string   $file   —  The path of the file that raised the error.
int   $line   —  The line number the error was raised at.

[ Top ]

init   [line 251]

void init( )

Init the rulesets and other high-level settings.
  • Access: public

[ Top ]

printProgress   [line 724]

void printProgress( File $file, int $numFiles, int $numProcessed)

Print progress information for a single processed file.

Parameters:

File   $file   —  The file that was processed.
int   $numFiles   —  The total number of files to process.
int   $numProcessed   —  The number of files that have been processed, including this one.

[ Top ]

processFile   [line 569]

void processFile( \PHP_CodeSniffer\Files\File $file)

Processes a single file, including checking and fixing.
  • Access: public

Parameters:

\PHP_CodeSniffer\Files\File   $file   —  The file to be processed.

[ Top ]

runPHPCBF   [line 154]

array runPHPCBF( )

Run the PHPCBF script.
  • Access: public

[ Top ]

runPHPCS   [line 54]

array runPHPCS( )

Run the PHPCS script.
  • Access: public

[ Top ]


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