Code Duplication    Length = 27-27 lines in 2 locations

src/Api/NormalizerException.php 1 location

@@ 12-38 (lines=27) @@
9
 *
10
 * @author Jacob Bare <[email protected]>
11
 */
12
class NormalizerException extends AbstractHttpException
13
{
14
    public static function unableToNormalizePayload($type, $message = null)
15
    {
16
        return new self(
17
            sprintf(
18
                'Unable to normalize payload for entity type "%s". %s',
19
                $type,
20
                $message
21
            ),
22
            400,
23
            __FUNCTION__
24
        );
25
    }
26
27
    public static function badRequest($message = null)
28
    {
29
        return new self(
30
            sprintf(
31
                'Oops. We were unable to process this API request. %s',
32
                $message
33
            ),
34
            400,
35
            __FUNCTION__
36
        );
37
    }
38
}
39

src/Api/SerializerException.php 1 location

@@ 12-38 (lines=27) @@
9
 *
10
 * @author Jacob Bare <[email protected]>
11
 */
12
class SerializerException extends AbstractHttpException
13
{
14
    public static function unableToNormalizePayload($type, $message = null)
15
    {
16
        return new self(
17
            sprintf(
18
                'Unable to normalize payload for entity type "%s". %s',
19
                $type,
20
                $message
21
            ),
22
            400,
23
            __FUNCTION__
24
        );
25
    }
26
27
    public static function badRequest($message = null)
28
    {
29
        return new self(
30
            sprintf(
31
                'Oops. We were unable to process this API request. %s',
32
                $message
33
            ),
34
            400,
35
            __FUNCTION__
36
        );
37
    }
38
}
39