Completed
Push — master ( 0496dc...50ef2b )
by Shcherbak
02:37
created

LineEndingReview::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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
    public function getName() {
20
      return self::NAME;
21
    }
22
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function process(FileInfo $file, Report $report) {
28
      $tokens = $this->getInvalidStartTokens($file);
29
30
      foreach ($tokens as $token) {
31
        $report->addError($file, $this, 'Expect only LF line ending', $token->getLine());
32
      }
33
34
    }
35
36
  }