Total Complexity | 6 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 93.33% |
Changes | 0 |
1 | <?php # -*- coding: utf-8 -*- |
||
6 | class Paragraph implements ElementRuleInterface |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * Store the strings, there we exclude on set paragraph. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected static $paragraphExcludes = [ |
||
15 | '<', // HTML. |
||
16 | ' ', // Code. |
||
17 | "\t", // Tab. |
||
18 | '---', // hr |
||
19 | ]; |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 2 | public function parse(string $content): string |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Find the position of the first occurrence of a substring in a string. |
||
42 | * Get only true, if is on the first position (0). |
||
43 | * |
||
44 | * @param string $haystack The string to search in. |
||
45 | * @param array $needle An array with strings for search. |
||
46 | * @param int $offset If specified, search will start this number of characters counted |
||
47 | * from the beginning of the string. |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | 2 | protected function strposa(string $haystack, array $needle, int $offset = 0): bool |
|
64 |