WhitespaceFinder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A findNextEmptyLinePosition() 0 13 2
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of Zenify
7
 * Copyright (c) 2012 Tomas Votruba (http://tomasvotruba.cz)
8
 */
9
10
namespace ZenifyCodingStandard\Helper\Whitespace;
11
12
use PHP_CodeSniffer_File;
13
14
15
final class WhitespaceFinder
16
{
17
18 1
	public static function findNextEmptyLinePosition(PHP_CodeSniffer_File $file, int $position) : int
19
	{
20 1
		$tokens = $file->getTokens();
21
22 1
		$currentLine = $tokens[$position]['line'];
23 1
		$nextLinePosition = $position;
24
		do {
25 1
			++$nextLinePosition;
26 1
			$nextLine = $tokens[$nextLinePosition]['line'];
27 1
		} while ($currentLine === $nextLine);
28
29 1
		return $nextLinePosition;
30
	}
31
32
}
33