コード例 #1
0
ファイル: MethodTest.php プロジェクト: ridzhi/docbuilder
 public function testGetOutput()
 {
     $this->inst->setReturn('string');
     $this->inst->setArgument(new Argument('string:name=\'username\''));
     $this->inst->setArgument(new Argument('int:age'));
     $this->inst->setDescription('Description test method');
     $output = $this->inst->getOutput();
     $this->assertEquals('string test(string $name = \'username\', int $age) Description test method', $output);
 }
コード例 #2
0
ファイル: DocBlock.php プロジェクト: ridzhi/docbuilder
 /**
  * @param string $name
  * @param array $args Each arg is Argument expression
  * @param string $return
  * @param string $description
  * @return DocBlock
  *
  * @see Argument::__construct()
  */
 public function tagMethod($name, array $args = null, $return = null, $description = null)
 {
     $method = new Method($name);
     if ($args !== null) {
         foreach ($args as $arg) {
             $method->setArgument(new Argument($arg));
         }
     }
     if ($return !== null) {
         $method->setReturn($return);
     }
     if ($description !== null) {
         $method->setDescription($description);
     }
     return $this->make('method', [$method->getOutput()]);
 }