ArticleTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 8 1
1
<?php
2
3
4
namespace App\Project\Domain\Article;
5
6
7
use App\Project\Domain\Article\Entity\Article;
8
use League\Fractal\TransformerAbstract;
9
10
class ArticleTransformer extends TransformerAbstract
11
{
12
    /**
13
     * @param Article $article
14
     * @return array
15
     */
16
    public function transform(Article $article)
17
    {
18
        return [
19
            'id' => $article->getId(),
20
            'title' => $article->getTitle(),
21
            'body' => $article->getBody(),
22
            'tags' => $article->getTags(),
23
            'createdAt' => date('Y-m-d')
24
        ];
25
    }
26
27
}