Passed
Push — master ( 792d70...44c05d )
by Maximilian
01:22 queued 16s
created

Error   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
c 1
b 0
f 0
dl 0
loc 32
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\System;
4
5
/**
6
 * @author Maximilian Beckers <[email protected]>
7
 */
8
class Error
9
{
10
    const MEDIA_ERROR_UNKNOWN               = 'MEDIA_ERROR_UNKNOWN';
11
    const MEDIA_ERROR_INVALID_REQUEST       = 'MEDIA_ERROR_INVALID_REQUEST';
12
    const MEDIA_ERROR_SERVICE_UNAVAILABLE   = 'MEDIA_ERROR_SERVICE_UNAVAILABLE';
13
    const MEDIA_ERROR_INTERNAL_SERVER_ERROR = 'MEDIA_ERROR_INTERNAL_SERVER_ERROR';
14
    const MEDIA_ERROR_INTERNAL_DEVICE_ERROR = 'MEDIA_ERROR_INTERNAL_DEVICE_ERROR';
15
16
    /**
17
     * @var string
18
     */
19
    public $type;
20
21
    /**
22
     * @var string
23
     */
24
    public $message;
25
26
    /**
27
     * @param string $type
28
     * @param string $message
29
     *
30
     * @return Error
31
     */
32 5
    public static function create(string $type, string $message): self
33
    {
34 5
        $error = new self();
35
36 5
        $error->type    = $type;
37 5
        $error->message = $message;
38
39 5
        return $error;
40
    }
41
}
42