FileFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFileFromPostValues() 0 8 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
}