Skip to content

Commit d5558fb

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent 405cc7e commit d5558fb

File tree

8 files changed

+30
-6
lines changed

8 files changed

+30
-6
lines changed

Adapter/AbstractConnection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function __construct(array $config = [])
3030
$this->config = $resolver->resolve($config);
3131
}
3232

33+
/**
34+
* @return void
35+
*/
3336
protected function configureOptions(OptionsResolver $resolver)
3437
{
3538
$resolver->setDefaults([

Adapter/ExtLdap/Connection.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function isBound(): bool
6363

6464
/**
6565
* @param string $password WARNING: When the LDAP server allows unauthenticated binds, a blank $password will always be valid
66+
*
67+
* @return void
6668
*/
6769
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null)
6870
{
@@ -96,13 +98,19 @@ public function getResource()
9698
return $this->connection;
9799
}
98100

101+
/**
102+
* @return void
103+
*/
99104
public function setOption(string $name, array|string|int|bool $value)
100105
{
101106
if (!@ldap_set_option($this->connection, ConnectionOptions::getOption($name), $value)) {
102107
throw new LdapException(sprintf('Could not set value "%s" for option "%s".', $value, $name));
103108
}
104109
}
105110

111+
/**
112+
* @return array|string|int|null
113+
*/
106114
public function getOption(string $name)
107115
{
108116
if (!@ldap_get_option($this->connection, ConnectionOptions::getOption($name), $ret)) {
@@ -112,6 +120,9 @@ public function getOption(string $name)
112120
return $ret;
113121
}
114122

123+
/**
124+
* @return void
125+
*/
115126
protected function configureOptions(OptionsResolver $resolver)
116127
{
117128
parent::configureOptions($resolver);
@@ -138,7 +149,7 @@ protected function configureOptions(OptionsResolver $resolver)
138149
});
139150
}
140151

141-
private function connect()
152+
private function connect(): void
142153
{
143154
if ($this->connection) {
144155
return;
@@ -167,7 +178,7 @@ private function connect()
167178
}
168179
}
169180

170-
private function disconnect()
181+
private function disconnect(): void
171182
{
172183
if ($this->connection) {
173184
ldap_unbind($this->connection);

Adapter/ExtLdap/EntryManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public function removeAttributeValues(Entry $entry, string $attribute, array $va
111111
return $this;
112112
}
113113

114+
/**
115+
* @return $this
116+
*/
114117
public function rename(Entry $entry, string $newRdn, bool $removeOldRdn = true)
115118
{
116119
$con = $this->getConnectionResource();

Adapter/ExtLdap/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function getResources(): array
160160
/**
161161
* Resets pagination on the current connection.
162162
*/
163-
private function resetPagination()
163+
private function resetPagination(): void
164164
{
165165
$con = $this->connection->getResource();
166166
$this->controlPagedResult(0, false, '');

Entry.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public function getAttributes(): array
9696

9797
/**
9898
* Sets a value for the given attribute.
99+
*
100+
* @return void
99101
*/
100102
public function setAttribute(string $name, array $value)
101103
{
@@ -105,6 +107,8 @@ public function setAttribute(string $name, array $value)
105107

106108
/**
107109
* Removes a given attribute.
110+
*
111+
* @return void
108112
*/
109113
public function removeAttribute(string $name)
110114
{

Ldap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(AdapterInterface $adapter)
2929
$this->adapter = $adapter;
3030
}
3131

32-
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null)
32+
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null): void
3333
{
3434
$this->adapter->getConnection()->bind($dn, $password);
3535
}

Security/CheckLdapCredentialsListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public function __construct(ContainerInterface $ldapLocator)
3636
$this->ldapLocator = $ldapLocator;
3737
}
3838

39+
/**
40+
* @return void
41+
*/
3942
public function onCheckPassport(CheckPassportEvent $event)
4043
{
4144
$passport = $event->getPassport();

Security/LdapUser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getUserIdentifier(): string
7575
return $this->identifier;
7676
}
7777

78-
public function eraseCredentials()
78+
public function eraseCredentials(): void
7979
{
8080
$this->password = null;
8181
}
@@ -85,7 +85,7 @@ public function getExtraFields(): array
8585
return $this->extraFields;
8686
}
8787

88-
public function setPassword(#[\SensitiveParameter] string $password)
88+
public function setPassword(#[\SensitiveParameter] string $password): void
8989
{
9090
$this->password = $password;
9191
}

0 commit comments

Comments
 (0)