Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)始,故人唐宰相鲁公,🆚开府南服,余以布衣从戎。明年,别公漳水湄。后明年,公以事过张睢阳庙及颜杲卿所尝往来处,悲歌慷慨,卒不负其言而从之游。今其诗具在,可考也。😭
importing/aioseo-validation-exception.php 0000644 00000000653 15233531774 0014706 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Importing;
use Exception;
/**
* Class Aioseo_Validation_Exception
*/
class Aioseo_Validation_Exception extends Exception {
/**
* Exception that is thrown whenever validation of the
* AIOSEO data structure has failed.
*/
public function __construct() {
parent::__construct( \esc_html__( 'The validation of the AIOSEO data structure has failed.', 'wordpress-seo' ) );
}
}
missing-method.php 0000644 00000001271 15233531774 0010217 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions;
use Exception;
/**
* Exception to use when a method does not exist.
*/
class Missing_Method extends Exception {
/**
* Creates exception for a method that does not exist in a class.
*
* @param string $method The method that does not exist.
* @param string $class_name The class name.
*
* @return static Instance of the exception.
*/
public static function for_class( $method, $class_name ) {
return new static(
\sprintf(
/* translators: %1$s expands to the method name. %2$s expands to the class name */
\__( 'Method %1$s() does not exist in class %2$s', 'wordpress-seo' ),
$method,
$class_name
)
);
}
}
indexable/post-not-found-exception.php 0000644 00000000703 15233531774 0014112 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Indexable;
/**
* Exception that is thrown whenever a post could not be found
* in the context of the indexables.
*/
class Post_Not_Found_Exception extends Source_Exception {
/**
* Exception that is thrown whenever a post could not be found
* in the context of the indexables.
*/
public function __construct() {
parent::__construct( \__( 'The post could not be found.', 'wordpress-seo' ) );
}
}
indexable/source-exception.php 0000644 00000000231 15233531774 0012512 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Indexable;
/**
* Class Indexable_Source_Exception
*/
class Source_Exception extends Indexable_Exception {
}
indexable/invalid-term-exception.php 0000644 00000001353 15233531774 0013613 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Indexable;
/**
* Exception that can be thrown whenever a term is considered invalid by WordPress
* within the context of the indexables.
*/
class Invalid_Term_Exception extends Source_Exception {
/**
* Exception that can be thrown whenever a term is considered invalid by WordPress
* within the context of the indexables.
*
* @param string $reason The reason given by WordPress why the term is invalid.
*/
public function __construct( $reason ) {
parent::__construct(
\sprintf(
/* translators: %s is the reason given by WordPress. */
\esc_html__( 'The term is considered invalid. The following reason was given by WordPress: %s', 'wordpress-seo' ),
$reason
)
);
}
}
indexable/term-not-found-exception.php 0000644 00000000703 15233531774 0014074 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Indexable;
/**
* Exception that is thrown whenever a term could not be found
* in the context of the indexables.
*/
class Term_Not_Found_Exception extends Source_Exception {
/**
* Exception that is thrown whenever a term could not be found
* in the context of the indexables.
*/
public function __construct() {
parent::__construct( \__( 'The term could not be found.', 'wordpress-seo' ) );
}
}
indexable/indexable-exception.php 0000644 00000000244 15233531774 0013151 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Indexable;
use Exception;
/**
* Class Indexable_Exception
*/
abstract class Indexable_Exception extends Exception {
}
oauth/authentication-failed-exception.php 0000644 00000001340 15233531774 0014642 0 ustar 00 <?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(),
];
}
}
oauth/tokens/empty-token-exception.php 0000644 00000000474 15233531774 0014167 0 ustar 00 <?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 );
}
}
oauth/tokens/failed-storage-exception.php 0000644 00000001107 15233531774 0014573 0 ustar 00 <?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 );
}
}
oauth/tokens/empty-property-exception.php 0000644 00000000665 15233531774 0014735 0 ustar 00 <?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 );
}
}
addon-installation/addon-installation-error-exception.php 0000644 00000000266 15233531774 0017766 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Addon_Installation;
use Exception;
/**
* Class Addon_Installation_Error
*/
class Addon_Installation_Error_Exception extends Exception {}
addon-installation/user-cannot-activate-plugins-exception.php 0000644 00000000276 15233531774 0020567 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Addon_Installation;
use Exception;
/**
* Class User_Cannot_Activate_Plugins
*/
class User_Cannot_Activate_Plugins_Exception extends Exception {}
addon-installation/addon-activation-error-exception.php 0000644 00000000274 15233531774 0017425 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Addon_Installation;
use Exception;
/**
* Class Addon_Activation_Error_Exception
*/
class Addon_Activation_Error_Exception extends Exception {}
addon-installation/addon-already-installed-exception.php 0000644 00000000276 15233531774 0017535 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Addon_Installation;
use Exception;
/**
* Class Addon_Already_Installed_Exception
*/
class Addon_Already_Installed_Exception extends Exception {}
addon-installation/user-cannot-install-plugins-exception.php 0000644 00000000306 15233531774 0020427 0 ustar 00 <?php
namespace Yoast\WP\SEO\Exceptions\Addon_Installation;
use Exception;
/**
* Class User_Cannot_Install_Plugins_Exception
*/
class User_Cannot_Install_Plugins_Exception extends Exception {}