Skip to content

Commit 17e1dac

Browse files
committed
Typehint BindException
1 parent 9b637e7 commit 17e1dac

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Auth/Events/Failed.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
namespace LdapRecord\Auth\Events;
44

55
use Exception;
6+
use LdapRecord\Auth\BindException;
67
use LdapRecord\LdapInterface;
78

89
class Failed extends Event
910
{
1011
/**
1112
* The exception that was thrown during the bind attempt.
1213
*/
13-
protected Exception $exception;
14+
protected BindException $exception;
1415

1516
/**
1617
* Constructor.
1718
*/
18-
public function __construct(LdapInterface $connection, ?string $username, ?string $password, Exception $exception)
19+
public function __construct(LdapInterface $connection, ?string $username, ?string $password, BindException $exception)
1920
{
2021
parent::__construct($connection, $username, $password);
2122

@@ -25,7 +26,7 @@ public function __construct(LdapInterface $connection, ?string $username, ?strin
2526
/**
2627
* Get the exception that was thrown during the bind attempt.
2728
*/
28-
public function getException(): Exception
29+
public function getException(): BindException
2930
{
3031
return $this->exception;
3132
}

tests/Unit/Log/EventLoggerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace LdapRecord\Tests\Unit\Log;
44

5-
use Exception;
5+
use LdapRecord\Auth\BindException;
66
use LdapRecord\Auth\Events\Bound;
77
use LdapRecord\Auth\Events\Failed;
88
use LdapRecord\Events\Logger;
@@ -40,7 +40,7 @@ public function test_failed_auth_event_reports_result()
4040

4141
$ldap->connect('localhost');
4242

43-
$event = new Failed($ldap, 'jdoe@acme.org', 'super-secret', new Exception());
43+
$event = new Failed($ldap, 'jdoe@acme.org', 'super-secret', new BindException());
4444

4545
$logger = m::mock(LoggerInterface::class);
4646

0 commit comments

Comments
 (0)