Completed
Push — develop ( c6a956...40134e )
by Steven
9s
created

Project::create()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 11
rs 9.4285
cc 3
eloc 8
nc 3
nop 4
1
<?php namespace Magestead\Installers;
2
3
/**
4
 * Class Project
5
 * @package Magestead\Installers
6
 */
7
class Project
8
{
9
    /**
10
     * @param array $options
11
     * @param array $config
12
     * @param $projectPath
13
     * @param $output
14
     * @return Magento2Project|MagentoProject
15
     */
16
    public static function create(array $options, array $config, $projectPath, $output)
17
    {
18
        switch ($options['app']) {
19
            case "magento":
20
                return new MagentoProject($options, $config, $projectPath, $output);
21
            break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
22
            case "magento2":
23
                return new Magento2Project($options, $config, $projectPath, $output);
24
            break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
25
        }
26
    }
27
}