Skip to content

[Ldap] Feature/force lowercase attributes #36432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Component/Ldap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
-----

* Added the "extra_fields" option, an array of custom fields to pull from the LDAP server
* Added option to allow consumers to force attribute keys to be lowercase when utilizing the Entry class.

4.3.0
-----
Expand Down
7 changes: 6 additions & 1 deletion src/Symfony/Component/Ldap/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ class Entry
{
private $dn;
private $attributes;
private $force_lowercase_attributes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variables should be named in camelCase

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll change it. I'm surprised the PSR tests didn't pick that up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

friendly ping


public function __construct(string $dn, array $attributes = [])
public function __construct(string $dn, array $attributes = [], bool $force_lowercase_attributes = false)
{
$this->dn = $dn;
$this->attributes = $attributes;

if ($force_lowercase_attributes) {
$this->attributes = array_change_key_case($attributes);
}
}

/**
Expand Down