ImageUploadService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A prepareImageFile() 0 4 1
1
<?php
2
3
4
namespace HustleWorks\ChuteLaravel\Services;
5
6
use HustleWorks\Chute\ImageFile;
7
use HustleWorks\Chute\ImageUploader;
8
use HustleWorks\Chute\ImageValidator;
9
use HustleWorks\ChuteLaravel\Repositories\ImageRepository;
10
11
class ImageUploadService extends ImageUploader
12
{
13
    /**
14
     * ImageUploadService constructor.
15
     */
16
    public function __construct()
17
    {
18
        parent::__construct(new ImageValidator, new StorageService, new ImageRepository);
19
    }
20
21
    /**
22
     * Prepare Image File
23
     *
24
     * Take raw upload and convert it to an ImageFile object
25
     *
26
     * @param $framework_file
27
     * @return ImageFile
28
     */
29
    protected function prepareImageFile($framework_file): ImageFile
30
    {
31
        return new UploadedFileImage($framework_file);
32
    }
33
}