/** * {@inheritdoc} */ public function sort(int $flags = self::SORT_REGULAR) : CollectionInterface { return new self($this->type, parent::sort($flags)->toPrimitive()); }