1 | <?php |
||
13 | class SitemapGenerator |
||
14 | { |
||
15 | /** @var \Spatie\Sitemap\Sitemap */ |
||
16 | protected $sitemap; |
||
17 | |||
18 | /** @var string */ |
||
19 | protected $urlToBeCrawled = ''; |
||
20 | |||
21 | /** @var \Spatie\Crawler\Crawler */ |
||
22 | protected $crawler; |
||
23 | |||
24 | /** @var callable */ |
||
25 | protected $shouldCrawl; |
||
26 | |||
27 | /** @var callable */ |
||
28 | protected $hasCrawled; |
||
29 | |||
30 | /** @var int */ |
||
31 | protected $concurrency = 10; |
||
32 | |||
33 | /** |
||
34 | * @param string $urlToBeCrawled |
||
35 | * |
||
36 | * @return static |
||
37 | */ |
||
38 | public static function create(string $urlToBeCrawled) |
||
39 | { |
||
40 | return app(static::class)->setUrl($urlToBeCrawled); |
||
41 | } |
||
42 | |||
43 | public function __construct(Crawler $crawler) |
||
53 | |||
54 | public function setConcurrency(int $concurrency) |
||
58 | |||
59 | public function setUrl(string $urlToBeCrawled) |
||
65 | |||
66 | public function shouldCrawl(callable $shouldCrawl) |
||
72 | |||
73 | public function hasCrawled(callable $hasCrawled) |
||
79 | |||
80 | public function getSitemap(): Sitemap |
||
94 | |||
95 | /** |
||
96 | * @param string $path |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function writeToFile(string $path) |
||
106 | |||
107 | protected function getCrawlProfile(): CrawlProfile |
||
130 | |||
131 | protected function getCrawlObserver(): Observer |
||
143 | } |
||
144 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.