src/InterceptionException.php
public function getMessageByCode( $code, array $data = NULL, $customMessage = NULL )
	{
		// Use custom message when set.
		if ( !empty($customMessage) && \strlen($customMessage) > 0 )
		{
			return \vsprintf($customMessage, $data );
		}

		// When no entry for code found, return a generic error message.
		if ( !\array_key_exists($code, $this->messages) )
		{
			return $this->messages[ self::GENERIC ];
		}

		// Parse variables in the error message when present.
		if ( \is_array($data) )
		{
			return \vsprintf( $this->messages[$code], $data );
		}

		return $this->messages[ $code ];
	}
public function getMessageByCode( $code, array $data = NULL, $customMessage = NULL )
	{
		// Use custom message when set.
		if ( !empty($customMessage) && \strlen($customMessage) > 0 )
		{
			return \vsprintf($customMessage, $data );
		}

		// When no entry for code found, return a generic error message.
		if ( !\array_key_exists($code, $this->messages) )
		{
			return $this->messages[ self::GENERIC ];
		}

		// Parse variables in the error message when present.
		if ( \is_array($data) )
		{
			return \vsprintf( $this->messages[$code], $data );
		}

		return $this->messages[ $code ];
	}
public function getMessageByCode ( $ code , array $ data = NULL , $ customMessage = NULL ) { // Use custom message when set. if ( ! empty ( $ customMessage ) && \ strlen ( $ customMessage ) > 0 ) { return \ vsprintf ( $ customMessage , $ data ) ; } // When no entry for code found, return a generic error message. if ( ! \ array_key_exists ( $ code , $ this -> messages ) ) { return $ this -> messages [ self :: GENERIC ] ; } // Parse variables in the error message when present. if ( \ is_array ( $ data ) ) { return \ vsprintf ( $ this -> messages [ $ code ] , $ data ) ; } return $ this -> messages [ $ code ] ; }
Returns a textual error message for an error code

@param integer $code error code or another error object for code reuse
@param array $data additional data to insert into message, processed by vsprintf()
@param string $customMessage Override the built-in message with your own.
@return string error message
Returns a textual error message for an error code