Skip to content

Commit 6db1f47

Browse files
committed
PHPCS and readability fixes
1 parent fdace4a commit 6db1f47

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/PHPCouchDB/Server.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function __construct(array $options)
4545
);
4646
}
4747

48-
if (isset($options[self::OPTION_CLIENT]) && $options[self::OPTION_CLIENT] instanceof \GuzzleHttp\ClientInterface) {
48+
if (isset($options[self::OPTION_CLIENT])
49+
&& $options[self::OPTION_CLIENT] instanceof \GuzzleHttp\ClientInterface) {
4950
$client = $options[self::OPTION_CLIENT];
5051
} elseif (isset($options[self::OPTION_URL])) {
5152
// set a descriptive user agent
@@ -133,7 +134,13 @@ public function useDb($options) : Database
133134
$db_name = $options[self::OPTION_NAME];
134135
}
135136

136-
$create_if_not_exists = isset($options[self::OPTION_CREATE_IF_NOT_EXISTS]) ? $options[self::OPTION_CREATE_IF_NOT_EXISTS] : false;
137+
138+
if (isset($options[self::OPTION_CREATE_IF_NOT_EXISTS])) {
139+
$create_if_not_exists = $options[self::OPTION_CREATE_IF_NOT_EXISTS];
140+
} else {
141+
// default value
142+
$create_if_not_exists = false;
143+
}
137144

138145
// does this database exist?
139146
$exists = false;

0 commit comments

Comments
 (0)