Phase 5: Content and SEO - Yoast SEO, Schema.org markup, Open Graph, favicon support, XML sitemap
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Exceptions\OAuth\Tokens;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class Failed_Storage_Exception
|
||||
*/
|
||||
class Failed_Storage_Exception extends Exception {
|
||||
|
||||
public 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 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user