Constants_Provider

Class Constants_Provider.


Source

File: src/Common/Configuration/Constants_Provider.php

class Constants_Provider implements Configuration_Provider_Interface {

	/**
	 * @inheritDoc
	 */
	public function has( $key ): bool {
		return defined( $key );
	}

	/**
	 * @inheritDoc
	 */
	public function get( $key ) {
		if ( $this->has( $key ) ) {
			return constant( $key );
		}
		return null;
	}

	/**
	 * @inheritDoc
	 */
	public function all(): array {
		return get_defined_constants( false );
	}
}

Top ↑

Changelog

Changelog
Version Description
5.1.3 Introduced.

Top ↑

Methods