<commit_before><?php
declare(strict_types = 1);
/**
 * /src/AutoMapper/UserGroup/RequestMapper.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\AutoMapper\UserGroup;

use App\AutoMapper\RestRequestMapper;
use App\Entity\Role;
use App\Resource\RoleResource;
use Doctrine\ORM\ORMException;
use Ramsey\Uuid\UuidInterface;

/**
 * Class RequestMapper
 *
 * @package App\AutoMapper
 * @author  TLe, <NAME> <<EMAIL>>
 */
class RequestMapper extends RestRequestMapper
{
    protected static $properties = [
        'name',
        'role',
    ];

    /**
     * @var RoleResource
     */
    private $roleResource;

    /**
     * RequestMapper constructor.
     *
     * @param RoleResource $roleResource
     */
    public function __construct(RoleResource $roleResource)
    {
        $this->roleResource = $roleResource;
    }

    /**
     * @param UuidInterface $role
     *
     * @return Role
     *
     * @throws ORMException
     */
    protected function transformRole(UuidInterface $role): Role
    {
        return $this->roleResource->getReference($role->toString());
    }
}<commit_msg>refactor: Reverted parameter type.<commit_after><?php
declare(strict_types = 1);
/**
 * /src/AutoMapper/UserGroup/RequestMapper.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\AutoMapper\UserGroup;

use App\AutoMapper\RestRequestMapper;
use App\Entity\Role;
use App\Resource\RoleResource;
use Doctrine\ORM\ORMException;
use Ramsey\Uuid\UuidInterface;

/**
 * Class RequestMapper
 *
 * @package App\AutoMapper
 * @author  TLe, <NAME> <<EMAIL>>
 */
class RequestMapper extends RestRequestMapper
{
    protected static $properties = [
        'name',
        'role',
    ];

    /**
     * @var RoleResource
     */
    private $roleResource;

    /**
     * RequestMapper constructor.
     *
     * @param RoleResource $roleResource
     */
    public function __construct(RoleResource $roleResource)
    {
        $this->roleResource = $roleResource;
    }

    /**
     * @param string $role
     *
     * @return Role
     *
     * @throws ORMException
     */
    protected function transformRole(string $role): Role
    {
        return $this->roleResource->getReference($role);
    }
}
{'fraction_non_alphanumeric': 0.12970521541950114, 'fraction_numerical': 0.0009070294784580499, 'mean_word_length': 2.7645051194539247, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 22, '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': '813007', 'n_tokens_mistral': 675, 'n_tokens_neox': 664, 'n_words': 135}