mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
41 lines
706 B
PHP
41 lines
706 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace WooCommerce\PayPalCommerce\Helper;
|
|
|
|
use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
|
|
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
|
|
|
class SettingsStub extends Settings
|
|
{
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $data;
|
|
|
|
/**
|
|
* @param array $data
|
|
*/
|
|
public function __construct(array $data) {
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function get($id) {
|
|
if ( ! $this->has( $id ) ) {
|
|
throw new NotFoundException();
|
|
}
|
|
|
|
return $this->data[$id];
|
|
}
|
|
|
|
public function has($id) {
|
|
return array_key_exists( $id, $this->data );
|
|
}
|
|
|
|
public function set($id, $value) {
|
|
$this->data[$id] = $value;
|
|
}
|
|
|
|
public function persist() {
|
|
}
|
|
}
|