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 | /** |
||
60 | * @return \Generator|ExternalArticle[] |
||
61 | * @throws \RuntimeException |
||
62 | */ |
||
63 | private function getArticles(): \Generator |
||
71 | |||
72 | /** |
||
73 | * @param string $body |
||
74 | * @return \Generator |
||
75 | * @throws \RuntimeException |
||
76 | */ |
||
77 | private function parseBody(string $body): \Generator |
||
108 | |||
109 | /** |
||
110 | * @param string $body |
||
111 | * @return array |
||
112 | */ |
||
113 | private function parseContent(string $body): array |
||
127 | |||
128 | /** |
||
129 | * @param \DOMElement $root |
||
130 | * @param string $tagName |
||
131 | * @return null|string |
||
132 | */ |
||
133 | private function getContentOf(\DOMElement $root, string $tagName): ?string |
||
143 | } |
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.