8000 minor #58558 [Ldap] Deprecate the `sizeLimit` query option (alexandre… · symfony/symfony@fed083a · GitHub
[go: up one dir, main page]

Skip to content

Commit fed083a

Browse files
committed
minor #58558 [Ldap] Deprecate the sizeLimit query option (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [Ldap] Deprecate the `sizeLimit` query option | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | yes | Issues | Fix #58514 | License | MIT The `sizeLimit` option is never used, it is actually calculated with the `maxItems` option in `Query`. I propose to deprecate the option that is currently no-op anyway. Commits ------- ce66e4e [Ldap] Deprecate the `sizeLimit` query option
2 parents 7f53a39 + ce66e4e commit fed083a

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

UPGRADE-7.2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Ldap
4646
----
4747

4848
* Add methods for `saslBind()` and `whoami()` to `ConnectionInterface` and `LdapInterface`
49+
* Deprecate the `sizeLimit` option of `AbstractQuery`
4950

5051
Mailer
5152
------

src/Symfony/Component/Ldap/Adapter/AbstractQuery.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function __construct(
4343

4444
$resolver->setNormalizer('filter', fn (Options $options, $value) => \is_array($value) ? $value : [$value]);
4545

46+
$resolver->setDeprecated('sizeLimit', 'symfony/ldap', '7.2', 'The "%name%" option is deprecated and will be removed in Symfony 8.0.');
47+
4648
$this->options = $resolver->resolve($options);
4749
}
4850
}

src/Symfony/Component/Ldap/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add methods for `saslBind()` and `whoami()` to `ConnectionInterface` and `LdapInterface`
8+
* Deprecate the `sizeLimit` option of `AbstractQuery`
89

910
7.1
1011
---
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Ldap\Tests\Adapter;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
16+
use Symfony\Component\Ldap\Adapter\AbstractQuery;
17+
use Symfony\Component\Ldap\Adapter\CollectionInterface;
18+
use Symfony\Component\Ldap\Adapter\ConnectionInterface;
19+
20+
class AbstractQueryTest extends TestCase
21+
{
22+
use ExpectUserDeprecationMessageTrait;
23+
24+
/**
25+
* @group legacy
26+
*/
27+
public function testSizeLimitIsDeprecated()
28+
{
29+
$this->expectUserDeprecationMessage('Since symfony/ldap 7.2: The "sizeLimit" option is deprecated and will be removed in Symfony 8.0.');
30+
31+
new class($this->createMock(ConnectionInterface::class), '', '', ['filter' => '*', 'sizeLimit' => 1]) extends AbstractQuery {
32+
public function execute(): CollectionInterface
33+
{
34+
}
35+
};
36+
}
37+
}

0 commit comments

Comments
 (0)
0