Skip to content

Commit 8e5fd2f

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: Fix some Composer keywords [FrameworkBundle] Rename limiter’s `strategy` to `policy` in XSD [VarDumper] Fixed dumping of CutStub Fix test Change limit argument from string to integer. [Messenger] Fix `evaluate()` calls in `WorkerTest` [Mailer] STDOUT blocks infinitely under Windows when STDERR is filled
2 parents c085f58 + 4159ad8 commit 8e5fd2f

File tree

15 files changed

+57
-18
lines changed

15 files changed

+57
-18
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@
776776
<xsd:attribute name="lock-factory" type="xsd:string" />
777777
<xsd:attribute name="storage-service" type="xsd:string" />
778778
<xsd:attribute name="cache-pool" type="xsd:string" />
779-
<xsd:attribute name="strategy" type="xsd:string" />
779+
<xsd:attribute name="policy" type="xsd:string" />
780780
<xsd:attribute name="limit" type="xsd:int" />
781781
<xsd:attribute name="interval" type="xsd:string" />
782782
</xsd:complexType>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:framework="http://symfony.com/schema/dic/symfony"
6+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
7+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
8+
9+
<framework:config>
10+
<framework:rate-limiter>
11+
<framework:limiter
12+
name="sliding_window"
13+
policy="sliding_window"
14+
limit="30"
15+
lock-factory="null"
16+
/>
17+
</framework:rate-limiter>
18+
</framework:config>
19+
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Config\FileLocator;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17+
use Symfony\Component\RateLimiter\Policy\SlidingWindowLimiter;
1718

1819
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
1920
{
@@ -66,4 +67,11 @@ public function testLegacyExceptionsConfig()
6667
'status_code' => 500,
6768
], $configuration[\Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::class]);
6869
}
70+
71+
public function testRateLimiter()
72+
{
73+
$container = $this->createContainerFromFile('rate_limiter');
74+
75+
$this->assertTrue($container->hasDefinition('limiter.sliding_window'));
76+
}
6977
}

src/Symfony/Component/Console/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "symfony/console",
33
"type": "library",
44
"description": "Eases the creation of beautiful and testable command line interfaces",
5-
"keywords": ["console", "cli", "command line", "terminal"],
5+
"keywords": ["console", "cli", "command-line", "terminal"],
66
"homepage": "https://symfony.com",
77
"license": "MIT",
88
"authors": [

src/Symfony/Component/HttpClient/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "symfony/http-client",
33
"type": "library",
44
"description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously",
5+
"keywords": ["http"],
56
"homepage": "https://symfony.com",
67
"license": "MIT",
78
"authors": [

src/Symfony/Component/HttpKernel/Profiler/Profiler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ public function purge()
115115
/**
116116
* Finds profiler tokens for the given criteria.
117117
*
118-
* @param string|null $limit The maximum number of tokens to return
118+
* @param int|null $limit The maximum number of tokens to return
119119
* @param string|null $start The start date to search from
120120
* @param string|null $end The end date to search to
121121
*
122122
* @see https://php.net/datetime.formats for the supported date/time formats
123123
*/
124-
public function find(?string $ip, ?string $url, ?string $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null): array
124+
public function find(?string $ip, ?string $url, ?int $limit, ?string $method, ?string $start, ?string $end, string $statusCode = null): array
125125
{
126126
return $this->storage->find($ip, $url, $limit, $method, $this->getTimestamp($start), $this->getTimestamp($end), $statusCode);
127127
}

src/Symfony/Component/Ldap/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "symfony/ldap",
33
"type": "library",
44
"description": "Provides a LDAP client for PHP on top of PHP's ldap extension",
5-
"keywords": ["ldap", "active directory"],
5+
"keywords": ["ldap", "active-directory"],
66
"homepage": "https://symfony.com",
77
"license": "MIT",
88
"authors": [

src/Symfony/Component/Lock/Tests/Store/DoctrineDbalStoreTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,15 @@ public function testTableCreationInTransactionNotSupported()
153153
$conn->expects($this->atLeast(2))
154154
->method('executeStatement')
155155
->willReturnCallback(function ($sql) use (&$series) {
156-
[$constraint, $return] = array_shift($series);
157-
$constraint->evaluate($sql);
156+
if ([$constraint, $return] = array_shift($series)) {
157+
$constraint->evaluate($sql);
158+
}
158159

159160
if ($return instanceof \Exception) {
160161
throw $return;
161162
}
162163

163-
return $return;
164+
return $return ?? 1;
164165
})
165166
;
166167

@@ -194,14 +195,15 @@ public function testCreatesTableOutsideTransaction()
194195
$conn->expects($this->atLeast(3))
195196
->method('executeStatement')
196197
->willReturnCallback(function ($sql) use (&$series) {
197-
[$constraint, $return] = array_shift($series);
198-
$constraint->evaluate($sql);
198+
if ([$constraint, $return] = array_shift($series)) {
199+
$constraint->evaluate($sql);
200+
}
199201

200202
if ($return instanceof \Exception) {
201203
throw $return;
202204
}
203205

204-
return $return;
206+
return $return ?? 1;
205207
})
206208
;
207209

src/Symfony/Component/Mailer/Transport/Smtp/Stream/ProcessStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function initialize(): void
3535
$descriptorSpec = [
3636
0 => ['pipe', 'r'],
3737
1 => ['pipe', 'w'],
38-
2 => ['pipe', 'w'],
38+
2 => ['pipe', '\\' === \DIRECTORY_SEPARATOR ? 'a' : 'w'],
3939
];
4040
$pipes = [];
4141
$this->stream = proc_open($this->command, $descriptorSpec, $pipes);

src/Symfony/Component/Messenger/Tests/WorkerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function testWorkerDispatchesEventsOnSuccess()
206206
$eventDispatcher->expects($this->exactly(5))
207207
->method('dispatch')
208208
->willReturnCallback(function ($event) use (&$series) {
209-
array_shift($series)->evaluate($event, '', true);
209+
array_shift($series)->evaluate($event);
210210

211211
if ($event instanceof WorkerRunningEvent) {
212212
$event->getWorker()->stop();
@@ -260,7 +260,7 @@ public function testWorkerDispatchesEventsOnError()
260260
$eventDispatcher->expects($this->exactly(5))
261261
->method('dispatch')
262262
->willReturnCallback(function ($event) use (&$series) {
263-
array_shift($series)->evaluate($event, '', true);
263+
array_shift($series)->evaluate($event);
264264

265265
if ($event instanceof WorkerRunningEvent) {
266266
$event->getWorker()->stop();

0 commit comments

Comments
 (0)