Passed
Push — master ( b91050...6fb96f )
by Jens
02:59
created

FileFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFileFromPostValues() 0 9 1
1
<?php
2
/**
3
 * Created by: Jens
4
 * Date: 12-10-2017
5
 */
6
7
namespace CloudControl\Cms\storage\factories;
8
9
10
use CloudControl\Cms\storage\entities\File;
11
12
class FileFactory
13
{
14
    /**
15
     * @param $postValues
16
     * @param $filename
17
     * @return File
18
     *
19
     */
20
    public static function createFileFromPostValues($postValues, $filename)
21
    {
22
        $fileObject = new \stdClass();
23
        $fileObject->file = $filename;
24
        $fileObject->type = $postValues['type'];
25
        $fileObject->size = $postValues['size'];
26
27
        return new File($fileObject);
28
    }
29
}