Completed
Branch master (9d8d38)
by Łukasz
03:25
created

ImageViewFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
3
namespace Sylius\ShopApiPlugin\Factory;
4
5
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
6
use Sylius\Component\Core\Model\ImageInterface;
7
use Sylius\ShopApiPlugin\View\ImageView;
8
9
final class ImageViewFactory implements ImageViewFactoryInterface
10
{
11
    /**
12
     * @param ImageInterface $image
13
     *
14
     * @return ImageView
15
     */
16
    public function create(ImageInterface $image)
17
    {
18
        $imageView = new ImageView();
19
        $imageView->code = $image->getType();
20
        $imageView->path = $image->getPath();
21
22
        return $imageView;
23
    }
24
}
25