Skip to content

Commit

Permalink
Fix phpcs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jun 4, 2022
1 parent 1aa5b7c commit 105138b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
43 changes: 20 additions & 23 deletions src/Connector/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,24 @@ class Ldap implements ConnectorInterface
public function __construct(
string $connection_strings,
string $encryption = 'ssl',
int $version = 3,
int $version = 3,
string $extension = 'ext_ldap',
bool $debug = false,
array $options = ['referrals' => false, 'network_timeout' => 3]
bool $debug = false,
array $options = ['referrals' => false, 'network_timeout' => 3]
) {
foreach (explode(' ', $connection_strings) as $connection_string) {
Assert::regex($connection_string, '#^ldap[s]?:\/\/#');
}

Logger::debug(
sprintf(
"Setting up LDAP connection: host='%s', encryption=%s, version=%d, debug=%s, timeout=%d, referrals=%s.",
$connection_strings,
$encryption,
$version,
var_export($debug, true),
$options['timeout'] ?? ini_get('default_socket_timeout'),
var_export($options['referrals'] ?? false, true),
));
Logger::debug(sprintf(
"Setting up LDAP connection: host='%s', encryption=%s, version=%d, debug=%s, timeout=%d, referrals=%s.",
$connection_strings,
$encryption,
$version,
var_export($debug, true),
$options['timeout'] ?? ini_get('default_socket_timeout'),
var_export($options['referrals'] ?? false, true),
));

$this->adapter = new Adapter(
[
Expand Down Expand Up @@ -111,12 +110,11 @@ public function bind(string $username, ?string $password): void
* @inheritDoc
*/
public function search(
array $searchBase,
array $searchBase,
string $filter,
array $options,
bool $allowMissing
): ?Entry
{
array $options,
bool $allowMissing
): ?Entry {
$entry = null;

foreach ($searchBase as $base) {
Expand Down Expand Up @@ -164,12 +162,11 @@ public function search(
* @inheritDoc
*/
public function searchForMultiple(
array $searchBase,
array $searchBase,
string $filter,
array $options,
bool $allowMissing
): array
{
array $options,
bool $allowMissing
): array {
$results = [];

foreach ($searchBase as $base) {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Auth/Source/LdapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function buildSourceMock(): Ldap
$mb = $this->getMockBuilder(ConnectorInterface::class);
$s = $mb->getMock();

return new class($s) extends Ldap {
return new class ($s) extends Ldap {
public ConnectorInterface $connector;

public function __construct(ConnectorInterface $connector)
Expand Down

0 comments on commit 105138b

Please sign in to comment.