コード例 #1
0
 public function testReadWrite()
 {
     $since = new SinceTag('1.0 baz');
     $this->assertEquals('@since 1.0 baz', $since->toString());
 }
コード例 #2
0
ファイル: Fixtures.php プロジェクト: gossi/php-code-generator
 /**
  * Creates ClassWithComments
  * 
  * @return PhpClass
  */
 public static function createClassWithComments()
 {
     $class = PhpClass::create('gossi\\codegen\\tests\\fixtures\\ClassWithComments');
     $class->setDescription('A class with comments');
     $class->setLongDescription('Here is a super dooper long-description');
     $docblock = $class->getDocblock();
     $docblock->appendTag(AuthorTag::create('gossi'));
     $docblock->appendTag(SinceTag::create('0.2'));
     $class->setConstant(PhpConstant::create('FOO', 'bar')->setDescription('Best const ever')->setLongDescription('Aaaand we go along long')->setType('string')->setTypeDescription('baz'));
     $class->setProperty(PhpProperty::create('propper')->setDescription('best prop ever')->setLongDescription('Aaaand we go along long long')->setType('string')->setTypeDescription('Wer macht sauber?'));
     $class->setMethod(PhpMethod::create('setup')->setDescription('Short desc')->setLongDescription('Looong desc')->addParameter(PhpParameter::create('moo')->setType('boolean')->setTypeDescription('makes a cow'))->addParameter(PhpParameter::create('foo')->setType('foo', 'makes a fow'))->setType('boolean', 'true on success and false if it fails'));
     return $class;
 }