<commit_before><?php

namespace Struzik\EPPClient\IdGenerator;

use Struzik\EPPClient\Request\RequestInterface;

/**
 * Basic implementation of identifier generator. Based on DateTime.
 */
class BasicGenerator implements IdGeneratorInterface
{
    /**
     * {@inheritdoc}
     */
    public function generate(RequestInterface $request): string
    {
        $class = (new \ReflectionClass($request))->getShortName();
        $prefix = substr($class, 0, mb_strpos($class, 'Request'));
        $prefix = preg_replace('/([A-Z])/u', '-$1', $prefix);
        $prefix = trim($prefix, '-');

        $identifierPieces[] = $prefix;
        $identifierPieces[] = (new \DateTime())->format('YmdHis.u');
        $identifier = implode('-', $identifierPieces);
        $identifier = mb_strtoupper($identifier);

        return $identifier;
    }
}<commit_msg>Fixed prefix creation in BasicGenerator.<commit_after><?php

namespace Struzik\EPPClient\IdGenerator;

use Struzik\EPPClient\Request\RequestInterface;

/**
 * Basic implementation of identifier generator. Based on DateTime.
 */
class BasicGenerator implements IdGeneratorInterface
{
    /**
     * {@inheritdoc}
     */
    public function generate(RequestInterface $request): string
    {
        $class = (new \ReflectionClass($request))->getShortName();
        $prefix = substr($class, -7) === 'Request'
            ? substr($class, 0, -7)
            : $class;
        $prefix = preg_replace('/([A-Z])/u', '-$1', $prefix);
        $prefix = trim($prefix, '-');

        $identifierPieces[] = $prefix;
        $identifierPieces[] = (new \DateTime())->format('YmdHis.u');
        $identifier = implode('-', $identifierPieces);
        $identifier = mb_strtoupper($identifier);

        return $identifier;
    }
}
{'fraction_non_alphanumeric': 0.15938740782756664, 'fraction_numerical': 0.003403289846851957, 'mean_word_length': 3.140845070422535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3499368', 'n_tokens_mistral': 513, 'n_tokens_neox': 509, 'n_words': 105}