Passed
Push — 2.0 ( d68ee5...a984b1 )
by Kirill
04:24
created

SearchResultsSerializer   A

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
 * @package App\GraphQL\Serializers
16
 */
17
class SearchResultsSerializer extends AbstractSerializer
18
{
19
    /**
20
     * @param SearchResult $dto
21
     * @return array
22
     */
23
    public function toArray($dto): array
24
    {
25
        return [
26
            'slug'    => $dto->slug,
27
            'url'     => $dto->url,
28
            'content' => $dto->body,
29
            'title'   => $dto->title,
30
            'type'    => $dto->type,
31
        ];
32
    }
33
}