public static function convertLicenses($licenses)
    {
        if (!\is_array($licenses)) {
            return $licenses;
        }

        $result = array();
        foreach ($licenses as $license) {
            if (\is_array($license)) {
                if (!empty($license['type'])) {
                    $result[] = $license['type'];
                } elseif (!empty($license['name'])) {
                    $result[] = $license['name'];
                }
            } else {
                $result[] = $license;
            }
        }

        return $result;
    }