src/Standards/BestIt/CodeSniffer/Helper/ExceptionHelper.php
public function handleException(CodeWarning $exception): bool
    {
        $isError = $exception instanceof CodeError;
        $isFixable = $exception->isFixable();
        $method = 'add';

        if ($isFixable) {
            $method .= 'Fixable';
        }

        $method .= $isError ? 'Error' : 'Warning';

        return $this->file->$method(
            $exception->getMessage(),
            $exception->getStackPosition(),
            $exception->getCode(),
            $exception->getPayload()
        );
    }
public function handleException(CodeWarning $exception): bool
    {
        $isError = $exception instanceof CodeError;
        $isFixable = $exception->isFixable();
        $method = 'add';

        if ($isFixable) {
            $method .= 'Fixable';
        }

        $method .= $isError ? 'Error' : 'Warning';

        return $this->file->$method(
            $exception->getMessage(),
            $exception->getStackPosition(),
            $exception->getCode(),
            $exception->getPayload()
        );
    }
public function handleException ( CodeWarning $ exception ) : bool { $ isError = $ exception instanceof CodeError ; $ isFixable = $ exception -> isFixable ( ) ; $ method = 'add' ; if ( $ isFixable ) { $ method .= 'Fixable' ; } $ method .= $ isError ? 'Error' : 'Warning' ; return $ this -> file -> $ method ( $ exception -> getMessage ( ) , $ exception -> getStackPosition ( ) , $ exception -> getCode ( ) , $ exception -> getPayload ( ) ) ; }
Registers the exception as an error or warning on the file.

@param CodeWarning $exception The error which should be handled.

@return bool Should this error be fixed?
Registers the exception as an error or warning on the file .