Error_::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Baguette\Mastodon\Entity;
4
5
/**
6
 * Error
7
 *
8
 * @author    USAMI Kenta <[email protected]>
9
 * @copyright 2017 Baguette HQ
10
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0
11
 * @see https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#error
12
 * @property-read string $error A textual description of the error
13
 */
14
class Error_ extends Entity
15
{
16
    use \Teto\Object\TypedProperty;
17
18
    private static $property_types = [
0 ignored issues
show
Unused Code introduced by
The property $property_types is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
19
        'error' => 'string',
20
    ];
21
22 2
    public function __construct(array $properties)
23
    {
24 2
        $this->setProperties($properties);
25 2
    }
26
27
    /**
28
     * Returns error data as array
29
     *
30
     * @return array
31
     */
32 2
    public function toArray()
33
    {
34
        return [
35 2
            'error' => $this->error,
36
        ];
37
    }
38
}
39