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

Class: MultiLineFunctionDeclarationSniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php

Class Overview

PEARFunctionDeclarationSniff
   |
   --MultiLineFunctionDeclarationSniff

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


Author(s):

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Class Variables

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

[line 23]

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

Type:   array


[ Top ]



Method Detail

isMultiLineDeclaration   [line 42]

void isMultiLineDeclaration( \PHP_CodeSniffer\Files\File $phpcsFile, int $stackPtr, int $openBracket, array $tokens)

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

Parameters:

\PHP_CodeSniffer\Files\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 150]

void processBracket( \PHP_CodeSniffer\Files\File $phpcsFile, int $openBracket, array $tokens, [string $type = 'function'])

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

Parameters:

\PHP_CodeSniffer\Files\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 107]

void processMultiLineDeclaration( \PHP_CodeSniffer\Files\File $phpcsFile, int $stackPtr, array $tokens)

Processes multi-line declarations.
  • Access: public

Parameters:

\PHP_CodeSniffer\Files\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 15:27:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.