Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OutputBufferingSniff.php
Go to the documentation of this file.
1 <?php
8 
12 class OutputBufferingSniff extends \PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff
13 {
14  public $forbiddenFunctions = ['ob_start' => null];
15 
19  protected function addError($phpcsFile, $stackPtr, $function, $pattern = null)
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  }
31 }
$pattern
Definition: website.php:22
$type
Definition: item.phtml:13
addError($phpcsFile, $stackPtr, $function, $pattern=null)