예제 #1
0
 /**
  * Get named element by it's name.
  *
  * @param string $name
  * @return ConstantDeclaration
  */
 public function get($name)
 {
     if (!$this->has($name)) {
         //Automatically creating constant
         $constant = new ConstantDeclaration($name, null);
         $this->add($constant);
         return $constant;
     }
     return parent::get($name);
 }
예제 #2
0
 /**
  * Get named element by it's name.
  *
  * @param string $name
  * @return PropertyDeclaration
  */
 public function get($name)
 {
     if (!$this->has($name)) {
         //Automatically creating constant
         $property = new PropertyDeclaration($name);
         $this->add($property);
         return $property;
     }
     return parent::get($name);
 }
예제 #3
0
 /**
  * Get named element by it's name.
  *
  * @param string $name
  * @return MethodDeclaration
  */
 public function get($name)
 {
     if (!$this->has($name)) {
         //Automatically creating constant
         $method = new MethodDeclaration($name);
         $this->add($method);
         return $method;
     }
     return parent::get($name);
 }
예제 #4
0
 /**
  * Get named element by it's name.
  *
  * @param string $name
  * @return ParameterDeclaration
  */
 public function get($name)
 {
     if (!$this->has($name)) {
         //Automatically creating constant
         $parameter = new ParameterDeclaration($name, null);
         $this->add($parameter);
         return $parameter;
     }
     return parent::get($name);
 }