ProxyTransformer::transformResource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 1
dl 0
loc 18
ccs 0
cts 18
cp 0
crap 2
rs 9.7333
c 0
b 0
f 0
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 Foundation\Abstracts\Transformers\Transformer;
12
use Foundation\Exceptions\Exception;
13
use Modules\Proxy\Entities\Proxy;
14
use Modules\User\Transformers\UserTransformer;
15
16
class ProxyTransformer extends Transformer
17
{
18
    public $available = [
19
        'user' => UserTransformer::class,
20
    ];
21
22
    /**
23
     * Transform the resource into an array.
24
     *
25
     * @throws Exception
26
     *
27
     * @return array
28
     */
29
    public function transformResource(Proxy $proxy)
30
    {
31
        return [
32
            'id' => $proxy->id,
33
            '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...
34
            '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...
35
            '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...
36
            '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...
37
            '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...
38
            '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...
39
            'uptime' => $proxy->uptime,
0 ignored issues
show
Bug introduced by
The property uptime 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
            '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...
41
            '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...
42
            '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...
43
            '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...
44
            '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...
45
            'created_at' => $proxy->created_at,
46
            'updated_at' => $proxy->updated_at,
47
        ];
48
    }
49
}
50