Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4eabdf4

Browse files
committed
[HttpClient] Simplify xml configuration + buffer info + buffer validation
1 parent b18b659 commit 4eabdf4

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,9 +1394,9 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode)
13941394
->info('A list of SSL/TLS ciphers separated by colons, commas or spaces (e.g. "RC3-SHA:TLS13-AES-128-GCM-SHA256"...)')
13951395
->end()
13961396
->scalarNode('buffer')
1397-
->info('Response content should be buffered or not')
1397+
->info('Whether the response content should be buffered or a regex telling which content-types should be')
13981398
->validate()
1399-
->ifTrue(function ($v) { return !\is_bool($v) && (\is_string($v) && false === @preg_match($v, '')); })
1399+
->ifTrue(function ($v) { return !\is_bool($v) && (!\is_string($v) || false === @preg_match($v, '')); })
14001400
->thenInvalid('Buffer option should be a boolean or a valid regex')
14011401
->end()
14021402
->end()
@@ -1537,9 +1537,9 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode)
15371537
->info('A list of SSL/TLS ciphers separated by colons, commas or spaces (e.g. "RC3-SHA:TLS13-AES-128-GCM-SHA256"...)')
15381538
->end()
15391539
->scalarNode('buffer')
1540-
->info('Response content should be buffered or not')
1540+
->info('Whether the response content should be buffered or a regex telling which content-types should be')
15411541
->validate()
1542-
->ifTrue(function ($v) { return !\is_bool($v) && (\is_string($v) && false === @preg_match($v, '')); })
1542+
->ifTrue(function ($v) { return !\is_bool($v) && (!\is_string($v) || false === @preg_match($v, '')); })
15431543
->thenInvalid('Buffer option should be a boolean or a valid regex')
15441544
->end()
15451545
->end()

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,7 @@
503503
<xsd:attribute name="local-pk" type="xsd:string" />
504504
<xsd:attribute name="passphrase" type="xsd:string" />
505505
<xsd:attribute name="ciphers" type="xsd:string" />
506-
<xsd:attribute name="buffer">
507-
<xsd:simpleType>
508-
<xsd:union memberTypes="xsd:string xsd:boolean" />
509-
</xsd:simpleType>
510-
</xsd:attribute>
506+
<xsd:attribute name="buffer" type="xsd:string" />
511507

512508
</xsd:complexType>
513509

0 commit comments

Comments
 (0)