| Total Complexity | 8 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 93.75% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class HtmlSplitter implements SplitterContract |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * The list of html tags. |
||
| 23 | * |
||
| 24 | * @var string[] |
||
| 25 | */ |
||
| 26 | protected $tags = [ |
||
| 27 | 'h1', |
||
| 28 | 'h2', |
||
| 29 | 'h3', |
||
| 30 | 'h4', |
||
| 31 | 'h5', |
||
| 32 | 'p', |
||
| 33 | ]; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Creates a new instance of the class. |
||
| 37 | * |
||
| 38 | * @param array $tags |
||
| 39 | * |
||
| 40 | * @return void |
||
| 41 | */ |
||
| 42 | 3 | public function __construct(array $tags = null) |
|
| 46 | } |
||
| 47 | 3 | } |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Acts a static factory. |
||
| 51 | * |
||
| 52 | * @param string|array $tags |
||
| 53 | * |
||
| 54 | * @return static |
||
| 55 | */ |
||
| 56 | 2 | public static function by($tags) |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Splits the given value. |
||
| 63 | * |
||
| 64 | * @param object $searchable |
||
| 65 | * @param string $value |
||
| 66 | * |
||
| 67 | * @return array |
||
| 68 | */ |
||
| 69 | 3 | public function split($searchable, $value): array |
|
| 88 |