예제 #1
0
 public function testSettingAttributeValueWithEntitiesAndKeepEntitiesEnabledDoesNotEncode()
 {
     $attr = $this->node->setAttribute('test', '&', true);
     $this->assertTrue($this->node->hasAttribute('test'));
     $this->assertInstanceOf('DOMAttr', $attr);
     $this->assertEquals('&', $this->node->getAttribute('test'));
 }
예제 #2
0
 /**
  * @param string $visibility
  */
 public function setVisibility($visibility)
 {
     if (!in_array($visibility, array('public', 'private', 'protected'))) {
         throw new MethodObjectException("'{$visibility}' is not valid'", MethodObjectException::InvalidVisibility);
     }
     $this->ctx->setAttribute('visibility', $visibility);
 }
 /**
  * @param $type
  */
 public function setType($type)
 {
     if (!in_array(mb_strtolower($type), $this->types)) {
         $parts = explode('\\', $type);
         $local = array_pop($parts);
         $namespace = join('\\', $parts);
         $unit = $this->ctx->appendElementNS(self::XMLNS, 'type');
         $unit->setAttribute('full', $type);
         $unit->setAttribute('namespace', $namespace);
         $unit->setAttribute('name', $local);
         $type = 'object';
     }
     $this->ctx->setAttribute('type', $type);
 }
예제 #4
0
 /**
  * @param boolean $isFinal
  */
 public function setFinal($isFinal)
 {
     $this->rootNode->setAttribute('final', $isFinal ? 'true' : 'false');
 }
예제 #5
0
 /**
  * @param int $endLine
  */
 public function setEndLine($endLine)
 {
     $this->ctx->setAttribute('end', $endLine);
 }