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:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -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 ) );
}
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}

View File

@@ -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 {
}