defaultProps = array( 'debug' => true, ); $this->props = $this->defaultProps; } public function isDebug() { return $this->getProp( 'debug' ); } /** * @param string $prop * * @return mixed * @throws EnvironmentKeyNotFound * @throws WrongKeyType */ protected function getProp( $prop ) { if ( ! is_string($prop) ) { throw new WrongKeyType(); } if ( ! isset( $this->props[ $prop ] ) ) { throw new EnvironmentKeyNotFound(); } return $this->props[ $prop ]; } }