Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders

AbstractInterfaceServiceProvider::provides()publicWC 1.0

Determine whether this service provides the given alias.

Method of the class: AbstractInterfaceServiceProvider{}

No Hooks.

Return

true|false.

Usage

$AbstractInterfaceServiceProvider = new AbstractInterfaceServiceProvider();
$AbstractInterfaceServiceProvider->provides( $alias ): bool;
$alias(string) (required)
The alias to check.

AbstractInterfaceServiceProvider::provides() code WC 9.5.1

public function provides( string $alias ): bool {
	$provides = parent::provides( $alias );
	if ( $provides ) {
		return true;
	}

	static $implements = array();
	if ( empty( $implements ) ) {
		foreach ( $this->provides as $class ) {
			$implements_more = class_implements( $class );
			if ( $implements_more ) {
				$implements = array_merge( $implements, $implements_more );
			}
		}

		$implements = array_unique( $implements );
	}

	return array_key_exists( $alias, $implements );
}