1 | <?php |
||
19 | class LaravelNewsDataProvider implements DataProviderInterface |
||
20 | { |
||
21 | private const CONTENT_NAMESPACE = 'http://purl.org/rss/1.0/modules/content/'; |
||
22 | private const FEED_URL = 'https://feed.laravel-news.com'; |
||
23 | |||
24 | /** |
||
25 | * @var Client |
||
26 | */ |
||
27 | private $client; |
||
28 | |||
29 | /** |
||
30 | * LaravelNewsDataProvider constructor. |
||
31 | * @param Client $client |
||
32 | */ |
||
33 | public function __construct(Client $client) |
||
37 | |||
38 | /** |
||
39 | * @param \DateTime $latest |
||
40 | * @return Collection|ExternalArticle[] |
||
41 | * @throws \RuntimeException |
||
42 | */ |
||
43 | public function getLatest(\DateTime $latest): Collection |
||
57 | |||
58 | /** |
||
59 | * @return \Generator|ExternalArticle[] |
||
60 | * @throws \RuntimeException |
||
61 | */ |
||
62 | private function getArticles(): \Generator |
||
70 | |||
71 | /** |
||
72 | * @param string $body |
||
73 | * @return \Generator |
||
74 | * @throws \RuntimeException |
||
75 | */ |
||
76 | private function parseBody(string $body): \Generator |
||
110 | |||
111 | /** |
||
112 | * @param string $body |
||
113 | * @return array |
||
114 | */ |
||
115 | private function parseContent(string $body): array |
||
129 | |||
130 | /** |
||
131 | * @param \DOMElement $root |
||
132 | * @param string $tagName |
||
133 | * @return null|string |
||
134 | */ |
||
135 | private function getContentOf(\DOMElement $root, string $tagName): ?string |
||
143 | } |
||
144 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.