Skip to content

[Ldap] 5.x Ldap Entry case-sensitive attribute key option #39079

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 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Coding standard patch
  • Loading branch information
karlshea committed Nov 13, 2020
commit 4ed0b884b4aa7be16ff8580ba7970857a7c61b36
15 changes: 7 additions & 8 deletions src/Symfony/Component/Ldap/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public function __construct(string $dn, array $attributes = [])
$this->dn = $dn;
$this->lowerMap = [];

foreach ($attributes as $key => $attribute)
{
foreach ($attributes as $key => $attribute) {
$this->setAttribute($key, $attribute);
}
}
Expand All @@ -45,8 +44,8 @@ public function getDn()
/**
* Returns whether an attribute exists.
*
* @param string $name The name of the attribute
* @param bool $caseSensitive Whether the check should be case-sensitive
* @param string $name The name of the attribute
* @param bool $caseSensitive Whether the check should be case-sensitive
*
* @return bool
*/
Expand All @@ -67,8 +66,8 @@ public function hasAttribute(string $name, $caseSensitive = true)
* As LDAP can return multiple values for a single attribute,
* this value is returned as an array.
*
* @param string $name The name of the attribute
* @param bool $caseSensitive Whether the attribute name is case-sensitive
* @param string $name The name of the attribute
* @param bool $caseSensitive Whether the attribute name is case-sensitive
*
* @return array|null
*/
Expand Down Expand Up @@ -114,8 +113,8 @@ public function removeAttribute(string $name)
/**
* Get the attribute key.
*
* @param string $name The attribute name
* @param bool $caseSensitive Whether the attribute name is case-sensitive
* @param string $name The attribute name
* @param bool $caseSensitive Whether the attribute name is case-sensitive
*
* @return string|null
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Ldap/Tests/EntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCaseSensitiveAttributeAccessors()
$this->assertFalse($entry->hasAttribute('givenname', true));
$this->assertTrue($entry->hasAttribute('givenname', false));

$this->assertSame(null, $entry->getAttribute('givenname', true));
$this->assertNull($entry->getAttribute('givenname', true));
$this->assertSame($givenName, $entry->getAttribute('givenname', false)[0]);

$firstName = 'Fabien';
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy