Completed
Branch wip/litedown (377511)
by Josh
03:42
created

ForcedLineBreaks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 9 2
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2017 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter\Plugins\Litedown\Parser;
9
10
class ForcedLineBreaks extends AbstractParser
11
{
12
	/**
13
	* {@inheritdoc}
14
	*/
15
	protected function execute()
16
	{
17
		$pos = strpos($this->text, "  \n");
18
		while ($pos !== false)
19
		{
20
			$this->parser->addBrTag($pos + 2);
21
			$pos = strpos($this->text, "  \n", $pos + 3);
22
		}
23
	}
24
}