Lines 100.00% 1 / 1
Methods 100.00% 1 / 1
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
39final class Me
40{
41    public const string READ = 'me:read';
42
43    public const string WRITE = 'me:write';
44
45    public function __construct(
46        #[Groups([self::READ])]
47        public readonly int $id,
48        #[Groups([self::READ])]
49        public readonly string $identifier,
50        #[Groups([self::READ])]
51        public readonly string $role,
52        /** Null until the user or the first stats upload sets it; PATCH without it (or null) keeps it. */
53        #[Groups([self::READ, self::WRITE])]
54        #[Assert\NotBlank(allowNull: true, normalizer: 'trim')]
55        #[Assert\Regex(pattern: User::AGENT_NAME_PATTERN, message: User::AGENT_NAME_INVALID, normalizer: 'trim')]
56        public ?string $agentName,
57        /** PATCH without it (or null) keeps them. */
58        #[Groups([self::READ, self::WRITE])]
59        #[Assert\Valid]
60        public ?CustomMedals $customMedals = null,
61        /**
62         * The profile parts other users see; PATCH replaces them (without the agent part none are
63         * stored) and counts as chosen; without it (or null) keeps them.
64         *
65         * @var list<ProfilePart>|null
66         */
67        #[Groups([self::READ, self::WRITE])]
68        public ?array $visibleParts = null,
69        /** False until the user chose which profile parts other users see (the app asks). */
70        #[Groups([self::READ])]
71        public bool $visibilityChosen = false,
72        /** The Google profile picture (100 px JPEG data: URI), null without one. */
73        #[Groups([self::READ])]
74        public ?string $avatar = null,
75        /** What the app synced from Bannergress, null until it did; PATCH replaces it, without it (or null) keeps it. */
76        #[Groups([self::READ, self::WRITE])]
77        #[Assert\Valid]
78        public ?Bannergress $bannergress = null,
79    ) {
80    }
81}