Merged in feature/MAW-855-import-code-into-aws (pull request #2)
code import from pantheon * code import from pantheon
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Exception for attempting a mutation on properties that are made readonly through magic getters and setters.
|
||||
*/
|
||||
class Forbidden_Property_Mutation_Exception extends RuntimeException {
|
||||
|
||||
/**
|
||||
* Creates a Forbidden_Property_Mutation_Exception exception when an attempt is made
|
||||
* to assign a value to an immutable property.
|
||||
*
|
||||
* @param string $property_name The name of the immutable property.
|
||||
*
|
||||
* @return Forbidden_Property_Mutation_Exception The exception.
|
||||
*/
|
||||
public static function cannot_set_because_property_is_immutable( $property_name ) {
|
||||
return new self( \sprintf( 'Setting property $%s is not supported.', $property_name ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Forbidden_Property_Mutation_Exception exception when an attempt is made to unset an immutable property.
|
||||
*
|
||||
* @param string $property_name The name of the immutable property.
|
||||
*
|
||||
* @return Forbidden_Property_Mutation_Exception The exception.
|
||||
*/
|
||||
public static function cannot_unset_because_property_is_immutable( $property_name ) {
|
||||
return new self( \sprintf( 'Unsetting property $%s is not supported.', $property_name ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 400 - Bad request response.
|
||||
*/
|
||||
class Bad_Request_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 403 - Forbidden response.
|
||||
*/
|
||||
class Forbidden_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 500 - Internal server error response.
|
||||
*
|
||||
* @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
|
||||
*/
|
||||
class Internal_Server_Error_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 404 - not found response.
|
||||
*/
|
||||
class Not_Found_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 402 - payment required response.
|
||||
*/
|
||||
class Payment_Required_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class Remote_Request_Exception
|
||||
*/
|
||||
abstract class Remote_Request_Exception extends Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 408 - request timeout exception
|
||||
*/
|
||||
class Request_Timeout_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 503 - service unavailable response.
|
||||
*/
|
||||
class Service_Unavailable_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 429 - Too many requests response.
|
||||
*
|
||||
* @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
|
||||
*/
|
||||
class Too_Many_Requests_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Exceptions\Remote_Request;
|
||||
|
||||
/**
|
||||
* Class to manage a 401 - unauthorized response.
|
||||
*/
|
||||
class Unauthorized_Exception extends Remote_Request_Exception {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user