コード例 #1
0
ファイル: PHPInterface.php プロジェクト: mohiva/manitou
 /**
  * Generate the DocBlock part of this interface.
  *
  * @return string The DocBlock content or an empty string if no DocBlock is set.
  */
 private function generateDocBlock()
 {
     if (!$this->docBlock) {
         return '';
     }
     $code = $this->docBlock->generate();
     return $code;
 }
コード例 #2
0
ファイル: PHPDocBlockTest.php プロジェクト: mohiva/manitou
 /**
  * Test if can generate a complex comment.
  */
 public function testGenerateComplexComment()
 {
     $lineFeed = Generator::getConfig()->getNewline();
     $license = 'This source file is subject to the new BSD license that is bundled' . $lineFeed;
     $license .= 'with this package in the file LICENSE.txt.' . $lineFeed;
     $license .= 'It is also available through the world-wide-web at this URL:' . $lineFeed;
     $license .= 'http://framework.mohiva.com/license' . $lineFeed;
     $license .= 'If you did not receive a copy of the license and are unable to' . $lineFeed;
     $license .= 'obtain it through the world-wide-web, please send an email' . $lineFeed;
     $license .= 'to license@framework.mohiva.com so we can send you a copy immediately.' . $lineFeed;
     $file = Bootstrap::$resourceDir . '/manitou/generators/php/docblock_complex.txt';
     $expected = $this->getFileContent($file);
     $docBlock = new PHPDocBlock();
     $docBlock->addSection('Unit test case for the Mohiva `PHPDocBlock` class.');
     $docBlock->addSection('LICENSE');
     $docBlock->addSection($license);
     $docBlock->addAnnotation('@category  Mohiva');
     $docBlock->addAnnotation('@package   Mohiva/Test');
     $docBlock->addAnnotation('@author    Christian Kaps <*****@*****.**>');
     $docBlock->addAnnotation('@copyright Copyright (c) 2007-2011 Christian Kaps (http://www.mohiva.com)');
     $docBlock->addAnnotation('@license   http://framework.mohiva.com/license New BSD License');
     $docBlock->addAnnotation('@link      http://framework.mohiva.com');
     $this->assertEquals($expected, $docBlock->generate());
 }