Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | ->setPageVisitedCallback(function (DomCrawler $domCrawler) use (&$dataGathered) { |
||
21 | //callback will be called for every visited page, including the base url, so let's ensure that |
||
22 | //repo data will be gathered only on repo pages |
||
23 | if (!preg_match('/radowoj\/\w+/', $domCrawler->getUri())) { |
||
|
|||
24 | return; |
||
25 | } |
||
26 | |||
27 | $readme = $domCrawler->filter('article.markdown-body'); |
||
28 | |||
29 | $dataGathered[] = [ |
||
30 | 'title' => trim($domCrawler->filter('p.f4.my-3')->text()), |
||
31 | 'readme' => $readme->count() ? trim($readme->text()) : '', |
||
32 | ]; |
||
41 |