Exemplo n.º 1
0
 /**
  * @param PhpConstantElement $constant
  * @return AbstractComponent
  */
 public function addConstantElement(PhpConstantElement $constant)
 {
     if (!$constant->getClass() instanceof PhpClassElement && $this->mainElement instanceof PhpClassElement) {
         $constant->setClass($this->mainElement);
     }
     $this->mainElement->addChild($constant);
     return $this;
 }
Exemplo n.º 2
0
 /**
  * @return PhpAnnotationBlock
  */
 protected function getConstantAnnotationBlock(PhpConstant $constant)
 {
     $block = new PhpAnnotationBlock(array(sprintf('Constant for value \'%s\'', $constant->getValue())));
     if (($value = $this->getModel()->getValue($constant->getValue())) instanceof StructValueModel) {
         $this->defineModelAnnotationsFromWsdl($block, $value);
     }
     $block->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('string \'%s\'', $constant->getValue())));
     return $block;
 }
Exemplo n.º 3
0
 public function testGetChildrenTypes()
 {
     $constant = new PhpConstant('foo', null, new PhpClass('bar'));
     $this->assertSame(array(), $constant->getChildrenTypes());
 }