Skip to content

Commit a606847

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 2cbf3c0 + d4eedd2 commit a606847

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

Adapter/ExtLdap/Adapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function escape($subject, $ignore = '', $flags = 0)
7272
$value = ldap_escape($subject, $ignore, $flags);
7373

7474
// Per RFC 4514, leading/trailing spaces should be encoded in DNs, as well as carriage returns.
75-
if ((int) $flags & LDAP_ESCAPE_DN) {
75+
if ((int) $flags & \LDAP_ESCAPE_DN) {
7676
if (!empty($value) && ' ' === $value[0]) {
7777
$value = '\\20'.substr($value, 1);
7878
}

Adapter/ExtLdap/Query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,14 @@ private function resetPagination()
193193
//
194194
// This is not supported in PHP < 7.2, so these versions will remain broken.
195195
$ctl = [];
196-
ldap_get_option($con, LDAP_OPT_SERVER_CONTROLS, $ctl);
196+
ldap_get_option($con, \LDAP_OPT_SERVER_CONTROLS, $ctl);
197197
if (!empty($ctl)) {
198198
foreach ($ctl as $idx => $info) {
199199
if (static::PAGINATION_OID == $info['oid']) {
200200
unset($ctl[$idx]);
201201
}
202202
}
203-
ldap_set_option($con, LDAP_OPT_SERVER_CONTROLS, $ctl);
203+
ldap_set_option($con, \LDAP_OPT_SERVER_CONTROLS, $ctl);
204204
}
205205
}
206206
}

Adapter/ExtLdap/UpdateOperation.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class UpdateOperation
2020
private $attribute;
2121

2222
private $validOperationTypes = [
23-
LDAP_MODIFY_BATCH_ADD,
24-
LDAP_MODIFY_BATCH_REMOVE,
25-
LDAP_MODIFY_BATCH_REMOVE_ALL,
26-
LDAP_MODIFY_BATCH_REPLACE,
23+
\LDAP_MODIFY_BATCH_ADD,
24+
\LDAP_MODIFY_BATCH_REMOVE,
25+
\LDAP_MODIFY_BATCH_REMOVE_ALL,
26+
\LDAP_MODIFY_BATCH_REPLACE,
2727
];
2828

2929
/**
@@ -37,7 +37,7 @@ public function __construct(int $operationType, string $attribute, ?array $value
3737
if (!\in_array($operationType, $this->validOperationTypes, true)) {
3838
throw new UpdateOperationException(sprintf('"%s" is not a valid modification type.', $operationType));
3939
}
40-
if (LDAP_MODIFY_BATCH_REMOVE_ALL === $operationType && null !== $values) {
40+
if (\LDAP_MODIFY_BATCH_REMOVE_ALL === $operationType && null !== $values) {
4141
throw new UpdateOperationException(sprintf('$values must be null for LDAP_MODIFY_BATCH_REMOVE_ALL operation, "%s" given.', \gettype($values)));
4242
}
4343

Tests/Adapter/ExtLdap/AdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testLdapPagination()
153153
$this->assertEquals(\count($fully_paged_query->getResources()), 1);
154154
$this->assertEquals(\count($paged_query->getResources()), 5);
155155

156-
if (PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2)) {
156+
if (\PHP_MAJOR_VERSION > 7 || (\PHP_MAJOR_VERSION == 7 && \PHP_MINOR_VERSION >= 2)) {
157157
// This last query is to ensure that we haven't botched the state of our connection
158158
// by not resetting pagination properly. extldap <= PHP 7.1 do not implement the necessary
159159
// bits to work around an implementation flaw, so we simply can't guarantee this to work there.

Tests/Adapter/ExtLdap/LdapManagerTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function testLdapApplyOperationsRemoveAllWithArrayError()
272272

273273
$this->expectException(UpdateOperationException::class);
274274

275-
$entryManager->applyOperations($entry->getDn(), [new UpdateOperation(LDAP_MODIFY_BATCH_REMOVE_ALL, 'mail', [])]);
275+
$entryManager->applyOperations($entry->getDn(), [new UpdateOperation(\LDAP_MODIFY_BATCH_REMOVE_ALL, 'mail', [])]);
276276
}
277277

278278
public function testLdapApplyOperationsWithWrongConstantError()
@@ -295,8 +295,8 @@ public function testApplyOperationsAddRemoveAttributeValues()
295295
$entry = $result[0];
296296

297297
$entryManager->applyOperations($entry->getDn(), [
298-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
299-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
298+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
299+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
300300
]);
301301

302302
$result = $this->executeSearchQuery(1);
@@ -305,8 +305,8 @@ public function testApplyOperationsAddRemoveAttributeValues()
305305
$this->assertCount(6, $newEntry->getAttribute('mail'));
306306

307307
$entryManager->applyOperations($entry->getDn(), [
308-
new UpdateOperation(LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
309-
new UpdateOperation(LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
308+
new UpdateOperation(\LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
309+
new UpdateOperation(\LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
310310
]);
311311

312312
$result = $this->executeSearchQuery(1);
@@ -318,13 +318,13 @@ public function testApplyOperationsAddRemoveAttributeValues()
318318
public function testUpdateOperationsWithIterator()
319319
{
320320
$iteratorAdd = new \ArrayIterator([
321-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
322-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
321+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
322+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
323323
]);
324324

325325
$iteratorRemove = new \ArrayIterator([
326-
new UpdateOperation(LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
327-
new UpdateOperation(LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
326+
new UpdateOperation(\LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot@example.org', 'fabpot2@example.org']),
327+
new UpdateOperation(\LDAP_MODIFY_BATCH_REMOVE, 'mail', ['fabpot3@example.org', 'fabpot4@example.org']),
328328
]);
329329

330330
$entryManager = $this->adapter->getEntryManager();
@@ -350,8 +350,8 @@ public function testUpdateOperationsWithIterator()
350350
public function testUpdateOperationsThrowsExceptionWhenAddedDuplicatedValue()
351351
{
352352
$duplicateIterator = new \ArrayIterator([
353-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org']),
354-
new UpdateOperation(LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org']),
353+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org']),
354+
new UpdateOperation(\LDAP_MODIFY_BATCH_ADD, 'mail', ['fabpot@example.org']),
355355
]);
356356

357357
$entryManager = $this->adapter->getEntryManager();

0 commit comments

Comments
 (0)