Passed
Push — master ( 9a39c2...62b971 )
by Vitaly
09:11
created
src/GenericFeatureContext.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace samsonframework\behatextension;
6 6
 
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
         $backtrace = debug_backtrace();
90 90
 
91 91
         throw new \Exception(
92
-            'Timeout thrown by '.$backtrace[1]['class'].'::'.$backtrace[1]['function']."()\n"
93
-            .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'].', line '.$backtrace[1]['line'] : '')."\n"
92
+            'Timeout thrown by ' . $backtrace[1]['class'] . '::' . $backtrace[1]['function'] . "()\n"
93
+            .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'] . ', line ' . $backtrace[1]['line'] : '') . "\n"
94 94
             .implode("\n", $failedExceptions)
95 95
         );
96 96
     }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             }
111 111
 
112 112
             $step = $scope->getStep();
113
-            $fileName = 'Fail.'.preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName().'-'.$step->getText()).'.jpg';
113
+            $fileName = 'Fail.' . preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName() . '-' . $step->getText()) . '.jpg';
114 114
             file_put_contents($fileName, $driver->getScreenshot());
115 115
         }
116 116
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     {
129 129
         $elements = [];
130 130
 
131
-        $this->spin(function (MinkContext $context) use ($selector, &$elements) {
131
+        $this->spin(function(MinkContext $context) use ($selector, &$elements) {
132 132
             $session = $context->getSession();
133 133
 
134 134
             $elements = $session->getPage()->findAll('css', $context->fixStepArgument($selector));
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function iSetBrowserWindowSizeToX($width, $height)
169 169
     {
170
-        $this->getSession()->resizeWindow((int) $width, (int) $height, 'current');
170
+        $this->getSession()->resizeWindow((int)$width, (int)$height, 'current');
171 171
     }
172 172
 
173 173
     /**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function iWaitMillisecondsForResponse($delay = self::DELAY)
179 179
     {
180
-        $this->getSession()->wait((int) $delay);
180
+        $this->getSession()->wait((int)$delay);
181 181
     }
182 182
 
183 183
     /**
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      * @param string $page Page for assertion
205 205
      */
206 206
     public function assertPageAddress($page) {
207
-        $this->spin(function (MinkContext $context) use ($page) {
207
+        $this->spin(function(MinkContext $context) use ($page) {
208 208
             $context->assertSession()->addressEquals($this->locatePath($page));
209 209
             return true;
210 210
         });
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function iScrollVerticallyToPx($yPos)
246 246
     {
247
-        $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, '.((int) $yPos).'));');
247
+        $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, ' . ((int)$yPos) . '));');
248 248
     }
249 249
 
250 250
     /**
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function iScrollHorizontallyToPx($xPos)
256 256
     {
257
-        $this->getSession()->executeScript('window.scrollTo('.((int) $xPos).', 0);');
257
+        $this->getSession()->executeScript('window.scrollTo(' . ((int)$xPos) . ', 0);');
258 258
     }
259 259
 
260 260
     /**
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     {
268 268
         // TODO: Change to Mink implementation
269 269
         $this->getSession()->executeScript("
270
-            $('input[name=".$field."]').val('".$value."');
270
+            $('input[name=".$field . "]').val('" . $value . "');
271 271
         ");
272 272
     }
273 273
 
@@ -317,6 +317,6 @@  discard block
 block discarded – undo
317 317
      */
318 318
     public function iFillInTheElementUsingJs(string $selector, string $value)
319 319
     {
320
-        $this->getSession()->executeScript('document.querySelectorAll("'.$selector.'")[0].value="'.$value.'";');
320
+        $this->getSession()->executeScript('document.querySelectorAll("' . $selector . '")[0].value="' . $value . '";');
321 321
     }
322 322
 }
Please login to merge, or discard this patch.