Skip to content

Commit e50bc7e

Browse files
Improve codestyle
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
1 parent 288793e commit e50bc7e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,10 @@ private function connect()
159159
}
160160
}
161161

162-
$connectResult = ldap_connect($this->config['connection_string']);
163-
164-
if (false === $connectResult) {
165-
throw new LdapException('Syntax of the (computed) connection string is bad: '.$this->config['connection_string']);
162+
if (false === $connection = ldap_connect($this->config['connection_string'])) {
163+
throw new LdapException('Invalid connection string: '.$this->config['connection_string']);
166164
} else {
167-
$this->connection = $connectResult;
165+
$this->connection = $connection;
168166
}
169167

170168
foreach ($this->config['options'] as $name => $value) {

0 commit comments

Comments
 (0)