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

Error::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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