Passed
Pull Request — master (#77)
by
unknown
04:59 queued 02:06
created

File   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEolChar() 0 4 1
A getFixer() 0 4 1
A getTokens() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BestIt\CodeSniffer;
6
7
use http\Exception;
8
use PHP_CodeSniffer\Files\File as BaseFile;
9
use PHP_CodeSniffer\Fixer;
10
use function func_get_args;
11
12
/**
13
 * Class File
14
 *
15
 * Wrapper Class for PhpCsFile to provide a consistent way to replace int|bool returns
16
 * with int|bool returns false
17
 * Additionally there could be some architecture changes in the future, like Token-Objects and so on.
18
 *
19
 * @author Nick Lubisch <[email protected]>
20
 * @package BestIt\CodeSniffer
21
 */
22
class File extends AbstractFileDecorator
23
{
24
    /**
25
     * Returns the eol char of the file
26
     *
27
     * @return string Returns the EndOfLine-Character of the processed file
28
     */
29
    public function getEolChar(): string
30
    {
31
        return $this->getBaseFile()->eolChar;
32
    }
33
34
    /**
35
     * Returns the Wrapped PHP_CodeSniffer_Fixer
36
     *
37
     * @return Fixer Returns the fixer class.
38
     */
39
    public function getFixer(): Fixer
40
    {
41
        return $this->getBaseFile()->fixer;
42
    }
43
44
    /**
45
     * Returns the token stack for this file.
46
     *
47 121
     * @return array Return array of token data
48
     */
49 121
    public function getTokens(): array
50 121
    {
51 121
        return $this->tokens;
52 121
    }
53
}
54