Ejemplo n.º 1
0
/**
 * @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);
    }
}
Ejemplo n.º 2
0
 /**
  * @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];
 }