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

Class: Standards

Source Location: /PHP_CodeSniffer-3.1.1/src/Util/Standards.php

Class Overview


Functions for helping process standards.


Author(s):

Copyright:

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

Methods


Inherited Variables

Inherited Methods


Class Details

[line 14]
Functions for helping process standards.


[ Top ]


Method Detail

getInstalledStandardDetails   [line 73]

array getInstalledStandardDetails( [boolean $includeGeneric = false], [string $standardsDir = ''])

Get the details of all coding standards installed.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a Sniffs subdirectory.

The details returned for each standard are:

  • path: the path to the coding standard's main directory
  • name: the name of the coding standard, as sourced from the ruleset.xml file
  • namespace: the namespace used by the coding standard, as sourced from the ruleset.xml file
If you only need the paths to the installed standards, use getInstalledStandardPaths() instead as it performs less work to retrieve coding standard names.

  • See: getInstalledStandardPaths()
  • Access: public

Parameters:

boolean   $includeGeneric   —  If true, the special "Generic" coding standard will be included if installed.
string   $standardsDir   —  A specific directory to look for standards in. If not specified, PHP_CodeSniffer will look in its default locations.

[ Top ]

getInstalledStandardPath   [line 262]

string|null getInstalledStandardPath( string $standard)

Return the path of an installed coding standard.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a ruleset.xml file.

  • Access: public

Parameters:

string   $standard   —  The name of the coding standard.

[ Top ]

getInstalledStandardPaths   [line 23]

array getInstalledStandardPaths( )

Get a list paths where standards are installed.
  • Access: public

[ Top ]

getInstalledStandards   [line 158]

array getInstalledStandards( [boolean $includeGeneric = false], [string $standardsDir = ''])

Get a list of all coding standards installed.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a Sniffs subdirectory.

  • See: isInstalledStandard()
  • Access: public

Parameters:

boolean   $includeGeneric   —  If true, the special "Generic" coding standard will be included if installed.
string   $standardsDir   —  A specific directory to look for standards in. If not specified, PHP_CodeSniffer will look in its default locations.

[ Top ]

isInstalledStandard   [line 219]

boolean isInstalledStandard( string $standard)

Determine if a standard is installed.

Coding standards are directories located in the CodeSniffer/Standards directory. Valid coding standards include a ruleset.xml file.

  • See: getInstalledStandards()
  • Access: public

Parameters:

string   $standard   —  The name of the coding standard.

[ Top ]

printInstalledStandards   [line 301]

void printInstalledStandards( )

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

[ Top ]


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