Passed
Push — master ( 1f3f4f...3dfcc2 )
by Francis
01:31
created

Account::fromObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace LiveStream\Resources;
4
5
class Account extends Resource
6
{
7
    public static function fromObject(object $object): Resource
8
    {
9
        $instance = parent::fromObject($object);
10
11
        $instance->picture = Picture::fromObject($instance->picture);
0 ignored issues
show
Bug Best Practice introduced by
The property picture does not exist on LiveStream\Resources\Resource. Since you implemented __set, consider adding a @property annotation.
Loading history...
Bug introduced by
$instance->picture of type void is incompatible with the type object expected by parameter $object of LiveStream\Resources\Resource::fromObject(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

11
        $instance->picture = Picture::fromObject(/** @scrutinizer ignore-type */ $instance->picture);
Loading history...
Bug Best Practice introduced by
The property picture does not exist on LiveStream\Resources\Resource. Since you implemented __get, consider adding a @property annotation.
Loading history...
12
        
13
        return $instance;
14
    }
15
}
16