private function getPartsFromSegment(string $segment): array
    {
        $parts = explode(DIRECTORY_SEPARATOR, $segment);

        return array_filter($parts, function ($part) {
            return $this->isNotEmpty($part);
        });
    }