Completed
Push — master ( 50ef2b...3bc0ea )
by Shcherbak
05:22
created

LineEndingReview   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A process() 0 8 2
1
<?php
2
3
  namespace Funivan\Cs\Tools\LineEnding;
4
5
  use Funivan\Cs\FileFinder\FileInfo;
6
  use Funivan\Cs\Message\Report;
7
8
  /**
9
   *
10
   */
11
  class LineEndingReview extends LineEndingAbstract {
12
13
    const NAME = 'php_line_ending_review';
14
15
16
    /**
17
     * @inheritdoc
18
     */
19 4
    public function getName() {
20 4
      return self::NAME;
21
    }
22
23
24
    /**
25
     * @inheritdoc
26
     */
27 4
    public function process(FileInfo $file, Report $report) {
28 4
      $tokens = $this->getInvalidStartTokens($file);
29
30 4
      foreach ($tokens as $token) {
31 3
        $report->addError($file, $this, 'Expect only LF line ending', $token->getLine());
32 4
      }
33
34 4
    }
35
36
  }