コード例 #1
0
ファイル: MethodTest.php プロジェクト: kormik/manager
 public function testGetName()
 {
     $this->assertSame('doSomething', $this->method->getName());
 }
コード例 #2
0
ファイル: Clazz.php プロジェクト: niklongstone/manager
 /**
  * Adds a method to the class.
  *
  * @param Method $method The method to add to the class.
  *
  * @return static The current instance.
  */
 public function addMethod(Method $method)
 {
     if (isset($this->methods[$method->getName()])) {
         throw new RuntimeException(sprintf('The method "%s" exists already.', $method->getName()));
     }
     $this->methods[$method->getName()] = $method;
     $method->setClass($this);
     return $this;
 }