<?php
namespace Fifa\ConnectId\Sdk\Util;

/**
 * Class DuplicateExceptionMessageFormatter
 * @package Fifa\ConnectId\Sdk\Util
 */
class DuplicateExceptionMessageFormatter
{
    /**
     * @param string[] $identifiers
     * @return string
     */
    public static function generate(array $identifiers): string
    {
        $message = 'The service responded with a status code 409.';
        if (sizeof($identifiers) > 0) {
            $message .= ' Potential duplicates were found: ' . join(',', $identifiers) . '.';
        }

        return $message;
    }
}