Completed
Branch module_structure (3116d9)
by Pablo
02:56
created

hooksEnabledWithEnabledTools()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 54
Code Lines 39

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 54
rs 9.6716
cc 1
eloc 39
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
3
namespace PhpGitHooks\Module\Configuration\Tests\Stub;
4
5
class ConfigArrayDataStub
6
{
7
    const PHPCS_STANDARD = 'PSR2';
8
9
    const PHPUNIT_OPTIONS = '--suite default';
10
11
    const RIGHT_MESSAGE = 'good job';
12
13
    const REGULAR_EXPRESSION = '#[0-9]{2,7}';
14
15
    const ERROR_MESSAGE = 'fix your code';
16
17
    /**
18
     * @return array
19
     */
20
    public static function hooksEnabledWithEnabledTools()
21
    {
22
        return [
23
            'pre-commit' => [
24
                'enabled' => true,
25
                'process' => [
26
                    'composer' => true,
27
                    'jsonlint' => true,
28
                    'phplint' => true,
29
                    'phpmd' => true,
30
                    'phpcs' => [
31
                        'enabled' => true,
32
                        'standard' => static::PHPCS_STANDARD,
33
                    ],
34
                    'php-cs-fixer' => [
35
                        'enabled' => true,
36
                        'levels' => [
37
                            'psr0' => true,
38
                            'psr1' => true,
39
                            'psr2' => true,
40
                            'symfony' => true,
41
                        ],
42
                    ],
43
                    'phpunit' => [
44
                        'enabled' => true,
45
                        'random-mode' => true,
46
                        'options' => static::PHPUNIT_OPTIONS,
47
                    ],
48
                ],
49
                'messages' => [
50
                    'right-message' => static::RIGHT_MESSAGE,
51
                    'error-message' => static::ERROR_MESSAGE,
52
                ],
53
            ],
54
            'commit-msg' => [
55
                'enabled' => true,
56
                'regular-expression' => static::REGULAR_EXPRESSION,
57
            ],
58
            'pre-push' => [
59
                'enabled' => true,
60
                'process' => [
61
                    'phpunit' => [
62
                        'enabled' => true,
63
                        'random-mode' => true,
64
                        'options' => static::PHPUNIT_OPTIONS
65
                    ]
66
                ],
67
                'messages' => [
68
                    'right-message' => static::RIGHT_MESSAGE,
69
                    'error-message' => static::ERROR_MESSAGE,
70
                ]
71
            ]
72
        ];
73
    }
74
}
75