protected function throwError(File $phpcsFile, $stackPtr, $type, $content = '')
    {
        $error     = static::ERROR_PHRASE;
        $phrase    = '';
        $errorCode = 'Found';

        if (isset($this->errorPhrases[$type]) === true) {
            $errorCode = $this->stringToErrorCode($type) . 'Found';
            $phrase    = $this->errorPhrases[$type];
        }

        $data = array($phrase);

        if (empty($content) === false) {
            $error .= ' Found: %s';
            $data[] = $content;
        }

        $phpcsFile->addError($error, $stackPtr, $errorCode, $data);
    }
protected function throwError(File $phpcsFile, $stackPtr, $type, $content = '')
    {
        $error     = static::ERROR_PHRASE;
        $phrase    = '';
        $errorCode = 'Found';

        if (isset($this->errorPhrases[$type]) === true) {
            $errorCode = $this->stringToErrorCode($type) . 'Found';
            $phrase    = $this->errorPhrases[$type];
        }

        $data = array($phrase);

        if (empty($content) === false) {
            $error .= ' Found: %s';
            $data[] = $content;
        }

        $phpcsFile->addError($error, $stackPtr, $errorCode, $data);
    }
protected function throwError ( File $ phpcsFile , $ stackPtr , $ type , $ content = '' ) { $ error = static :: ERROR_PHRASE ; $ phrase = '' ; $ errorCode = 'Found' ; if ( isset ( $ this -> errorPhrases [ $ type ] ) === true ) { $ errorCode = $ this -> stringToErrorCode ( $ type ) . 'Found' ; $ phrase = $ this -> errorPhrases [ $ type ] ; } $ data = array ( $ phrase ) ; if ( empty ( $ content ) === false ) { $ error .= ' Found: %s' ; $ data [ ] = $ content ; } $ phpcsFile -> addError ( $ error , $ stackPtr , $ errorCode , $ data ) ; }
Throw an error if a scalar expression is found.

@param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                   $stackPtr  The position of the token to link the error to.
@param string                $type      Type of usage found.
@param string                $content   Optional. The value for the declaration as found.

@return void
Throw an error if a scalar expression is found .