Passed
Push — master ( 945884...0c08bd )
by Danny
04:15
created

DefaultConfiguration::getDefaultConfiguration()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 93
Code Lines 52

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 93
rs 8.4642
c 1
b 0
f 0
cc 1
eloc 52
nc 1
nop 0

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
namespace PressCLI\Option;
3
4
trait DefaultConfiguration
5
{
6
    /**
7
     * The default Press CLI configuration.
8
     *
9
     * @return array The default configuration.
10
     */
11
    public static function getDefaultConfiguration() {
12
        return [
13
            'database' => [
14
                'user' => 'root',
15
                'password' => 'root',
16
                'prefix' => 'wp_',
17
                'name' => '',
18
                'host' => '127.0.0.1',
19
            ],
20
            'plugins' => [
21
                [
22
                    'plugin' => 'jetpack',
23
                    'activate' => false,
24
                ],
25
                [
26
                    'plugin' => 'crop-thumbnails',
27
                    'activate' => true,
28
                ],
29
                [
30
                    'plugin' => 'query-monitor',
31
                    'activate' => true,
32
                ],
33
                [
34
                    'plugin' => 'force-regenerate-thumbnails',
35
                    'activate' => true,
36
                ],
37
                [
38
                    'plugin' => 'force-regenerate-thumbnails',
39
                    'activate' => true,
40
                ],
41
                [
42
                    'plugin' => 'mailtrap-for-wp',
43
                    'activate' => false,
44
                ],
45
                // [
46
                //     'plugin' => 'wp-migrate-db-pro',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
47
                //     'activate' => false,
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
48
                //     'location' => '~/Desktop/plugins/wp-migrate-db-pro.zip',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
49
                // ],
50
            ],
51
            'user' => [
52
                'name' => '',
53
                'email' => '',
54
                'password' => '',
55
            ],
56
            'theme' => [
57
                'type' => 'zip',
58
                'url' => 'https://github.com/matchboxdesigngroup/kindling/archive/1.0.1.zip',
59
                'name' => '',
60
                // 'style-css' => [
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
61
                //     'theme-name' => '',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
62
                //     'client' => '',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
63
                //     'version' => '1.0.0-dev',
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
64
                // ],
65
            ],
66
            'menus' => [
67
                [
68
                    'name' => 'Primary Navigation',
69
                    'location' => 'primary_navigation',
70
                ],
71
                [
72
                    'name' => 'Footer Navigation',
73
                    'location' => 'footer_navigation',
74
                ],
75
                [
76
                    'name' => 'Social Menu',
77
                    'location' => 'social_menu',
78
                ],
79
            ],
80
            'site' => [
81
                'title' => '',
82
                'url' => '',
83
            ],
84
            'rewrite' => [
85
                'structure' => '/%postname%/',
86
            ],
87
            'commands' => [
88
                'preInstall' => [],
89
                'postInstallTheme' => [
90
                    'yarn',
91
                    'bower install',
92
                ],
93
                'postInstall' => [],
94
            ],
95
            'settings' => [
96
                'afterInstall' => [
97
                    'removeUserPassword' => true,
98
                    'removeUserEmail' => true,
99
                    'removeUserName' => true,
100
                ],
101
            ],
102
        ];
103
    }
104
}
105