| 1 | <?php |
||
| 10 | class WebsiteSource implements SourceContract |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Handles in getting the text from source. |
||
| 14 | * |
||
| 15 | * @param string $data |
||
| 16 | * @return string |
||
| 17 | */ |
||
| 18 | public function handle(string $data): string |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get the DOM Node List of article tag. |
||
| 32 | * |
||
| 33 | * @return DOMNodeList|null |
||
| 34 | */ |
||
| 35 | protected function getDOMDocumentArticle(string $url) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get text from the articles DOM Node List. |
||
| 49 | * |
||
| 50 | * @param DOMNodeList $articles |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | protected function getTextFromArticle(DOMNodeList $articles): string |
||
| 80 | } |
If you suppress an error, we recommend checking for the error condition explicitly: