Completed
Push — master ( ebbacf...be7db5 )
by Łukasz
24:11 queued 15:48
created

ProductReviewViewFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sylius\ShopApiPlugin\Factory;
6
7
use Sylius\Component\Core\Model\ProductReview;
8
use Sylius\ShopApiPlugin\View\ProductReviewView;
9
10
final class ProductReviewViewFactory implements ProductReviewViewFactoryInterface
11
{
12
    public function create(ProductReview $productReview): ProductReviewView
13
    {
14
        $productReviewView = new ProductReviewView();
15
16
        $productReviewView->author = $productReview->getAuthor()->getEmail();
17
        $productReviewView->comment = $productReview->getComment();
18
        $productReviewView->rating = $productReview->getRating();
19
        $productReviewView->title = $productReview->getTitle();
20
21
        return $productReviewView;
22
    }
23
}
24