# woocommerce-pos/1.9.15/includes/Registry.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.9.15. 63 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.9.15/code/includes/Registry.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.9.15/raw/includes/Registry.php
- Modified: 2026-02-06T20:51:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.9.15/code/includes/Registry.php#L10-L20`.

```php
<?php
/**
 * Global registry for WCPOS.
 *
 * - stores instances of classes that may be required to remove_action or remove_filter.
 *
 * @author  Paul Kilmurray <paul@kilbot.com>
 *
 * @see     https://wcpos.com
 * @package WCPOS\WooCommercePOS
 */

namespace WCPOS\WooCommercePOS;

/**
 * Registry class.
 */
class Registry {
	/**
	 * Singleton instance.
	 *
	 * @var Registry
	 */
	private static $instance = null;

	/**
	 * Storage for the registry.
	 *
	 * @var array
	 */
	private $storage = array();

	/**
	 * Gets the singleton instance of the registry.
	 */
	public static function get_instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Registers a new instance.
	 *
	 * @param string $key    The registry key.
	 * @param object $object The object to store.
	 */
	public function set( $key, $object ): void {
		$this->storage[ $key ] = $object;
	}

	/**
	 * Retrieves an instance by key.
	 *
	 * @param string $key The registry key.
	 */
	public function get( $key ) {
		return $this->storage[ $key ] ?? null;
	}
}

```
