Completed
Push — master ( 5cf284...830bc1 )
by Tomáš
03:38
created

LegacyConfiguration   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 24
ccs 0
cts 11
cp 0
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
    public static function setup()
13
    {
14
        self::ensureLineEndingsAreDetected();
15
        self::setupVerbosityToMakeLegacyCodeRun();
16
    }
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
    private static function ensureLineEndingsAreDetected()
23
    {
24
        ini_set('auto_detect_line_endings', true);
25
    }
26
27
    private static function setupVerbosityToMakeLegacyCodeRun()
28
    {
29
        if (!defined('PHP_CODESNIFFER_VERBOSITY')) {
30
            define('PHP_CODESNIFFER_VERBOSITY', 0);
31
        }
32
    }
33
}
34