File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ final class Crawler
3636 private $ params = [];
3737 private $ bypass = false ;
3838 private $ resources = 4 ;
39- private $ limit = 10 ; // 10000
4039 private $ save = false ;
4140 private $ path = 'public/cache ' ;
4241 private $ signature = true ;
4342 private $ ua ;
43+ private static $ limit = 1000 ;
4444
4545 /**
4646 * Init crawler.
@@ -101,12 +101,11 @@ public function setResources(int $cores) : self
101101 *
102102 * @access public
103103 * @param int $limit
104- * @return object
104+ * @return void
105105 */
106- public function setLimit (int $ limit ) : self
106+ public static function limit (int $ limit ) : void
107107 {
108- $ this ->limit = $ limit ;
109- return $ this ;
108+ self ::$ limit = $ limit ;
110109 }
111110
112111 /**
@@ -193,8 +192,8 @@ private function hasResources() : bool
193192 */
194193 private function setUrls (array $ urls ) : void
195194 {
196- if ( count ($ urls ) > $ this -> limit ) {
197- $ urls = Arrayify::slice ($ urls , 0 , $ this -> limit );
195+ if ( count ($ urls ) > self :: $ limit ) {
196+ $ urls = Arrayify::slice ($ urls , 0 , self :: $ limit );
198197 }
199198 $ this ->urls = $ urls ;
200199 }
You can’t perform that action at this time.
0 commit comments