Skip to content

Commit

Permalink
Fix fatal error with incorrect validation exception methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Dec 1, 2024
1 parent 35a57fa commit cd05c6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Validation/Exception/Validation_Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Validation_Exception extends WP_Error_Exception {
*
* @param string $error_code Text based error code.
* @param string $message Error message.
* @return Validation_Exception New exception instance.
* @return WP_Error_Exception New exception instance.
*/
public static function create( string $error_code, string $message ): Validation_Exception {
public static function create( string $error_code, string $message ): WP_Error_Exception {
$instance = new self( $message );
$instance->set_error_code( $error_code );
return $instance;
Expand All @@ -39,9 +39,9 @@ public static function create( string $error_code, string $message ): Validation
* @since 0.1.0
*
* @param WP_Error $error WP_Error object.
* @return Validation_Exception New exception instance.
* @return WP_Error_Exception New exception instance.
*/
public static function from_wp_error( WP_Error $error ): Validation_Exception {
public static function from_wp_error( WP_Error $error ): WP_Error_Exception {
return self::create( $error->get_error_code(), $error->get_error_message() );
}
}

0 comments on commit cd05c6f

Please sign in to comment.