PHP_CodeSniffer_File::getWarnings PHP Method

getWarnings() public method

Returns the warnings raised from processing this file.
public getWarnings ( ) : array
return array
    public function getWarnings()
    {
        return $this->_warnings;
    }

Usage Example

Ejemplo n.º 1
0
 public function cswExecute()
 {
     // PHP_CodeSniffer - silent prepare
     ob_start();
     $this->setTokenListeners($this->cswStandard, array());
     $this->populateCustomRules();
     $this->populateTokenListeners();
     $tlisteners = $this->getTokenSniffs();
     ob_end_clean();
     // PHP_CodeSniffer - silent process each item and collect results
     foreach ($this->cswData as $index => $item) {
         ob_start();
         $pcsFile = new PHP_CodeSniffer_File('', $tlisteners['file'], $this->allowedFileExtensions, $this->ruleset, $this);
         $pcsFile->start($item['code']);
         $this->cswData[$index]['output'] = $this->storeOutput ? ob_get_contents() : 'output disabled';
         ob_end_clean();
         // free some memory
         unset($this->cswData[$index]['code']);
         // prepare full report
         $this->cswData[$index]['messages'] = $this->mergeMessages($pcsFile->getErrors(), $pcsFile->getWarnings(), $item['code_lines']);
         // prepare report for lines
         $this->cswData[$index]['report_for_lines'] = $this->createReportForLines($this->cswData[$index]);
     }
     // return data
     return $this->cswData;
 }
All Usage Examples Of PHP_CodeSniffer_File::getWarnings