Provider

Summary

No summary available.

Source

File: src/BigCommerce/Container/Provider.php

abstract class Provider implements ServiceProviderInterface {
	protected $callbacks = [];

	public function __get( $property ) {
		if ( array_key_exists( $property, $this->callbacks ) ) {
			return $this->callbacks[ $property ];
		}
		return null;
	}

	protected function create_callback( $identifier, callable $callback ) {
		if ( array_key_exists( $identifier, $this->callbacks ) ) {
			throw new \InvalidArgumentException( sprintf( __( 'Invalid identifier: %s has already been set.', 'bigcommerce' ), $identifier ) );
		}
		$this->callbacks[ $identifier ] = $callback;
		return $callback;
	}
}

Methods


User Contributed Notes

You must log in before being able to contribute a note or feedback.