mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix phpcs
This commit is contained in:
parent
86860d4fd6
commit
c68db5c1a1
1 changed files with 11 additions and 3 deletions
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\ApiClient\Authentication;
|
||||
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Class ClientCredentials
|
||||
|
@ -28,14 +29,21 @@ class ClientCredentials {
|
|||
*
|
||||
* @param Settings $settings The settings.
|
||||
*/
|
||||
public function __construct(Settings $settings) {
|
||||
public function __construct( Settings $settings ) {
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns encoded client credentials.
|
||||
*
|
||||
* @return string
|
||||
* @throws NotFoundException If setting does not found.
|
||||
*/
|
||||
public function credentials(): string {
|
||||
$client_id = $this->settings->has( 'client_id' ) ? $this->settings->get( 'client_id' ) : '';
|
||||
$client_id = $this->settings->has( 'client_id' ) ? $this->settings->get( 'client_id' ) : '';
|
||||
$client_secret = $this->settings->has( 'client_secret' ) ? $this->settings->get( 'client_secret' ) : '';
|
||||
|
||||
return 'Basic ' . base64_encode($client_id . ':' . $client_secret);
|
||||
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
|
||||
return 'Basic ' . base64_encode( $client_id . ':' . $client_secret );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue