コード例 #1
0
ファイル: Location.php プロジェクト: SYpanel/SYpanel
 public static function fromDirective(Directive $directive)
 {
     $results = new static();
     foreach ($directive->getChildScope()->getDirectives() as $subDirective) {
         $results[$subDirective->getName()] = $subDirective->getValue();
     }
     return $results;
 }
コード例 #2
0
ファイル: Scope.php プロジェクト: SYpanel/SYpanel
 /**
  * Set parent directive for this Scope.
  *
  * Sets parent directive for this Scope and also
  * sets the $parentDirective->setChildScope($this)
  *
  * @param Directive $parentDirective
  * @return $this
  */
 public function setParentDirective(Directive $parentDirective)
 {
     $this->parentDirective = $parentDirective;
     if ($parentDirective->getChildScope() !== $this) {
         $parentDirective->setChildScope($this);
     }
     return $this;
 }