Completed
Push — master ( 198b3f...28f717 )
by Nate
02:18
created

Factory::setIncludes()   B

Complexity

Conditions 7
Paths 12

Size

Total Lines 61
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 61
rs 7.399
c 0
b 0
f 0
cc 7
eloc 25
nc 12
nop 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * @package   Transform
5
 * @author    Flipbox Factory
6
 * @copyright Copyright (c) 2017, Flipbox Digital
7
 * @link      https://github.com/flipbox/transform/releases/latest
8
 * @license   https://github.com/flipbox/transform/blob/master/LICENSE
9
 */
10
11
namespace flipbox\transform;
12
13
use flipbox\transform\resources\Collection;
14
use flipbox\transform\resources\Item;
15
16
/**
17
 * @package flipbox\transform
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class Factory
22
{
23
24
    /**
25
     * @param array $config
26
     * @return Collection
27
     */
28
    public static function collection(array $config = []): Collection
29
    {
30
        return new Collection(
31
            new Scope(
32
                new Transform($config)
33
            )
34
        );
35
    }
36
37
    /**
38
     * @param array $config
39
     * @return Item
40
     */
41
    public static function item(array $config = []): Item
42
    {
43
        return new Item(
44
            new Scope(
45
                new Transform($config)
46
            )
47
        );
48
49
    }
50
51
}
52