Test Setup Failed
Push — master ( 79a996...894c42 )
by Php Easy Api
04:27
created
src/resta/Worker/WorkerManagerAbstract.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
      * @param ApplicationContracts $app
25 25
      * @param array $args
26 26
      */
27
-    public function __construct(ApplicationContracts $app, $args=array())
27
+    public function __construct(ApplicationContracts $app, $args = array())
28 28
     {
29 29
         parent::__construct($app);
30 30
 
31
-        if($this->app->runningInConsole()===false){
31
+        if ($this->app->runningInConsole()===false) {
32 32
             exception()->runtime('The worker can only be run as cli..');
33 33
         }
34 34
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function getApply()
46 46
     {
47
-        if(isset($this->args['apply'])){
47
+        if (isset($this->args['apply'])) {
48 48
             return $this->args['apply'];
49 49
         }
50 50
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function getData()
60 60
     {
61
-        if(isset($this->args['data'])){
61
+        if (isset($this->args['data'])) {
62 62
             return $this->args['data'];
63 63
         }
64 64
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function getPauseValue()
74 74
     {
75
-        if(isset($this->args['pause'])){
75
+        if (isset($this->args['pause'])) {
76 76
             return $this->args['pause'];
77 77
         }
78 78
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function getWorker()
88 88
     {
89
-        if(isset($this->args['worker'],$this->worker[$worker = strtolower($this->args['worker'])])){
89
+        if (isset($this->args['worker'], $this->worker[$worker = strtolower($this->args['worker'])])) {
90 90
             return $worker;
91 91
         }
92 92
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @param null|\int $pause
110 110
      */
111
-    public function pause($pause=null)
111
+    public function pause($pause = null)
112 112
     {
113
-        if(is_null($pause)){
113
+        if (is_null($pause)) {
114 114
             sleep($this->getPauseValue());
115 115
         }
116
-        else{
116
+        else {
117 117
             sleep($pause);
118 118
         }
119 119
     }
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
     public function __call($name, $arguments)
129 129
     {
130 130
         $job = __NAMESPACE__.'\\'.ucfirst($name).'Job';
131
-        if(Utils::isNamespaceExists($job)){
132
-            return $this->app->resolve($job,['worker'=>$this])->execute();
131
+        if (Utils::isNamespaceExists($job)) {
132
+            return $this->app->resolve($job, ['worker'=>$this])->execute();
133 133
         }
134 134
 
135 135
         exception()->runtime('Job Class not found');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,8 +112,7 @@
 block discarded – undo
112 112
     {
113 113
         if(is_null($pause)){
114 114
             sleep($this->getPauseValue());
115
-        }
116
-        else{
115
+        } else{
117 116
             sleep($pause);
118 117
         }
119 118
     }
Please login to merge, or discard this patch.
src/resta/Console/Source/Worker/Worker.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function run()
32 32
     {
33
-        app()->resolve(WorkerManager::class,['args'=>$this->argument])->execute();
33
+        app()->resolve(WorkerManager::class, ['args'=>$this->argument])->execute();
34 34
     }
35 35
 
36 36
     /**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function create()
40 40
     {
41
-        if(!file_exists(app()->path()->workers())){
41
+        if (!file_exists(app()->path()->workers())) {
42 42
             $this->directory['worker'] = app()->path()->workers();
43 43
             $this->file->makeDirectory($this);
44 44
         }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $this->argument['workerClass'] = ucfirst($this->argument['worker']).'';
48 48
         $this->argument['projectName'] = strtolower($this->projectName());
49 49
 
50
-        $this->touch['worker/worker']= app()->path()->workers().'/'.$this->argument['worker'].'.php';
50
+        $this->touch['worker/worker'] = app()->path()->workers().'/'.$this->argument['worker'].'.php';
51 51
 
52 52
 
53 53
         $this->file->touch($this);
Please login to merge, or discard this patch.