/** * @param array $args */ function bind(array $args) { $tracer = new Tracer(__FUNCTION__, debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, DEBUG_BACKTRACE_LEVEL)); foreach ($args as $name => $value) { $entry = new Entry($name, $tracer); enforce(!Registry::Instance()->exists($entry->hash))->orThrow('Constant "%s" already exists', $name); $entry->be($value); } }
/** * @param string $hash * * @return mixed */ public function access(string $hash) { enforce($this->exists($hash))->orThrow('No Entry for Hash "%s"', $hash); return $this->entries[$hash]; }