Code Duplication    Length = 12-12 lines in 2 locations

src/Controller/Endpoint/Search/SearchEndpointController.php 2 locations

@@ 139-150 (lines=12) @@
136
     *
137
     * @return ResponseInterface|boolean
138
     */
139
    public function parsePlayerName($name)
140
    {
141
        if (empty($name)) {
142
            return $this->respondWithError('Player name needs to be present.', self::CODE_WRONG_ARGS);
143
        }
144
145
        if (strlen($name) > 24) {
146
            return $this->respondWithError('Player names cannot be longer than 24 characters.', self::CODE_WRONG_ARGS);
147
        }
148
149
        return true;
150
    }
151
152
    /**
153
     * Parses a outfit name and makes sure it's valid
@@ 159-170 (lines=12) @@
156
     *
157
     * @return ResponseInterface|boolean
158
     */
159
    public function parseOutfitName($name)
160
    {
161
        if (empty($name)) {
162
            return $this->respondWithError('Outfit name needs to be present.', self::CODE_WRONG_ARGS);
163
        }
164
165
        if (strlen($name) > 32) {
166
            return $this->respondWithError('Outfit names cannot be longer than 32 characters.', self::CODE_WRONG_ARGS);
167
        }
168
169
        return true;
170
    }
171
172
    /**
173
     * Runs checks on the player ID