Skip to content

Commit c8171fb

Browse files
stevebaumangithub-actions[bot]
authored andcommitted
Fix code style
1 parent 79f4d61 commit c8171fb

File tree

18 files changed

+71
-50
lines changed

18 files changed

+71
-50
lines changed

src/Auth/Guard.php

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

55
use Exception;
6+
use LdapRecord\Configuration\ConfigurationException;
67
use LdapRecord\Configuration\DomainConfiguration;
8+
use LdapRecord\ConnectionException;
79
use LdapRecord\Events\DispatcherInterface;
810
use LdapRecord\LdapInterface;
911

@@ -71,7 +73,7 @@ public function attempt(string $username, string $password, bool $stayBound = fa
7173
* Attempt binding a user to the LDAP server. Supports sasl and anonymous binding.
7274
*
7375
* @throws BindException
74-
* @throws \LdapRecord\ConnectionException
76+
* @throws ConnectionException
7577
*/
7678
public function bind(?string $username = null, ?string $password = null): void
7779
{
@@ -102,7 +104,7 @@ public function bind(?string $username = null, ?string $password = null): void
102104
/**
103105
* Authenticate by binding to the LDAP server.
104106
*
105-
* @throws \LdapRecord\ConnectionException
107+
* @throws ConnectionException
106108
*/
107109
protected function authenticate(?string $username = null, ?string $password = null): bool
108110
{
@@ -119,8 +121,8 @@ protected function authenticate(?string $username = null, ?string $password = nu
119121
* Bind to the LDAP server using the configured username and password.
120122
*
121123
* @throws BindException
122-
* @throws \LdapRecord\ConnectionException
123-
* @throws \LdapRecord\Configuration\ConfigurationException
124+
* @throws ConnectionException
125+
* @throws ConfigurationException
124126
*/
125127
public function bindAsConfiguredUser(): void
126128
{

src/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct(DomainConfiguration|array $config = [], ?LdapInterfa
8989
/**
9090
* Set the connection configuration.
9191
*
92-
* @throws Configuration\ConfigurationException
92+
* @throws ConfigurationException
9393
*/
9494
public function setConfiguration(DomainConfiguration|array $config = []): void
9595
{

src/Ldap.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace LdapRecord;
44

55
use LDAP\Connection as RawLdapConnection;
6+
use Ldap\Result;
7+
use Ldap\ResultEntry;
68

79
class Ldap implements LdapInterface
810
{
@@ -24,7 +26,7 @@ public function getEntries(mixed $result): array
2426
*
2527
* @see http://php.net/manual/en/function.ldap-first-entry.php
2628
*
27-
* @param \Ldap\Result $result
29+
* @param Result $result
2830
*/
2931
public function getFirstEntry(mixed $result): mixed
3032
{
@@ -38,7 +40,7 @@ public function getFirstEntry(mixed $result): mixed
3840
*
3941
* @see http://php.net/manual/en/function.ldap-next-entry.php
4042
*
41-
* @param \Ldap\ResultEntry $entry
43+
* @param ResultEntry $entry
4244
*/
4345
public function getNextEntry(mixed $entry): mixed
4446
{
@@ -52,7 +54,7 @@ public function getNextEntry(mixed $entry): mixed
5254
*
5355
* @see http://php.net/manual/en/function.ldap-get-attributes.php
5456
*
55-
* @param \Ldap\ResultEntry $entry
57+
* @param ResultEntry $entry
5658
*/
5759
public function getAttributes(mixed $entry): array|false
5860
{

src/LdapInterface.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace LdapRecord;
44

55
use LDAP\Connection;
6+
use LDAP\Result;
67

78
/**
89
* @see https://ldap.com/ldap-oid-reference-guide
@@ -339,7 +340,7 @@ public function getConnection(): ?Connection;
339340
*
340341
* @see http://php.net/manual/en/function.ldap-get-entries.php
341342
*
342-
* @param \LDAP\Result $result
343+
* @param Result $result
343344
*/
344345
public function getEntries(mixed $result): array;
345346

@@ -348,7 +349,7 @@ public function getEntries(mixed $result): array;
348349
*
349350
* @see https://www.php.net/manual/en/function.ldap-first-entry.php
350351
*
351-
* @param \LDAP\Result $result
352+
* @param Result $result
352353
*/
353354
public function getFirstEntry(mixed $result): mixed;
354355

@@ -357,7 +358,7 @@ public function getFirstEntry(mixed $result): mixed;
357358
*
358359
* @see https://www.php.net/manual/en/function.ldap-next-entry.php
359360
*
360-
* @param \LDAP\Result $entry
361+
* @param Result $entry
361362
*/
362363
public function getNextEntry(mixed $entry): mixed;
363364

@@ -366,14 +367,14 @@ public function getNextEntry(mixed $entry): mixed;
366367
*
367368
* @see https://www.php.net/manual/en/function.ldap-get-attributes.php
368369
*
369-
* @param \LDAP\Result $entry
370+
* @param Result $entry
370371
*/
371372
public function getAttributes(mixed $entry): array|false;
372373

373374
/**
374375
* Reads all the values of the attribute in the entry in the result.
375376
*
376-
* @param \LDAP\Result $entry
377+
* @param Result $entry
377378
*/
378379
public function getValuesLen(mixed $entry, string $attribute): array|false;
379380

@@ -398,7 +399,7 @@ public function getDetailedError(): ?DetailedError;
398399
*
399400
* @see https://www.php.net/manual/en/function.ldap-count-entries.php
400401
*
401-
* @param \LDAP\Result $result
402+
* @param Result $result
402403
*/
403404
public function countEntries(mixed $result): int;
404405

@@ -463,7 +464,7 @@ public function close(): bool;
463464
*
464465
* @see http://php.net/manual/en/function.ldap-search.php
465466
*
466-
* @return \LDAP\Result
467+
* @return Result
467468
*/
468469
public function search(string $dn, string $filter, array $attributes, bool $onlyAttributes = false, int $size = 0, int $time = 0, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): mixed;
469470

@@ -472,7 +473,7 @@ public function search(string $dn, string $filter, array $attributes, bool $only
472473
*
473474
* @see http://php.net/manual/en/function.ldap-list.php
474475
*
475-
* @return \LDAP\Result
476+
* @return Result
476477
*/
477478
public function list(string $dn, string $filter, array $attributes, bool $onlyAttributes = false, int $size = 0, int $time = 0, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): mixed;
478479

@@ -481,7 +482,7 @@ public function list(string $dn, string $filter, array $attributes, bool $onlyAt
481482
*
482483
* @see http://php.net/manual/en/function.ldap-read.php
483484
*
484-
* @return \LDAP\Result
485+
* @return Result
485486
*/
486487
public function read(string $dn, string $filter, array $attributes, bool $onlyAttributes = false, int $size = 0, int $time = 0, int $deref = LDAP_DEREF_NEVER, ?array $controls = null): mixed;
487488

@@ -490,7 +491,7 @@ public function read(string $dn, string $filter, array $attributes, bool $onlyAt
490491
*
491492
* @see https://www.php.net/manual/en/function.ldap-parse-result.php
492493
*
493-
* @param \LDAP\Result $result
494+
* @param Result $result
494495
*/
495496
public function parseResult(mixed $result, int &$errorCode = 0, ?string &$dn = null, ?string &$errorMessage = null, ?array &$referrals = null, ?array &$controls = null): LdapResultResponse|false;
496497

@@ -595,7 +596,7 @@ public function modDelete(string $dn, array $entry): bool;
595596
*
596597
* @see https://www.php.net/manual/en/function.ldap-free-result.php
597598
*
598-
* @param \LDAP\Result $result
599+
* @param Result $result
599600
*/
600601
public function freeResult(mixed $result): bool;
601602

src/Models/ActiveDirectory/Entry.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use InvalidArgumentException;
66
use LdapRecord\Connection;
7+
use LdapRecord\LdapRecordException;
78
use LdapRecord\Models\Attributes\Sid;
89
use LdapRecord\Models\Entry as BaseEntry;
910
use LdapRecord\Models\Events\Updated;
@@ -99,7 +100,7 @@ public function isDeleted(): bool
99100
/**
100101
* Restore a deleted object.
101102
*
102-
* @throws \LdapRecord\LdapRecordException
103+
* @throws LdapRecordException
103104
*/
104105
public function restore(?string $newParentDn = null): bool
105106
{

src/Models/ActiveDirectory/Scopes/InConfigurationContext.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use LdapRecord\Models\ActiveDirectory\Entry;
66
use LdapRecord\Models\Model;
7+
use LdapRecord\Models\ModelNotFoundException;
78
use LdapRecord\Models\Scope;
89
use LdapRecord\Query\Model\Builder;
910

@@ -12,7 +13,7 @@ class InConfigurationContext implements Scope
1213
/**
1314
* Refines the base dn to be inside the configuration context.
1415
*
15-
* @throws \LdapRecord\Models\ModelNotFoundException
16+
* @throws ModelNotFoundException
1617
*/
1718
public function apply(Builder $query, Model $model): void
1819
{
@@ -22,7 +23,7 @@ public function apply(Builder $query, Model $model): void
2223
/**
2324
* Get the LDAP server configuration naming context distinguished name.
2425
*
25-
* @throws \LdapRecord\Models\ModelNotFoundException
26+
* @throws ModelNotFoundException
2627
*/
2728
protected function getConfigurationNamingContext(Model $model): mixed
2829
{

src/Models/Concerns/CanAuthenticate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace LdapRecord\Models\Concerns;
44

5-
/** @mixin \LdapRecord\Models\Model */
5+
use LdapRecord\Models\Model;
6+
7+
/** @mixin Model */
68
trait CanAuthenticate
79
{
810
/**

src/Models/Concerns/HasEvents.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
use LdapRecord\Events\NullDispatcher;
77
use LdapRecord\Models\Events;
88
use LdapRecord\Models\Events\Event;
9+
use LdapRecord\Models\Model;
910
use LdapRecord\Support\Arr;
1011

11-
/** @mixin \LdapRecord\Models\Model */
12+
/** @mixin Model */
1213
trait HasEvents
1314
{
1415
/**

src/Models/Concerns/HasGlobalScopes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
use Closure;
66
use InvalidArgumentException;
7+
use LdapRecord\Models\Model;
78
use LdapRecord\Models\Scope;
89

9-
/** @mixin \LdapRecord\Models\Model */
10+
/** @mixin Model */
1011
trait HasGlobalScopes
1112
{
1213
/**

src/Models/Concerns/HasPassword.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
use LdapRecord\ConnectionException;
66
use LdapRecord\LdapRecordException;
77
use LdapRecord\Models\Attributes\Password;
8+
use LdapRecord\Models\Model;
89

9-
/** @mixin \LdapRecord\Models\Model */
10+
/** @mixin Model */
1011
trait HasPassword
1112
{
1213
/**

0 commit comments

Comments
 (0)