* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @copyright PayPal */ namespace PaypalAddons\services; class PaypalContext { protected $dataset = []; protected static $instance; public function get($key, $default = null) { if (empty($this->dataset[$key])) { return $default; } return $this->dataset[$key]; } public function set($key, $value) { $this->dataset[$key] = $value; } protected function __construct() { } public static function getContext() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; } }