コード例 #1
0
 public function testAnnotationClassMethodBlockToString()
 {
     $file = new PhpFile('foo');
     $file->addChild(new PhpAnnotationBlock(array('date is the key', 'time is the core key')));
     $class = new PhpClass('Foo');
     $class->addChild(new PhpMethod('Bar'));
     $file->addChild($class);
     $this->assertSame("<?php\n/**\n * date is the key\n * time is the core key\n */\nclass Foo\n{\n    public function Bar()\n    {\n    }\n}\n", $file->toString());
 }
コード例 #2
0
 public function testExtendsFromNamespace()
 {
     $class = new PhpClass('Foo', false, '\\DOMDocument');
     $this->assertSame("class Foo extends \\DOMDocument\n{\n}", $class->toString());
 }
コード例 #3
0
 /**
  * @param PhpAnnotationBlockElement $annotationBlock
  * @return AbstractComponent
  */
 public function addAnnotationBlockElement(PhpAnnotationBlockElement $annotationBlock)
 {
     $this->mainElement->addChild($annotationBlock);
     return $this;
 }