getType() public method

public getType ( ) : string
return string
コード例 #1
0
ファイル: NodeTest.php プロジェクト: piotrooo/wsdl-creator
 /**
  * @test
  */
 public function shouldGetTypeForObjectType()
 {
     //given
     $elements = [new Node('string', '$name', false)];
     $node = new Node('object', '$user', false, $elements);
     //when
     $type = $node->getType();
     //then
     $this->assertEquals('object', $type);
 }
コード例 #2
0
ファイル: XMLRpcStyle.php プロジェクト: piotrooo/wsdl-creator
 /**
  * @param Node $node
  * @return array
  */
 private function attributes(Node $node)
 {
     if ($node->isArray()) {
         $attributes = ['name' => $node->getSanitizedName(), 'type' => 'ns:' . $node->getNameForArray()];
     } elseif ($node->isObject()) {
         $attributes = ['name' => $node->getSanitizedName(), 'element' => 'ns:' . $node->getNameForObject()];
     } else {
         $attributes = ['name' => $node->getSanitizedName(), 'type' => 'xsd:' . $node->getType()];
     }
     return $attributes;
 }