Skip to content

Commit 46a60f5

Browse files
committed
some code formatting
1 parent 5436d6a commit 46a60f5

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# How to contribute
2+
23
At Codeception we are glad to receive contributions and patches from the community. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
34

45
Please check the guide for sending your contributions with Github at https://github.com/Codeception/Codeception/wiki/Git-workflow-for-Codeception-contributors

src/Codeception/Lib/InnerBrowser.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,25 +355,26 @@ protected function getFormUrl($form)
355355
}
356356

357357
$build = parse_url($currentUrl);
358-
$uriparts = parse_url($action);
359-
360358
if ($build === false) {
361-
throw new \Codeception\Exception\TestRuntime("URL '{$currentUrl}' is malformed");
362-
} elseif ($uriparts === false) {
363-
throw new \Codeception\Exception\TestRuntime("URI '{$action}' is malformed");
359+
throw new TestRuntime("URL '$currentUrl' is malformed");
360+
}
361+
362+
$uriParts = parse_url($action);
363+
if ($uriParts === false) {
364+
throw new TestRuntime("URI '$action' is malformed");
364365
}
365366

366-
foreach ($uriparts as $part => $value) {
367+
foreach ($uriParts as $part => $value) {
367368
if ($part === 'path' && strpos($value, '/') !== 0 && !empty($build[$part])) {
368369
// if it ends with a slash, relative paths are below it
369370
if (preg_match('~/$~', $build[$part])) {
370371
$build[$part] = $build[$part] . $value;
371-
} else {
372-
$build[$part] = dirname($build[$part]) . '/' . $value;
372+
continue;
373373
}
374-
} else {
375-
$build[$part] = $value;
374+
$build[$part] = dirname($build[$part]) . '/' . $value;
375+
continue;
376376
}
377+
$build[$part] = $value;
377378
}
378379
return \GuzzleHttp\Url::buildUrl($build);
379380
}

0 commit comments

Comments
 (0)