mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Refactor WooCommerce\PayPalCommerce\Internale\Pattern to WooCommerce\PayPalCommerce\Common\Pattern
This commit is contained in:
parent
576805a15a
commit
0eb616c94e
4 changed files with 19 additions and 4 deletions
|
@ -29,7 +29,7 @@
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"WooCommerce\\PayPalCommerce\\": "src",
|
"WooCommerce\\PayPalCommerce\\": "src",
|
||||||
"WooCommerce\\PayPalCommerce\\Isolated\\": "lib/isolated/",
|
"WooCommerce\\PayPalCommerce\\Common\\": "lib/common/",
|
||||||
"WooCommerce\\PayPalCommerce\\Vendor\\": "lib/packages/"
|
"WooCommerce\\PayPalCommerce\\Vendor\\": "lib/packages/"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* The Singleton Trait can be used to wrap an execution block, so it behaves like a Singleton.
|
||||||
|
* It executes the callable once, on subsequent calls returns the same result.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace WooCommerce\PayPalCommerce\Isolated\Pattern;
|
namespace WooCommerce\PayPalCommerce\Common\Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SingletonDecorator.
|
||||||
|
*/
|
||||||
class SingletonDecorator {
|
class SingletonDecorator {
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,7 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* The Singleton Trait can be used to add singleton behaviour to a class.
|
||||||
|
*
|
||||||
|
* @package WooCommerce\PayPalCommerce\Common\Pattern
|
||||||
|
*/
|
||||||
|
|
||||||
namespace WooCommerce\PayPalCommerce\Isolated\Pattern;
|
namespace WooCommerce\PayPalCommerce\Common\Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SingletonTrait.
|
||||||
|
*/
|
||||||
trait SingletonTrait {
|
trait SingletonTrait {
|
||||||
/**
|
/**
|
||||||
* The single instance of the class.
|
* The single instance of the class.
|
|
@ -9,7 +9,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace WooCommerce\PayPalCommerce\ApiClient;
|
namespace WooCommerce\PayPalCommerce\ApiClient;
|
||||||
|
|
||||||
use WooCommerce\PayPalCommerce\Isolated\Pattern\SingletonDecorator;
|
use WooCommerce\PayPalCommerce\Common\Pattern\SingletonDecorator;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
|
use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
|
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue