Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c0f7e0

Browse filesBrowse files
committed
[LDAP] Fix resource type checks & docblocks on PHP 8.1
1 parent 1636a26 commit 2c0f7e0
Copy full SHA for 2c0f7e0

File tree

2 files changed

+14
-13
lines changed
Filter options

2 files changed

+14
-13
lines changed

‎src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Adapter/ExtLdap/Connection.php
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Ldap\Adapter\ExtLdap;
1313

14+
use LDAP\Connection as LDAPConnection;
1415
use Symfony\Component\Ldap\Adapter\AbstractConnection;
1516
use Symfony\Component\Ldap\Exception\AlreadyExistsException;
1617
use Symfony\Component\Ldap\Exception\ConnectionException;
@@ -32,7 +33,7 @@ class Connection extends AbstractConnection
3233
/** @var bool */
3334
private $bound = false;
3435

35-
/** @var resource */
36+
/** @var resource|LDAPConnection */
3637
private $connection;
3738

3839
/**
@@ -89,9 +90,7 @@ public function bind($dn = null, $password = null)
8990
}
9091

9192
/**
92-
* Returns a link resource.
93-
*
94-
* @return resource
93+
* @return resource|LDAPConnection
9594
*
9695
* @internal
9796
*/
@@ -165,7 +164,7 @@ private function connect()
165164

166165
private function disconnect()
167166
{
168-
if ($this->connection && \is_resource($this->connection)) {
167+
if ($this->connection) {
169168
ldap_unbind($this->connection);
170169
}
171170

‎src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php
+10-8Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Ldap\Adapter\ExtLdap;
1313

14+
use LDAP\Connection as LDAPConnection;
15+
use LDAP\Result;
1416
use Symfony\Component\Ldap\Adapter\AbstractQuery;
1517
use Symfony\Component\Ldap\Exception\LdapException;
1618
use Symfony\Component\Ldap\Exception\NotBoundException;
@@ -27,7 +29,7 @@ class Query extends AbstractQuery
2729
/** @var Connection */
2830
protected $connection;
2931

30-
/** @var resource[] */
32+
/** @var resource[]|Result[] */
3133
private $results;
3234

3335
/** @var array */
@@ -156,7 +158,7 @@ public function execute()
156158
* Returns an LDAP search resource. If this query resulted in multiple searches, only the first
157159
* page will be returned.
158160
*
159-
* @return resource
161+
* @return resource|Result
160162
*
161163
* @internal
162164
*/
@@ -172,7 +174,7 @@ public function getResource($idx = 0)
172174
/**
173175
* Returns all LDAP search resources.
174176
*
175-
* @return resource[]
177+
* @return resource[]|Result[]
176178
*
177179
* @internal
178180
*/
@@ -215,7 +217,7 @@ private function resetPagination()
215217
/**
216218
* Sets LDAP pagination controls.
217219
*
218-
* @param resource $con
220+
* @param resource|LDAPConnection $con
219221
*/
220222
private function controlPagedResult($con, int $pageSize, bool $critical, string $cookie): bool
221223
{
@@ -239,8 +241,8 @@ private function controlPagedResult($con, int $pageSize, bool $critical, string
239241
/**
240242
* Retrieve LDAP pagination cookie.
241243
*
242-
* @param resource $con
243-
* @param resource $result
244+
* @param resource|LDAPConnection $con
245+
* @param resource|Result $result
244246
*/
245247
private function controlPagedResultResponse($con, $result, string $cookie = ''): string
246248
{
@@ -257,9 +259,9 @@ private function controlPagedResultResponse($con, $result, string $cookie = ''):
257259
/**
258260
* Calls actual LDAP search function with the prepared options and parameters.
259261
*
260-
* @param resource $con
262+
* @param resource|LDAPConnection $con
261263
*
262-
* @return resource
264+
* @return resource|Result
263265
*/
264266
private function callSearchFunction($con, string $func, int $sizeLimit)
265267
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.