Refactor WooCommerce\PayPalCommerce\Internale\Pattern to WooCommerce\PayPalCommerce\Common\Pattern

This commit is contained in:
Pedro Silva 2023-08-15 08:27:59 +01:00
parent 576805a15a
commit 0eb616c94e
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
4 changed files with 19 additions and 4 deletions

View file

@ -29,7 +29,7 @@
"autoload": {
"psr-4": {
"WooCommerce\\PayPalCommerce\\": "src",
"WooCommerce\\PayPalCommerce\\Isolated\\": "lib/isolated/",
"WooCommerce\\PayPalCommerce\\Common\\": "lib/common/",
"WooCommerce\\PayPalCommerce\\Vendor\\": "lib/packages/"
},
"files": [

View file

@ -1,7 +1,14 @@
<?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 {
/**

View file

@ -1,7 +1,15 @@
<?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 {
/**
* The single instance of the class.

View file

@ -9,7 +9,7 @@ declare(strict_types=1);
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\PayPalBearer;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;