<commit_before><?php

declare(strict_types=1);

namespace Oqq\Broetchen\Service;

use Oqq\Broetchen\Domain\User\Credentials;
use Oqq\Broetchen\Domain\User\User;
use Oqq\Broetchen\Domain\User\UserId;

final class DebugUserService implements UserServiceInterface
{
    public function getUserWithId(UserId $userId): User
    {
        return $this->debugUser();
    }

    public function getUserForCredentials(Credentials $credentials): User
    {
        return $this->debugUser();
    }

    private function debugUser(): User
    {
        return User::fromArray([
            'user_id' => UserId::generate()->toString(),
        ]);
    }
}<commit_msg>use previous gererated user id<commit_after><?php

declare(strict_types=1);

namespace Oqq\Broetchen\Service;

use Oqq\Broetchen\Domain\User\Credentials;
use Oqq\Broetchen\Domain\User\User;
use Oqq\Broetchen\Domain\User\UserId;

final class DebugUserService implements UserServiceInterface
{
    public function getUserWithId(UserId $userId): User
    {
        return $this->debugUser($userId);
    }

    public function getUserForCredentials(Credentials $credentials): User
    {
        return $this->debugUser();
    }

    private function debugUser(UserId $userId = null): User
    {
        if (null === $userId) {
            $userId = UserId::generate();
        }

        return User::fromArray([
            'user_id' => $userId->toString(),
        ]);
    }
}
{'fraction_non_alphanumeric': 0.11966410076976906, 'fraction_numerical': 0.0013995801259622112, 'mean_word_length': 3.1569767441860463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4647402', 'n_tokens_mistral': 425, 'n_tokens_neox': 436, 'n_words': 85}