Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data Fields | Protected Member Functions
OutputBufferingSniff Class Reference
Inheritance diagram for OutputBufferingSniff:

Data Fields

 $forbiddenFunctions = ['ob_start' => null]
 

Protected Member Functions

 addError ($phpcsFile, $stackPtr, $function, $pattern=null)
 

Detailed Description

Sniff prohibiting usage of output buffering functions.

Definition at line 12 of file OutputBufferingSniff.php.

Member Function Documentation

◆ addError()

addError (   $phpcsFile,
  $stackPtr,
  $function,
  $pattern = null 
)
protected

Definition at line 19 of file OutputBufferingSniff.php.

20  {
21  $data = [$function];
22  $error = 'The usage of %s() is forbidden';
23  $type = 'Found';
24 
25  if ($this->error === true) {
26  $phpcsFile->addError($error, $stackPtr, $type, $data);
27  } else {
28  $phpcsFile->addWarning($error, $stackPtr, $type, $data);
29  }
30  }
$type
Definition: item.phtml:13

Field Documentation

◆ $forbiddenFunctions

$forbiddenFunctions = ['ob_start' => null]

Definition at line 14 of file OutputBufferingSniff.php.


The documentation for this class was generated from the following file: