Completed
Push — develop ( 996869...2e4ada )
by Abdelrahman
13:50
created

RequestTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 19 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Statistics\Transformers\Adminarea;
6
7
use Rinvex\Statistics\Models\Request;
8
use League\Fractal\TransformerAbstract;
9
10
class RequestTransformer extends TransformerAbstract
11
{
12
    /**
13
     * @return array
14
     */
15
    public function transform(Request $request): array
16
    {
17
        return [
18
            'user' => (string) $request->user,
19
            'session_id' => (string) $request->session_id,
20
            'status_code' => (string) $request->status_code,
21
            'method' => (string) $request->method,
22
            'protocol_version' => (string) $request->protocol_version,
23
            'referer' => (string) $request->referer,
24
            'language' => (string) $request->language,
25
            'is_no_cache' => (bool) $request->is_no_cache,
26
            'wants_json' => (bool) $request->wants_json,
27
            'is_secure' => (bool) $request->is_secure,
28
            'is_json' => (bool) $request->is_json,
29
            'is_ajax' => (bool) $request->is_ajax,
30
            'is_pjax' => (bool) $request->is_pjax,
31
            'created_at' => (string) $request->created_at,
32
        ];
33
    }
34
}
35