Пример #1
0
 /**
  * Builds a new method instance.
  *
  * @param string $name The method name.
  *
  * @return PHP_Depend_Code_Method The created class method object.
  */
 public function buildMethod($name)
 {
     $this->checkBuilderState();
     // Debug method creation
     PHP_Depend_Util_Log::debug("Creating: PHP_Depend_Code_Method({$name})");
     // Create a new method instance
     $method = new PHP_Depend_Code_Method($name);
     $method->setCache($this->cache);
     return $method;
 }
Пример #2
0
 /**
  * Creates a ready to use method fixture.
  *
  * @param string $name Optional method name.
  *
  * @return PHP_Depend_Code_Method
  * @since 1.0.2
  */
 protected function createMethodFixture($name = null)
 {
     $name = $name ? $name : get_class($this);
     $method = new PHP_Depend_Code_Method($name);
     $method->setCache(new PHP_Depend_Util_Cache_Driver_Memory());
     $method->addChild(new PHP_Depend_Code_ASTFormalParameters());
     return $method;
 }