This commit is contained in:
Rachit Bhargava
2024-01-10 11:53:33 -05:00
parent 83d223b0df
commit 054b4fffc9
16481 changed files with 0 additions and 3473867 deletions

View File

@@ -1,33 +0,0 @@
<?php
namespace Yoast\WP\SEO\Exceptions\OAuth;
use Exception;
/**
* Class Authentication_Failed_Exception
*/
class Authentication_Failed_Exception extends Exception {
/**
* Authentication_Failed_Exception constructor.
*
* @param Exception $original_exception The original exception.
*/
public function __construct( Exception $original_exception ) {
parent::__construct( 'Authentication failed', 401, $original_exception );
}
/**
* Returns a formatted response object.
*
* @return object The response object.
*/
public function get_response() {
return (object) [
'tokens' => [],
'error' => $this->getMessage() . ': ' . $this->getPrevious()->getMessage(),
'status' => $this->getCode(),
];
}
}

View File

@@ -1,20 +0,0 @@
<?php
namespace Yoast\WP\SEO\Exceptions\OAuth\Tokens;
use Exception;
/**
* Class Empty_Property_Exception
*/
class Empty_Property_Exception extends Exception {
/**
* Empty_Property_Exception constructor.
*
* @param string $property The property that is empty.
*/
public function __construct( $property ) {
parent::__construct( \sprintf( 'Token creation failed. Property `%s` cannot be empty.', $property ), 400 );
}
}

View File

@@ -1,18 +0,0 @@
<?php
namespace Yoast\WP\SEO\Exceptions\OAuth\Tokens;
use Exception;
/**
* Class Empty_Token_Exception
*/
class Empty_Token_Exception extends Exception {
/**
* Empty_Token_Exception constructor.
*/
public function __construct() {
parent::__construct( 'Token usage failed. Token is empty.', 400 );
}
}

View File

@@ -1,24 +0,0 @@
<?php
namespace Yoast\WP\SEO\Exceptions\OAuth\Tokens;
use Exception;
/**
* Class Failed_Storage_Exception
*/
class Failed_Storage_Exception extends Exception {
const DEFAULT_MESSAGE = 'Token storing failed. Please try again.';
/**
* Failed_Storage_Exception constructor.
*
* @param string $reason The reason why token storage failed. Optional.
*/
public function __construct( $reason = '' ) {
$message = ( $reason ) ? \sprintf( 'Token storing failed. Reason: %s. Please try again', $reason ) : self::DEFAULT_MESSAGE;
parent::__construct( $message, 500 );
}
}