for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SBL;
use InvalidArgumentException;
/**
* @license GNU GPL v2+
* @since 1.0
*
* @author mwjames
*/
class Options {
* @var array
private $options = [];
public function __construct( array $options = [] ) {
$this->options = $options;
}
* @param string $key
* @param mixed $value
public function set( $key, $value ) {
$this->options[$key] = $value;
* @return boolean
public function has( $key ) {
return isset( $this->options[$key] ) || array_key_exists( $key, $this->options );
* @return string
* @throws InvalidArgumentException
public function get( $key ) {
if ( $this->has( $key ) ) {
return $this->options[$key];
throw new InvalidArgumentException( "{$key} is an unregistered option" );