Completed
Push — master ( 393329...74ff7b )
by Tomáš
10:49
created

LegacyConfiguration   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 90.91%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 24
ccs 10
cts 11
cp 0.9091
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setup() 0 5 1
A ensureLineEndingsAreDetected() 0 4 1
A setupVerbosityToMakeLegacyCodeRun() 0 6 2
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\PHP7_CodeSniffer\Legacy;
9
10
final class LegacyConfiguration
11
{
12 1
    public static function setup()
13
    {
14 1
        self::ensureLineEndingsAreDetected();
15 1
        self::setupVerbosityToMakeLegacyCodeRun();
16 1
    }
17
18
    /**
19
     * Ensure this option is enabled or else line endings will not always
20
     * be detected properly for files created on a Mac with the /r line ending.
21
     */
22 1
    private static function ensureLineEndingsAreDetected()
23
    {
24 1
        ini_set('auto_detect_line_endings', true);
25 1
    }
26
27 1
    private static function setupVerbosityToMakeLegacyCodeRun()
28
    {
29 1
        if (!defined('PHP_CODESNIFFER_VERBOSITY')) {
30
            define('PHP_CODESNIFFER_VERBOSITY', 0);
31
        }
32 1
    }
33
}
34