minor #25449 [LDAP] Add missing dots at the end of some exception messages (fabpot)

This PR was merged into the 3.3 branch.

Discussion
----------

[LDAP] Add missing dots at the end of some exception messages

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

For consistency sake.

Commits
-------

8d0b7528bc [LDAP] added missing dots at the end of some exception messages.
This commit is contained in:
Fabien Potencier 2017-12-11 12:40:23 -08:00
commit f744236810
5 changed files with 14 additions and 14 deletions

View File

@ -48,7 +48,7 @@ class Collection implements CollectionInterface
return $count;
}
throw new LdapException(sprintf('Error while retrieving entry count: %s', ldap_error($this->connection->getResource())));
throw new LdapException(sprintf('Error while retrieving entry count: %s.', ldap_error($this->connection->getResource())));
}
public function getIterator()
@ -62,7 +62,7 @@ class Collection implements CollectionInterface
}
if (false === $current) {
throw new LdapException(sprintf('Could not rewind entries array: %s', ldap_error($con)));
throw new LdapException(sprintf('Could not rewind entries array: %s.', ldap_error($con)));
}
yield $this->getSingleEntry($con, $current);
@ -105,7 +105,7 @@ class Collection implements CollectionInterface
$attributes = ldap_get_attributes($con, $current);
if (false === $attributes) {
throw new LdapException(sprintf('Could not fetch attributes: %s', ldap_error($con)));
throw new LdapException(sprintf('Could not fetch attributes: %s.', ldap_error($con)));
}
$attributes = $this->cleanupAttributes($attributes);
@ -113,7 +113,7 @@ class Collection implements CollectionInterface
$dn = ldap_get_dn($con, $current);
if (false === $dn) {
throw new LdapException(sprintf('Could not fetch DN: %s', ldap_error($con)));
throw new LdapException(sprintf('Could not fetch DN: %s.', ldap_error($con)));
}
return new Entry($dn, $attributes);

View File

@ -134,11 +134,11 @@ class Connection extends AbstractConnection
}
if (false === $this->connection) {
throw new LdapException(sprintf('Could not connect to Ldap server: %s', ldap_error($this->connection)));
throw new LdapException(sprintf('Could not connect to Ldap server: %s.', ldap_error($this->connection)));
}
if ('tls' === $this->config['encryption'] && false === ldap_start_tls($this->connection)) {
throw new LdapException(sprintf('Could not initiate TLS connection: %s', ldap_error($this->connection)));
throw new LdapException(sprintf('Could not initiate TLS connection: %s.', ldap_error($this->connection)));
}
}

View File

@ -65,7 +65,7 @@ final class ConnectionOptions
$constantName = self::getOptionName($name);
if (!defined($constantName)) {
throw new LdapException(sprintf('Unknown option "%s"', $name));
throw new LdapException(sprintf('Unknown option "%s".', $name));
}
return constant($constantName);

View File

@ -38,7 +38,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
$con = $this->getConnectionResource();
if (!@ldap_add($con, $entry->getDn(), $entry->getAttributes())) {
throw new LdapException(sprintf('Could not add entry "%s": %s', $entry->getDn(), ldap_error($con)));
throw new LdapException(sprintf('Could not add entry "%s": %s.', $entry->getDn(), ldap_error($con)));
}
return $this;
@ -52,7 +52,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
$con = $this->getConnectionResource();
if (!@ldap_modify($con, $entry->getDn(), $entry->getAttributes())) {
throw new LdapException(sprintf('Could not update entry "%s": %s', $entry->getDn(), ldap_error($con)));
throw new LdapException(sprintf('Could not update entry "%s": %s.', $entry->getDn(), ldap_error($con)));
}
}
@ -64,7 +64,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
$con = $this->getConnectionResource();
if (!@ldap_delete($con, $entry->getDn())) {
throw new LdapException(sprintf('Could not remove entry "%s": %s', $entry->getDn(), ldap_error($con)));
throw new LdapException(sprintf('Could not remove entry "%s": %s.', $entry->getDn(), ldap_error($con)));
}
}
@ -76,7 +76,7 @@ class EntryManager implements EntryManagerInterface, RenameEntryInterface
$con = $this->getConnectionResource();
if (!@ldap_rename($con, $entry->getDn(), $newRdn, null, $removeOldRdn)) {
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": %s', $entry->getDn(), $newRdn, ldap_error($con)));
throw new LdapException(sprintf('Could not rename entry "%s" to "%s": %s.', $entry->getDn(), $newRdn, ldap_error($con)));
}
}

View File

@ -45,7 +45,7 @@ class Query extends AbstractQuery
$this->search = null;
if (!$success) {
throw new LdapException(sprintf('Could not free results: %s', ldap_error($con)));
throw new LdapException(sprintf('Could not free results: %s.', ldap_error($con)));
}
}
@ -73,7 +73,7 @@ class Query extends AbstractQuery
$func = 'ldap_search';
break;
default:
throw new LdapException(sprintf('Could not search in scope "%s"', $this->options['scope']));
throw new LdapException(sprintf('Could not search in scope "%s".', $this->options['scope']));
}
$this->search = @$func(
@ -89,7 +89,7 @@ class Query extends AbstractQuery
}
if (false === $this->search) {
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s"', $this->dn, $this->query, implode(',', $this->options['filter'])));
throw new LdapException(sprintf('Could not complete search with dn "%s", query "%s" and filters "%s".', $this->dn, $this->query, implode(',', $this->options['filter'])));
}
return new Collection($this->connection, $this);