/** * @return void */ public final function setContractorName($name) { if (!$this->validateServiceName($name)) { FrameworkRuntimeError::create('Contractor name must be a fully qualified service name, "%s" is given"', null, $name)->_throw(); } $this->contractorName = $name; }
public function __construct($uri) { parent::__construct(); $this->uri = Uri::create($uri); if (!$this->uri->isAbsolute()) { FrameworkRuntimeError::create('Redirect URI must be absolute, "%s" is given', null, $this->uri->toString())->_throw(); } }
/** * @todo throw exception * * @return void */ public final function save() { $key = $this->getKey(); if (isset(self::$storage[$key])) { FrameworkRuntimeError::create('HTTP response-header field "%s" is already specified', null, $this->getName())->_throw(); } else { self::$storage[$key] = $this; } }
public function getActiveRouter() { foreach ($this->getRouters() as $router) { if ($router->isActive()) { return $router; } } Exception\System\FrameworkRuntimeError::create('No active router')->_throw(); }
/** * @return void */ private function circularReferenceCheck() { if (count(array_unique($this->circularReferenceTracker)) != count($this->circularReferenceTracker)) { FrameworkRuntimeError::create('A circular dependency for the class "%s" has been detected', null, $this->rootClient)->_throw(); } }
/** * @return void */ private function addExtensionInstance($extInstance) { // do not allow to add the same extension twice foreach ($this->getExtensions() as $loadedExt) { if ($loadedExt->getNamespace() == $extInstance->getNamespace()) { Exception\System\FrameworkRuntimeError::create('The extension "%s" is already loaded', null, $extInstance->getComposerName())->_throw(); } } if ($extInstance->getPriority() === null) { $extInstance->setPriority($this->getPriority() - 1); } self::$extMinHeap->insert($extInstance); $this->addChild($extInstance); }
/** * @return void */ public function setAllowedHttpMethods($mixed) { if ('ALL' == $mixed) { return; } else { if (is_string($mixed)) { $parts = explode('|', $mixed); foreach ($parts as $methodName) { if (!in_array($methodName, Request::getKnownHttpMethods())) { FrameworkRuntimeError::create('Unknown HTTP method "%s"', null, $methodName)->_throw(); } $this->allowedHttpMethods[] = $methodName; } } else { $this->allowedHttpMethods = $mixed; } } }