isArray() public method

public isArray ( ) : boolean
return boolean
Beispiel #1
0
 /**
  * @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;
 }
Beispiel #2
0
 /**
  * @test
  */
 public function shouldReturnTrueWhenTypeIsArray()
 {
     //given
     $node = new Node('string', '$name', true);
     //when
     $isArray = $node->isArray();
     //then
     $this->assertTrue($isArray);
 }