_composites = $composites; } public function getPrefix(array $scopes): ?int { $matches = $this->matches($scopes, $match); return ($matches) ? $match->getPrefix($scopes) : null; } public function matches(array $scopes, ?Composite &$match = null): bool { foreach ($this->_composites as $composite) { if ($composite->matches($scopes)) { $match = $composite; return true; } } return false; } public function __toString(): string { return implode(', ', $this->_composites); } }