Completed
Pull Request — develop (#25)
by Carlo
02:55
created
magefix/src/Magefix/Plugin/Spinner.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function spinUntilVisible($element, $wait = 60)
45 45
     {
46
-        $this->spin(function ($context) use ($element) {
46
+        $this->spin(function($context) use ($element) {
47 47
             return $context->getElement($element)->isVisible();
48 48
         }, $wait);
49 49
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function spinUntilInvisible($element, $wait = 60)
58 58
     {
59
-        $this->spin(function ($context) use ($element) {
59
+        $this->spin(function($context) use ($element) {
60 60
             return ($context->getElement($element)->isVisible() == false);
61 61
         }, $wait);
62 62
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function spinAndClick($element, $wait = 60)
71 71
     {
72
-        $this->spin(function ($context) use ($element) {
72
+        $this->spin(function($context) use ($element) {
73 73
             $context->getElement($element)->click();
74 74
             return true;
75 75
         }, $wait);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function spinAndPress($element, $wait = 60)
85 85
     {
86
-        $this->spin(function ($context) use ($element) {
86
+        $this->spin(function($context) use ($element) {
87 87
             $context->getElement($element)->press();
88 88
             return true;
89 89
         }, $wait);
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
         $backtrace = debug_backtrace();
98 98
 
99 99
         throw new \Exception(
100
-            "Timeout thrown by " . $backtrace[1]['class'] . "::" . $backtrace[1]['function'] . "()\n" .
101
-            $backtrace[1]['file'] . ", line " . $backtrace[1]['line']
100
+            "Timeout thrown by ".$backtrace[1]['class']."::".$backtrace[1]['function']."()\n".
101
+            $backtrace[1]['file'].", line ".$backtrace[1]['line']
102 102
         );
103 103
     }
104 104
 }
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 trait Spinner
14 14
 {
15 15
     /**
16
-     * @param $lambda
16
+     * @param \Closure $lambda
17 17
      * @param int $wait
18
-     * @return bool
18
+     * @return boolean|null
19 19
      * @throws \Exception
20 20
      */
21 21
     public function spin($lambda, $wait = 60)
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
     /**
104 104
      * @param $context
105 105
      * @param $element
106
-     * @param $action
107
-     * @param null $condition
106
+     * @param string $action
107
+     * @param boolean $condition
108 108
      * @return bool
109 109
      */
110 110
     private function _spinnerAction($context, $element, $action, $condition = null)
Please login to merge, or discard this patch.