Passed
Push — master ( 139939...b4b8e8 )
by Arthur
21:54 queued 17s
created

ProxyTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transformResource() 0 17 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 29.10.18
6
 * Time: 09:38.
7
 */
8
9
namespace Modules\Proxy\Transformers;
10
11
use Carbon\Carbon;
12
use Foundation\Abstracts\Transformers\Transformer;
13
use Foundation\Exceptions\Exception;
14
use Modules\Proxy\Entities\Proxy;
15
use Modules\Machine\Transformers\MachineTransformer;
16
use Modules\User\Transformers\UserTransformer;
17
18
class ProxyTransformer extends Transformer
19
{
20
    public $available = [
21
        'user' => UserTransformer::class
22
    ];
23
24
    /**
25
     * Transform the resource into an array.
26
     *
27
     * @throws Exception
28
     *
29
     * @return array
30
     */
31
    public function transformResource(Proxy $proxy)
32
    {
33
        return [
34
            'id' => $proxy->id,
35
            'alias' => $proxy->alias,
0 ignored issues
show
Bug introduced by
The property alias does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
36
            'ip_address' => $proxy->ip_address,
0 ignored issues
show
Bug introduced by
The property ip_address does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
37
            'port' => $proxy->port,
0 ignored issues
show
Bug introduced by
The property port does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
38
            'username' => $proxy->username,
0 ignored issues
show
Bug introduced by
The property username does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
39
            'password' => $proxy->password,
0 ignored issues
show
Bug introduced by
The property password does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
40
            'type' => $proxy->type,
0 ignored issues
show
Bug introduced by
The property type does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
41
            'online' => $proxy->online,
0 ignored issues
show
Bug introduced by
The property online does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
42
            'monitor' => $proxy->monitor,
0 ignored issues
show
Bug introduced by
The property monitor does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
43
            'anonimity_level' => $proxy->anonimity_level,
0 ignored issues
show
Bug introduced by
The property anonimity_level does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
44
            'last_alive_at' => $proxy->last_alive_at,
0 ignored issues
show
Bug introduced by
The property last_alive_at does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
45
            'last_checked_at' => $proxy->last_checked_at,
0 ignored issues
show
Bug introduced by
The property last_checked_at does not seem to exist on Modules\Proxy\Entities\Proxy. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
46
            'created_at' => $proxy->created_at,
47
            'updated_at' => $proxy->updated_at,
48
        ];
49
    }
50
}
51