protected function getFormattedMessageException(\Exception $exception)
    {
        if ($exception instanceof InvalidTypeException) {
            $attribute = $this->getExceptionAttribute($exception->getMessage());
            $attribute = substr($attribute, strrpos($attribute, '.') + 1);
            $message = sprintf('Invalid type for attribute "%s"', $attribute);
            $message .= substr($exception->getMessage(), strrpos($exception->getMessage(), '". ') + 1);

            return $message;
        }

        $attribute = $this->getExceptionAttribute($exception->getMessage());
        $message = sprintf('The attribute "%s" does not exist for the "%s" tag', $attribute, $this->getTag());
        $validNode = $this->getAttributeNodeConfig();

        if ($validNode instanceof ArrayNode) {
            $message .= sprintf('. Only attributes "%s" are available', implode('", "', array_keys($validNode->getChildren())));
        }

        return $message;
    }
protected function getFormattedMessageException(\Exception $exception)
    {
        if ($exception instanceof InvalidTypeException) {
            $attribute = $this->getExceptionAttribute($exception->getMessage());
            $attribute = substr($attribute, strrpos($attribute, '.') + 1);
            $message = sprintf('Invalid type for attribute "%s"', $attribute);
            $message .= substr($exception->getMessage(), strrpos($exception->getMessage(), '". ') + 1);

            return $message;
        }

        $attribute = $this->getExceptionAttribute($exception->getMessage());
        $message = sprintf('The attribute "%s" does not exist for the "%s" tag', $attribute, $this->getTag());
        $validNode = $this->getAttributeNodeConfig();

        if ($validNode instanceof ArrayNode) {
            $message .= sprintf('. Only attributes "%s" are available', implode('", "', array_keys($validNode->getChildren())));
        }

        return $message;
    }
protected function getFormattedMessageException ( \ Exception $ exception ) { if ( $ exception instanceof InvalidTypeException ) { $ attribute = $ this -> getExceptionAttribute ( $ exception -> getMessage ( ) ) ; $ attribute = substr ( $ attribute , strrpos ( $ attribute , '.' ) + 1 ) ; $ message = sprintf ( 'Invalid type for attribute "%s"' , $ attribute ) ; $ message .= substr ( $ exception -> getMessage ( ) , strrpos ( $ exception -> getMessage ( ) , '". ' ) + 1 ) ; return $ message ; } $ attribute = $ this -> getExceptionAttribute ( $ exception -> getMessage ( ) ) ; $ message = sprintf ( 'The attribute "%s" does not exist for the "%s" tag' , $ attribute , $ this -> getTag ( ) ) ; $ validNode = $ this -> getAttributeNodeConfig ( ) ; if ( $ validNode instanceof ArrayNode ) { $ message .= sprintf ( '. Only attributes "%s" are available' , implode ( '", "' , array_keys ( $ validNode -> getChildren ( ) ) ) ) ; } return $ message ; }
Get the formatted message excpetion of the attributes validation and formatting.

@param \Exception $exception The exception

@return string The exception message
Get the formatted message excpetion of the attributes validation and formatting .