From c3ad7b211a1ae3bb9705aad0a4065fea1fcc7a3d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 24 Jun 2015 09:05:29 +0200 Subject: [PATCH] Ldap\Connection: Rename to LdapConnection refs #8954 --- .../forms/Config/Resource/LdapResourceForm.php | 10 +++++----- .../UserGroup/LdapUserGroupBackendForm.php | 6 +++--- library/Icinga/Data/ResourceFactory.php | 2 +- library/Icinga/Protocol/Ldap/Discovery.php | 8 ++++---- .../Ldap/{Connection.php => LdapConnection.php} | 2 +- library/Icinga/Protocol/Ldap/Node.php | 2 +- library/Icinga/Protocol/Ldap/Root.php | 16 ++++++++-------- library/Icinga/Repository/LdapRepository.php | 8 ++++---- .../library/Icinga/Protocol/Ldap/QueryTest.php | 4 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) rename library/Icinga/Protocol/Ldap/{Connection.php => LdapConnection.php} (99%) diff --git a/application/forms/Config/Resource/LdapResourceForm.php b/application/forms/Config/Resource/LdapResourceForm.php index 0fa0cb47b..6821a8593 100644 --- a/application/forms/Config/Resource/LdapResourceForm.php +++ b/application/forms/Config/Resource/LdapResourceForm.php @@ -7,7 +7,7 @@ use Exception; use Icinga\Web\Form; use Icinga\Data\ConfigObject; use Icinga\Data\ResourceFactory; -use Icinga\Protocol\Ldap\Connection; +use Icinga\Protocol\Ldap\LdapConnection; /** * Form class for adding/modifying ldap resources @@ -27,7 +27,7 @@ class LdapResourceForm extends Form */ public function createElements(array $formData) { - $defaultPort = ! array_key_exists('encryption', $formData) || $formData['encryption'] !== Connection::LDAPS + $defaultPort = ! array_key_exists('encryption', $formData) || $formData['encryption'] !== LdapConnection::LDAPS ? 389 : 636; @@ -75,9 +75,9 @@ class LdapResourceForm extends Form . ' none for unencrypted communication' ), 'multiOptions' => array( - 'none' => $this->translate('None', 'resource.ldap.encryption'), - Connection::STARTTLS => 'STARTTLS', - Connection::LDAPS => 'LDAPS' + 'none' => $this->translate('None', 'resource.ldap.encryption'), + LdapConnection::STARTTLS => 'STARTTLS', + LdapConnection::LDAPS => 'LDAPS' ) ) ); diff --git a/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php b/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php index c3c8baacf..6190ab404 100644 --- a/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php +++ b/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php @@ -8,7 +8,7 @@ use Icinga\Authentication\User\UserBackend; use Icinga\Authentication\UserGroup\LdapUserGroupBackend; use Icinga\Data\ConfigObject; use Icinga\Data\ResourceFactory; -use Icinga\Protocol\Ldap\Connection; +use Icinga\Protocol\Ldap\LdapConnection; use Icinga\Web\Form; use Icinga\Web\Notification; @@ -286,11 +286,11 @@ class LdapUserGroupBackendForm extends Form /** * Return the names of all configured LDAP user backends * - * @param Connection $resource + * @param LdapConnection $resource * * @return array */ - protected function getLdapUserBackendNames(Connection $resource) + protected function getLdapUserBackendNames(LdapConnection $resource) { $names = array(); foreach (Config::app('authentication') as $name => $config) { diff --git a/library/Icinga/Data/ResourceFactory.php b/library/Icinga/Data/ResourceFactory.php index add35baac..6a664759b 100644 --- a/library/Icinga/Data/ResourceFactory.php +++ b/library/Icinga/Data/ResourceFactory.php @@ -8,7 +8,7 @@ use Icinga\Util\ConfigAwareFactory; use Icinga\Exception\ConfigurationError; use Icinga\Data\Db\DbConnection; use Icinga\Protocol\Livestatus\Connection as LivestatusConnection; -use Icinga\Protocol\Ldap\Connection as LdapConnection; +use Icinga\Protocol\Ldap\LdapConnection; use Icinga\Protocol\File\FileReader; /** diff --git a/library/Icinga/Protocol/Ldap/Discovery.php b/library/Icinga/Protocol/Ldap/Discovery.php index 1d7acbab9..1fdcd6755 100644 --- a/library/Icinga/Protocol/Ldap/Discovery.php +++ b/library/Icinga/Protocol/Ldap/Discovery.php @@ -9,7 +9,7 @@ use Icinga\Protocol\Dns; class Discovery { /** - * @var Connection + * @var LdapConnection */ private $connection; @@ -21,9 +21,9 @@ class Discovery { private $discovered = false; /** - * @param Connection $conn The ldap connection to use for the discovery + * @param LdapConnection $conn The ldap connection to use for the discovery */ - public function __construct(Connection $conn) + public function __construct(LdapConnection $conn) { $this->connection = $conn; } @@ -147,7 +147,7 @@ class Discovery { */ public static function discover($host, $port) { - $conn = new Connection(new ConfigObject(array( + $conn = new LdapConnection(new ConfigObject(array( 'hostname' => $host, 'port' => $port ))); diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php similarity index 99% rename from library/Icinga/Protocol/Ldap/Connection.php rename to library/Icinga/Protocol/Ldap/LdapConnection.php index bc5fac185..5d3d7ee4b 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -16,7 +16,7 @@ use Icinga\Protocol\Ldap\Exception as LdapException; /** * Encapsulate LDAP connections and query creation */ -class Connection implements Selectable +class LdapConnection implements Selectable { /** * Indicates that the target object cannot be found diff --git a/library/Icinga/Protocol/Ldap/Node.php b/library/Icinga/Protocol/Ldap/Node.php index d2ad2553d..a8f4ce314 100644 --- a/library/Icinga/Protocol/Ldap/Node.php +++ b/library/Icinga/Protocol/Ldap/Node.php @@ -14,7 +14,7 @@ namespace Icinga\Protocol\Ldap; class Node extends Root { /** - * @var Connection + * @var LdapConnection */ protected $connection; diff --git a/library/Icinga/Protocol/Ldap/Root.php b/library/Icinga/Protocol/Ldap/Root.php index 5f1fb545d..23729d10f 100644 --- a/library/Icinga/Protocol/Ldap/Root.php +++ b/library/Icinga/Protocol/Ldap/Root.php @@ -22,7 +22,7 @@ class Root protected $rdn; /** - * @var Connection + * @var LdapConnection */ protected $connection; @@ -37,9 +37,9 @@ class Root protected $props = array(); /** - * @param Connection $connection + * @param LdapConnection $connection */ - protected function __construct(Connection $connection) + protected function __construct(LdapConnection $connection) { $this->connection = $connection; } @@ -53,10 +53,10 @@ class Root } /** - * @param Connection $connection + * @param LdapConnection $connection * @return Root */ - public static function forConnection(Connection $connection) + public static function forConnection(LdapConnection $connection) { $root = new Root($connection); return $root; @@ -177,17 +177,17 @@ class Root } /** - * @param Connection $connection + * @param LdapConnection $connection * @return $this */ - public function setConnection(Connection $connection) + public function setConnection(LdapConnection $connection) { $this->connection = $connection; return $this; } /** - * @return Connection + * @return LdapConnection */ public function getConnection() { diff --git a/library/Icinga/Repository/LdapRepository.php b/library/Icinga/Repository/LdapRepository.php index 7cf00ae66..ac210516d 100644 --- a/library/Icinga/Repository/LdapRepository.php +++ b/library/Icinga/Repository/LdapRepository.php @@ -3,7 +3,7 @@ namespace Icinga\Repository; -use Icinga\Protocol\Ldap\Connection; +use Icinga\Protocol\Ldap\LdapConnection; /** * Abstract base class for concrete LDAP repository implementations @@ -18,7 +18,7 @@ abstract class LdapRepository extends Repository /** * The datasource being used * - * @var Connection + * @var LdapConnection */ protected $ds; @@ -40,9 +40,9 @@ abstract class LdapRepository extends Repository /** * Create a new LDAP repository object * - * @param Connection $ds The data source to use + * @param LdapConnection $ds The data source to use */ - public function __construct(Connection $ds) + public function __construct(LdapConnection $ds) { parent::__construct($ds); } diff --git a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php index 44e47df78..101550b58 100644 --- a/test/php/library/Icinga/Protocol/Ldap/QueryTest.php +++ b/test/php/library/Icinga/Protocol/Ldap/QueryTest.php @@ -5,7 +5,7 @@ namespace Tests\Icinga\Protocol\Ldap; use Icinga\Data\ConfigObject; use Icinga\Test\BaseTestCase; -use Icinga\Protocol\Ldap\Connection; +use Icinga\Protocol\Ldap\LdapConnection; class QueryTest extends BaseTestCase { @@ -20,7 +20,7 @@ class QueryTest extends BaseTestCase ) ); - $connection = new Connection($config); + $connection = new LdapConnection($config); return $connection->select(); }