HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/Exceptions.tar
InvalidCartException.php000064400000002747151556172760011365 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

use WP_Error;

/**
 * InvalidCartException class.
 *
 * @internal This exception is thrown if the cart is in an erroneous state.
 */
class InvalidCartException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * All errors to display to the user.
	 *
	 * @var WP_Error
	 */
	public $error;

	/**
	 * Setup exception.
	 *
	 * @param string   $error_code      Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param WP_Error $error           The WP_Error object containing all errors relating to stock availability.
	 * @param array    $additional_data Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, WP_Error $error, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->error           = $error;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct( '', 409 );
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns the list of messages.
	 *
	 * @return WP_Error
	 */
	public function getError() {
		return $this->error;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}

}
InvalidStockLevelsInCartException.php000064400000003041151556172770014020 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

use WP_Error;

/**
 * InvalidStockLevelsInCartException class.
 *
 * This exception is thrown if any items are out of stock after each product on a draft order has been stock checked.
 */
class InvalidStockLevelsInCartException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * All errors to display to the user.
	 *
	 * @var WP_Error
	 */
	public $error;

	/**
	 * Setup exception.
	 *
	 * @param string   $error_code      Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param WP_Error $error           The WP_Error object containing all errors relating to stock availability.
	 * @param array    $additional_data Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $error, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->error           = $error;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct( '', 409 );
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns the list of messages.
	 *
	 * @return WP_Error
	 */
	public function getError() {
		return $this->error;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}
}
NotPurchasableException.php000064400000000400151556172770012060 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * NotPurchasableException class.
 *
 * This exception is thrown when an item in the cart is not able to be purchased.
 */
class NotPurchasableException extends StockAvailabilityException {}
OutOfStockException.php000064400000000374151556172770011220 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * OutOfStockException class.
 *
 * This exception is thrown when an item in a draft order is out of stock completely.
 */
class OutOfStockException extends StockAvailabilityException {}
PartialOutOfStockException.php000064400000000446151556172770012535 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * PartialOutOfStockException class.
 *
 * This exception is thrown when an item in a draft order has a quantity greater than what is available in stock.
 */
class PartialOutOfStockException extends StockAvailabilityException {}
RouteException.php000064400000002371151556172770010255 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * RouteException class.
 */
class RouteException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * Setup exception.
	 *
	 * @param string $error_code       Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param string $message          User-friendly translated error message, e.g. 'Product ID is invalid'.
	 * @param int    $http_status_code Proper HTTP status code to respond with, e.g. 400.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $message, $http_status_code = 400, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct( $message, $http_status_code );
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}
}
StockAvailabilityException.php000064400000003044151556172770012573 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * StockAvailabilityException class.
 *
 * This exception is thrown when more than one of a product that can only be purchased individually is in a cart.
 */
class StockAvailabilityException extends \Exception {
	/**
	 * Sanitized error code.
	 *
	 * @var string
	 */
	public $error_code;

	/**
	 * The name of the product that can only be purchased individually.
	 *
	 * @var string
	 */
	public $product_name;

	/**
	 * Additional error data.
	 *
	 * @var array
	 */
	public $additional_data = [];

	/**
	 * Setup exception.
	 *
	 * @param string $error_code       Machine-readable error code, e.g `woocommerce_invalid_product_id`.
	 * @param string $product_name     The name of the product that can only be purchased individually.
	 * @param array  $additional_data  Extra data (key value pairs) to expose in the error response.
	 */
	public function __construct( $error_code, $product_name, $additional_data = [] ) {
		$this->error_code      = $error_code;
		$this->product_name    = $product_name;
		$this->additional_data = array_filter( (array) $additional_data );
		parent::__construct();
	}

	/**
	 * Returns the error code.
	 *
	 * @return string
	 */
	public function getErrorCode() {
		return $this->error_code;
	}

	/**
	 * Returns additional error data.
	 *
	 * @return array
	 */
	public function getAdditionalData() {
		return $this->additional_data;
	}

	/**
	 * Returns the product name.
	 *
	 * @return string
	 */
	public function getProductName() {
		return $this->product_name;
	}

}
TooManyInCartException.php000064400000000436151556173000011631 0ustar00<?php
namespace Automattic\WooCommerce\StoreApi\Exceptions;

/**
 * TooManyInCartException class.
 *
 * This exception is thrown when more than one of a product that can only be purchased individually is in a cart.
 */
class TooManyInCartException extends StockAvailabilityException {}