PathTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Statistics\Transformers\Adminarea;
6
7
use Rinvex\Statistics\Models\Path;
8
use Rinvex\Support\Traits\Escaper;
9
use League\Fractal\TransformerAbstract;
10
11
class PathTransformer extends TransformerAbstract
12
{
13
    use Escaper;
14
15
    /**
16
     * @return array
17
     */
18
    public function transform(Path $path): array
19
    {
20
        return $this->escape([
21
            'host' => (string) $path->host,
22
            'locale' => (string) $path->locale,
23
            'accessarea' => (string) $path->accessarea,
24
            'path' => (string) $path->path,
25
            'parameters' => (string) $path->parameters,
26
            'count' => (int) $path->count,
27
        ]);
28
    }
29
}
30