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

ImageViewFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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