Completed
Push — master ( 6553f8...615432 )
by Robin
06:51 queued 03:39
created
src/Http/Controllers/CrawlController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.