AbstractBaseItem   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 7 1
1
<?php
2
3
4
namespace Inktale\Api\Structures;
5
6
7
abstract class AbstractBaseItem
8
{
9
    /**
10
     * Raw data retrieved from API
11
     * @var array
12
     */
13
    public $raw = [];
14
15
    /**
16
     * Convert raw response data to item
17
     *
18
     * @param array|mixed $raw
19
     * @return static
20
     * @throws \Exception
21
     */
22
    static function fromArray($raw)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
23
    {
24
        throw new \Exception(
25
            'fromArray not implemented for ' . __CLASS__ . ' with data: '
26
            . print_r($raw, true)
27
        );
28
    }
29
}