@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return bool |
54 | 54 | */ |
55 | 55 | protected function controllerIsSetup() { |
56 | - if(!is_null($this->crawler_id)) { |
|
56 | + if (!is_null($this->crawler_id)) { |
|
57 | 57 | return true; |
58 | 58 | } |
59 | 59 | |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function setupCrawler($crawler_id = null) |
69 | 69 | { |
70 | - if(!is_null($crawler_id)) { |
|
70 | + if (!is_null($crawler_id)) { |
|
71 | 71 | $this->setCrawlerId($crawler_id); |
72 | 72 | } |
73 | 73 | |
74 | - if($this->controllerIsSetup()) { |
|
74 | + if ($this->controllerIsSetup()) { |
|
75 | 75 | $times = config('laravel-job-handler.run_times', 10); |
76 | 76 | |
77 | 77 | for ($x = 0; $x <= $times; $x++) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $this->getCrawler(); |
80 | 80 | |
81 | 81 | if (!$this->crawler->enabled) { |
82 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - crawler isnt enabled in database'); |
|
82 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - crawler isnt enabled in database'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $checkIfCrawlerCanBeRunned = $this->canCrawlerRunAfterPeriod(); |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | |
97 | 97 | |
98 | 98 | if ($this->crawler->latest_status == 3) { |
99 | - throw new CrawlerException('Crawler (#' . $this->crawler_id . ') - last run had an error'); |
|
99 | + throw new CrawlerException('Crawler (#'.$this->crawler_id.') - last run had an error'); |
|
100 | 100 | } |
101 | 101 | } else { |
102 | - throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait ' . $checkIfCrawlerCanBeRunned['retry_in'] . ' more seconds to run'); |
|
102 | + throw new CrawlerNotReachedTimeBetweenJobsException('Has to wait '.$checkIfCrawlerCanBeRunned['retry_in'].' more seconds to run'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | if ($x == $times) { |
106 | - $this->failCrawler('Crawler (#' . $this->crawler_id . ') - max execution time'); |
|
106 | + $this->failCrawler('Crawler (#'.$this->crawler_id.') - max execution time'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($this->crawler->status == 1) { |