/**
  * @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;
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 /**
  * @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;
     }
 }
Exemplo n.º 4
0
 public function getActiveRouter()
 {
     foreach ($this->getRouters() as $router) {
         if ($router->isActive()) {
             return $router;
         }
     }
     Exception\System\FrameworkRuntimeError::create('No active router')->_throw();
 }
Exemplo n.º 5
0
 /**
  * @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();
     }
 }
Exemplo n.º 6
0
 /**
  * @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);
 }
Exemplo n.º 7
0
 /**
  * @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;
         }
     }
 }