1 | <?php |
||
10 | trait CrawlerProperties |
||
11 | { |
||
12 | public function setConcurrency(int $concurrency): self |
||
18 | |||
19 | public function setMaximumResponseSize(int $maximumResponseSizeInBytes): self |
||
25 | |||
26 | public function setMaximumCrawlCount(int $maximumCrawlCount): self |
||
32 | |||
33 | public function setMaximumDepth(int $maximumDepth): self |
||
39 | |||
40 | public function ignoreRobots(): self |
||
46 | |||
47 | public function respectRobots(): self |
||
53 | |||
54 | public function setCrawlQueue(CrawlQueue $crawlQueue): self |
||
60 | |||
61 | public function executeJavaScript(): self |
||
67 | |||
68 | public function doNotExecuteJavaScript(): self |
||
74 | |||
75 | /** |
||
76 | * @param \Spatie\Crawler\CrawlObserver|array[\Spatie\Crawler\CrawlObserver] $crawlObservers |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function setCrawlObserver($crawlObservers) |
||
88 | |||
89 | public function setCrawlObservers(array $crawlObservers): self |
||
95 | |||
96 | public function addCrawlObserver(CrawlObserver $crawlObserver): self |
||
102 | |||
103 | public function setCrawlProfile(CrawlProfile $crawlProfile): self |
||
109 | |||
110 | public function getBaseUrl(): UriInterface |
||
114 | |||
115 | public function getCrawlQueue(): CrawlQueue |
||
119 | |||
120 | public function getCrawlProfile(): CrawlProfile |
||
124 | |||
125 | /** |
||
126 | * @return \Spatie\Crawler\CrawlObserver[] |
||
127 | */ |
||
128 | public function getCrawlObservers(): array |
||
132 | |||
133 | public function getMaximumResponseSize(): ?int |
||
137 | |||
138 | public function mustRespectRobots(): bool |
||
142 | |||
143 | public function getRobotsTxt(): RobotsTxt |
||
147 | |||
148 | public function getMaximumDepth(): ?int |
||
152 | |||
153 | public function getMaximumCrawlCount(): ?int |
||
157 | |||
158 | public function getCrawlerUrlCount(): int |
||
162 | |||
163 | public function getBrowsershot(): Browsershot |
||
171 | |||
172 | public function setBrowsershot(Browsershot $browsershot) |
||
178 | |||
179 | public function mayExecuteJavascript(): bool |
||
183 | } |
||
184 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: