public function testAddAll() { $this->seq->addAll(array(2, 1, 3)); $this->assertSame(array(0, $this->a, $this->b, 0, 2, 1, 3), $this->seq->all()); $this->seq->sortWith(function ($a, $b) { if (is_integer($a)) { if (!is_integer($b)) { return -1; } return $a > $b ? 1 : -1; } if (is_integer($b)) { return 1; } return -1; }); $this->assertSame(array(0, 0, 1, 2, 3, $this->a, $this->b), $this->seq->all()); }
public function serializeSequence(VisitorInterface $visitor, Sequence $sequence, array $type, Context $context) { // We change the base type, and pass through possible parameters. $type['name'] = 'array'; return $visitor->visitArray($sequence->all(), $type, $context); }
/** * Gets attributes * * @return string */ public function getAttrs() { return implode(',', $this->_attrs->all()); }
public function serializeSequence(VisitorInterface $visitor, Sequence $sequence, Type $type, Context $context) { return $visitor->visitArray($sequence->all(), $type, $context); }