Code Duplication    Length = 19-20 lines in 2 locations

server/app/GraphQL/Serializers/DocsPageSerializer.php 1 location

@@ 18-36 (lines=19) @@
15
/**
16
 * Class DocsSerializer.
17
 */
18
class DocsPageSerializer extends AbstractSerializer
19
{
20
    /**
21
     * @param  Model|DocsPage $page
22
     * @return array
23
     */
24
    public function toArray($page): array
25
    {
26
        return [
27
            'id'             => $page->id,
28
            'title'          => trim($page->title),
29
            'slug'           => trim($page->slug),
30
            'content'        => $page->content_rendered,
31
            'content_source' => $page->content_source,
32
            'created_at'     => $this->formatDateTime($page->created_at),
33
            'updated_at'     => $this->formatDateTime($page->updated_at),
34
        ];
35
    }
36
}
37

server/app/GraphQL/Serializers/DocsSerializer.php 1 location

@@ 17-36 (lines=20) @@
14
/**
15
 * Class DocsSerializer.
16
 */
17
class DocsSerializer extends AbstractSerializer
18
{
19
    /**
20
     * @param  Model|Docs $docs
21
     * @return array
22
     */
23
    public function toArray($docs): array
24
    {
25
        return [
26
            'id'          => $docs->id,
27
            'project'     => trim($docs->slug),
28
            'title'       => trim($docs->title),
29
            'image'       => $docs->image,
30
            'version'     => $docs->version,
31
            'description' => $docs->description,
32
            'created_at'  => $this->formatDateTime($docs->created_at),
33
            'updated_at'  => $this->formatDateTime($docs->updated_at),
34
        ];
35
    }
36
}
37