@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace samsonframework\behatextension; |
6 | 6 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | $backtrace = debug_backtrace(); |
89 | 89 | |
90 | 90 | throw new \Exception( |
91 | - 'Timeout thrown by '.$backtrace[1]['class'].'::'.$backtrace[1]['function']."()\n" |
|
92 | - .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'].', line '.$backtrace[1]['line'] : '')."\n" |
|
91 | + 'Timeout thrown by ' . $backtrace[1]['class'] . '::' . $backtrace[1]['function'] . "()\n" |
|
92 | + .(array_key_exists('file', $backtrace[1]) ? $backtrace[1]['file'] . ', line ' . $backtrace[1]['line'] : '') . "\n" |
|
93 | 93 | .implode("\n", $failedExceptions) |
94 | 94 | ); |
95 | 95 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | $step = $scope->getStep(); |
112 | - $fileName = 'Fail.'.preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName().'-'.$step->getText()).'.jpg'; |
|
112 | + $fileName = 'Fail.' . preg_replace('/[^a-zA-Z0-9-_\.]/', '_', $scope->getName() . '-' . $step->getText()) . '.jpg'; |
|
113 | 113 | file_put_contents($fileName, $driver->getScreenshot()); |
114 | 114 | } |
115 | 115 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function iSetBrowserWindowSizeToX($width, $height) |
161 | 161 | { |
162 | - $this->getSession()->resizeWindow((int) $width, (int) $height, 'current'); |
|
162 | + $this->getSession()->resizeWindow((int)$width, (int)$height, 'current'); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function iWaitMillisecondsForResponse($delay = self::DELAY) |
171 | 171 | { |
172 | - $this->getSession()->wait((int) $delay); |
|
172 | + $this->getSession()->wait((int)$delay); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function iScrollVerticallyToPx($yPos) |
223 | 223 | { |
224 | - $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, '.((int) $yPos).'));'); |
|
224 | + $this->getSession()->executeScript('window.scrollTo(0, Math.min(document.documentElement.scrollHeight, document.body.scrollHeight, ' . ((int)$yPos) . '));'); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function iScrollHorizontallyToPx($xPos) |
233 | 233 | { |
234 | - $this->getSession()->executeScript('window.scrollTo('.((int) $xPos).', 0);'); |
|
234 | + $this->getSession()->executeScript('window.scrollTo(' . ((int)$xPos) . ', 0);'); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | // TODO: Change to Mink implementation |
246 | 246 | $this->getSession()->executeScript(" |
247 | - $('input[name=".$field."]').val('".$value."'); |
|
247 | + $('input[name=".$field . "]').val('" . $value . "'); |
|
248 | 248 | "); |
249 | 249 | } |
250 | 250 | |
@@ -294,6 +294,6 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function iFillInTheElementUsingJs(string $selector, string $value) |
296 | 296 | { |
297 | - $this->getSession()->executeScript('document.querySelectorAll("'.$selector.'")[0].value="'.$value.'";'); |
|
297 | + $this->getSession()->executeScript('document.querySelectorAll("' . $selector . '")[0].value="' . $value . '";'); |
|
298 | 298 | } |
299 | 299 | } |