Skip to content

Commit e946fdc

Browse files
[Ldap] Deprecate the sizeLimit query option
1 parent c3f10c3 commit e946fdc

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

UPGRADE-7.2.md

+1
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

+2
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

+1
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
---
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->expectUserDeprecation('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)