SearchResultsSerializer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 10 1
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\GraphQL\Serializers;
10
11
use Service\SearchService\SearchResult;
12
13
/**
14
 * Class SearchResultsSerializer.
15
 */
16
class SearchResultsSerializer extends AbstractSerializer
17
{
18
    /**
19
     * @param SearchResult $dto
20
     * @return array
21
     */
22
    public function toArray($dto): array
23
    {
24
        return [
25
            'slug'    => $dto->slug,
26
            'url'     => $dto->url,
27
            'content' => $dto->body,
28
            'title'   => $dto->title,
29
            'type'    => $dto->type,
30
        ];
31
    }
32
}
33