issues[] = $issue; } /** Merge another collection to this collection. */ public function merge( ValidationIssues $issues ) { $this->issues = array_merge( $this->issues, $issues->issues ); } /** * Check whether this collection is not empty. * * @return bool False if empty, true otherwise */ public function hasIssues(): bool { return $this->issues !== []; } /** @return Traversable */ public function getIterator(): Traversable { return new ArrayIterator( $this->issues ); } /** @inheritDoc */ public function count(): int { return count( $this->issues ); } }