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

Class: Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff

Source Location: /PHP_CodeSniffer-2.7.1/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php

Class Overview

PEAR_Sniffs_Functions_FunctionDeclarationSniff
   |
   --Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff

Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff.


Author(s):

Version:

  • Release: 2.7.1

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods

Class: PEAR_Sniffs_Functions_FunctionDeclarationSniff

PEAR_Sniffs_Functions_FunctionDeclarationSniff::isMultiLineDeclaration()
Determine if this is a multi-line function declaration.
PEAR_Sniffs_Functions_FunctionDeclarationSniff::process()
Processes this test, when one of its tokens is encountered.
PEAR_Sniffs_Functions_FunctionDeclarationSniff::processMultiLineDeclaration()
Processes multi-line declarations.
PEAR_Sniffs_Functions_FunctionDeclarationSniff::processSingleLineDeclaration()
Processes single-line declarations.
PEAR_Sniffs_Functions_FunctionDeclarationSniff::register()
Returns an array of tokens this test wants to listen for.

Class Details

[line 33]
Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff.

Ensure single and multi-line function declarations are defined correctly.



[ Top ]


Class Variables

$supportedTokenizers = array(
                                   'PHP',
                                   'JS',
                                  )

[line 41]

A list of tokenizers this sniff supports.
  • Access: public

Type:   array


[ Top ]



Method Detail

isMultiLineDeclaration   [line 60]

void isMultiLineDeclaration( PHP_CodeSniffer_File $phpcsFile, int $stackPtr, int $openBracket, array $tokens)

Determine if this is a multi-line function declaration.
  • Access: public

Overrides PEAR_Sniffs_Functions_FunctionDeclarationSniff::isMultiLineDeclaration() (Determine if this is a multi-line function declaration.)

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.
int   $openBracket   —  The position of the opening bracket in the stack passed in $tokens.
array   $tokens   —  The stack of tokens that make up the file.

[ Top ]

processBracket   [line 168]

void processBracket( PHP_CodeSniffer_File $phpcsFile, int $openBracket, array $tokens, [string $type = 'function'])

Processes the contents of a single set of brackets.
  • Access: public

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $openBracket   —  The position of the open bracket in the stack passed in $tokens.
array   $tokens   —  The stack of tokens that make up the file.
string   $type   —  The type of the token the brackets belong to (function or use).

[ Top ]

processMultiLineDeclaration   [line 125]

void processMultiLineDeclaration( PHP_CodeSniffer_File $phpcsFile, int $stackPtr, array $tokens)

Processes multi-line declarations.
  • Access: public

Overrides PEAR_Sniffs_Functions_FunctionDeclarationSniff::processMultiLineDeclaration() (Processes multi-line declarations.)

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.
array   $tokens   —  The stack of tokens that make up the file.

[ Top ]


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