Skip to content

Commit

Permalink
Extract common LDAP props and functions into base with interface
Browse files Browse the repository at this point in the history
This will help us utilize a complete LDAP fake for the future.
  • Loading branch information
stevebauman committed Jan 24, 2021
1 parent 29e5a95 commit 6e6bb07
Show file tree
Hide file tree
Showing 7 changed files with 785 additions and 583 deletions.
14 changes: 7 additions & 7 deletions src/Auth/Events/Event.php
Expand Up @@ -2,14 +2,14 @@

namespace LdapRecord\Auth\Events;

use LdapRecord\Ldap;
use LdapRecord\LdapInterface;

abstract class Event
{
/**
* The connection that the username and password is being bound on.
*
* @var Ldap
* @var LdapInterface
*/
protected $connection;

Expand All @@ -30,11 +30,11 @@ abstract class Event
/**
* Constructor.
*
* @param Ldap $connection
* @param string $username
* @param string $password
* @param LdapInterface $connection
* @param string $username
* @param string $password
*/
public function __construct(Ldap $connection, $username, $password)
public function __construct(LdapInterface $connection, $username, $password)
{
$this->connection = $connection;
$this->username = $username;
Expand All @@ -44,7 +44,7 @@ public function __construct(Ldap $connection, $username, $password)
/**
* Returns the events connection.
*
* @return Ldap
* @return LdapInterface
*/
public function getConnection()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Auth/Guard.php
Expand Up @@ -4,7 +4,7 @@

use Exception;
use Throwable;
use LdapRecord\Ldap;
use LdapRecord\LdapInterface;
use LdapRecord\Auth\Events\Bound;
use LdapRecord\Auth\Events\Failed;
use LdapRecord\Auth\Events\Passed;
Expand All @@ -18,7 +18,7 @@ class Guard
/**
* The connection to bind to.
*
* @var Ldap
* @var LdapInterface
*/
protected $connection;

Expand All @@ -39,10 +39,10 @@ class Guard
/**
* Constructor.
*
* @param Ldap $connection
* @param LdapInterface $connection
* @param DomainConfiguration $configuration
*/
public function __construct(Ldap $connection, DomainConfiguration $configuration)
public function __construct(LdapInterface $connection, DomainConfiguration $configuration)
{
$this->connection = $connection;
$this->configuration = $configuration;
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/DomainConfiguration.php
Expand Up @@ -2,7 +2,7 @@

namespace LdapRecord\Configuration;

use LdapRecord\Ldap;
use LdapRecord\LdapInterface;

class DomainConfiguration
{
Expand Down Expand Up @@ -31,7 +31,7 @@ class DomainConfiguration
'version' => 3,

// The port to use for connecting to your hosts.
'port' => Ldap::PORT,
'port' => LdapInterface::PORT,

// The base distinguished name of your domain.
'base_dn' => '',
Expand Down

0 comments on commit 6e6bb07

Please sign in to comment.